Hostname: page-component-76fb5796d-zzh7m Total loading time: 0 Render date: 2024-04-26T21:58:10.784Z Has data issue: false hasContentIssue false

Parallel backtracking with answer memoing for independent and-parallelism

Published online by Cambridge University Press:  06 July 2011

PABLO CHICO DE GUZMÁN
Affiliation:
School of Computer Science, Universidad Politécnica de Madrid, Spain (e-mail: pchico@clip.dia.fi.upm.es)
AMADEO CASAS
Affiliation:
Samsung Research, USA (e-mail: amadeo.c@samsung.com)
MANUEL CARRO
Affiliation:
School of Computer Science, Universidad Politécnica de Madrid, Spain, IMDEA Software Institute, Spain (e-mail: mcarro@fi.upm.es, herme@fi.upm.es, manuel.carro@imdea.org, manuel.hermenegildo@imdea.org)
MANUEL V. HERMENEGILDO
Affiliation:
School of Computer Science, Universidad Politécnica de Madrid, Spain, IMDEA Software Institute, Spain (e-mail: mcarro@fi.upm.es, herme@fi.upm.es, manuel.carro@imdea.org, manuel.hermenegildo@imdea.org)

Abstract

Goal-level Independent and-parallelism (IAP) is exploited by scheduling for simultaneous execution of two or more goals, which will not interfere with each other at run time. This can be done safely even if such goals can produce multiple answers. The most successful IAP implementations to date have used recomputation of answers and sequentially ordered backtracking. While in principle simplifying the implementation, recomputation can be very inefficient if the granularity of the parallel goals is large enough and they produce several answers, while sequentially ordered backtracking limits parallelism. And, despite the expected simplification, the implementation of the classic schemes has proved to involve complex engineering, with the consequent difficulty for system maintenance and extension, while still frequently running into the well-known trapped goal and garbage slot problems. This work presents an alternative parallel backtracking model for IAP and its implementation. The model features parallel out-of-order (i.e., nonchronological) backtracking and relies on answer memoization to reuse and combine answers. We show that this approach can bring significant performance advantages. Also, it can bring some simplification to the important engineering task involved in implementing the backtracking mechanism of previous approaches.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2011

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Ait-Kaci, H. 1991. Warren's Abstract Machine, A Tutorial Reconstruction. MIT Press.CrossRefGoogle Scholar
Ali, K. A. M. and Karlsson, R. 1990. The Muse or-parallel Prolog model and its performance. In 1990 North American Conference on Logic Programming. MIT Press, 757776.Google Scholar
Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, P. and Puebla, G., Eds., 2009. The Ciao System. Ref. Manual (v1.13). Technical Report, School of Computer Science, Technical University of Madrid (UPM), Spain. URL: http://www.ciaohome.orgGoogle Scholar
Cabeza, D. 2004. An Extensible, Global Analysis Friendly Logic Programming System. PhD Thesis, Universidad Politécnica de Madrid (UPM), Facultad Informatica UPM, Madrid, Spain.Google Scholar
Casas, A., Carro, M. and Hermenegildo, M. 2007. Annotation algorithms for unrestricted independent and-parallelism in logic programs. In Proc. of 17th International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR '07). Lecture Notes in Computer Science, vol. 4915. Springer-Verlag, The Technical University of Denmark, 138153.Google Scholar
Casas, A., Carro, M. and Hermenegildo, M. 2008. A high-level implementation of non-deterministic, unrestricted, independent and-parallelism. In Proc. of 24th International Conference on Logic Programming (ICLP '08), García de la Banda, M. and Pontelli, E., Eds. Lecture Notes in Computer Science, vol. 5366. Springer-Verlag, 651666.Google Scholar
Chen, W. and Warren, D. S. January 1996. Tabled evaluation with delaying for general logic programs. Journal of the ACM 43 (1), 2074.CrossRefGoogle Scholar
Conery, J. S. 1987. Parallel Execution of Logic Programs. Kluwer Academic Publishers.CrossRefGoogle Scholar
Gupta, G., Pontelli, E., Ali, K., Carlsson, M. and Hermenegildo, M. July 2001. Parallel execution of Prolog programs: A survey. ACM Transactions on Programming Languages and Systems 23 (4), 472602.CrossRefGoogle Scholar
Hermenegildo, M. 1986. An Abstract Machine Based Execution Model for Computer Architecture Design and Efficient Implementation of Logic Programs in Parallel. PhD Thesis, University of Texas, Austin, TX.Google Scholar
Hermenegildo, M. V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J. and Puebla, G. 2011. An overview of Ciao and its design philosophy. Theory and Practice of Logic Programming, TPLP Special Issue on Prolog Systems, in press, URL: http://arxiv.org/abs/1102.5497Google Scholar
Hermenegildo, M. and Greene, K. 1991. The &-Prolog system: Exploiting independent and-parallelism. New Generation Computing 9 (3–4), 233257.CrossRefGoogle Scholar
Hermenegildo, M., Puebla, G., Bueno, F. and López-García, P. 2005. Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor). Science of Computer Programming 58 (1–2), 115140.CrossRefGoogle Scholar
Hermenegildo, M. and Rossi, F. 1995. Strict and non-strict independent and-parallelism in logic programs: Correctness, efficiency, and compile-time conditions. Journal of Logic Programming 22 (1), 145.CrossRefGoogle Scholar
Janson, S. 1994. Akl. A Multiparadigm Programming Language. PhD Thesis, Uppsala University, Sweden.CrossRefGoogle Scholar
Karp, A. and Babb, R. 1988. A comparison of 12 parallel Fortran dialects. IEEE Software, 5, 5267.CrossRefGoogle Scholar
Lopes, R., Santos Costa, V. and Silva, F. M. A. 2011. A Design and Implementation of the Extended Andorra Model. Theory and Practice of Logic Programming, in this same issue.CrossRefGoogle Scholar
López-García, P., Bueno, F. and Hermenegildo, M. 2005. Determinacy analysis for logic programs using mode and type information. In Proc. of 14th International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR '04). Lecture Notes in Computer Science, vol. 3573. Springer-Verlag, 1935.CrossRefGoogle Scholar
López-García, P., Hermenegildo, M. and Debray, S. K. 1996. A methodology for granularity based control of parallelism in logic programs. Journal of Symbolic Computation, Special Issue on Parallel Symbolic Computation 21 (4–6), 715734.Google Scholar
Lusk, E., Butler, R., Disz, T., Olson, R., Stevens, R., Warren, D. H. D., Calderwood, A., Szeredi, P., Brand, P., Carlsson, M., Ciepielewski, A., Hausman, B. and Haridi, S. 1988. The Aurora or-parallel Prolog system. New Generation Computing 7 (2–3), 243271.CrossRefGoogle Scholar
Moura, P., Crocker, P. and Nunes, P. 2008. High-level multithreading programming in logtalk. In Proc. of 10th International Symposium on Practical Aspects of Declarative Languages (PADL '08), Warren, D. and Hudak, P., Eds. Lecture Notes in Computer Science, vol. 4902. Springer-Verlag, 265281.CrossRefGoogle Scholar
Muthukumar, K., Bueno, F., de la Banda, M. G. and Hermenegildo, M. February 1999. Automatic compile-time parallelization of logic programs for restricted, goal-level, independent and-parallelism. Journal of Logic Programming 38 (2), 165218.CrossRefGoogle Scholar
Pontelli, E., Gupta, G. and Hermenegildo, M. 1995. &ACE: A high-performance parallel Prolog system. In International Parallel Processing Symposium. IEEE Computer Society Technical Committee on Parallel Processing, IEEE Computer Society, 564572.CrossRefGoogle Scholar
Ramakrishnan, I., Rao, P., Sagonas, K., Swift, T. and Warren, D. 1995. Efficient tabling mechanisms for logic programs. In Proc. of International Conference on Logic Programming (ICLP), 697–711.Google Scholar
Santos-Costa, V. M. 1993. Compile-Time Analysis for the Parallel Execution of Logic Programs in Andorra-i. PhD Thesis, University of Bristol, UK.Google Scholar
Santos-Costa, V., Damas, L. and Rocha, R. 2011. The YAP Prolog system. Theory and Practice of Logic Programming. URL: http://arxiv.org/abs/1102.3896v1CrossRefGoogle Scholar
Santos-Costa, V., Warren, D. and Yang, R. 1991. The Andorra-I engine: A parallel implementation of the basic Andorra model. In Proc. of International Conference on Logic Programming (ICLP), 825–839.Google Scholar
Shen, K. November 1996. Overview of DASWAM: Exploitation of dependent and-parallelism. Journal of Logic Programming 29 (1–3), 245293.CrossRefGoogle Scholar
Shen, K. and Hermenegildo, M. 1996. Flexible scheduling for non-deterministic, and-parallel execution of logic programs. In Proc. of Euro-Par Conference on Parallel Processing (EuroPar '96). Lecture Notes in Computer Science, vol. 1124. Springer-Verlag, 635640.CrossRefGoogle Scholar
Tamaki, H. and Sato, M. 1986. OLD resolution with tabulation. In Proc. of International Conference on Logic Programming. Lecture Notes in Computer Science, Springer-Verlag, 8498.Google Scholar
Warren, D. 1983. An Abstract Prolog Instruction Set. Technical Report 309, Artificial Intelligence Center, Menlo Park, CA.Google Scholar
Warren, D. S. 1992. Memoing for logic programs. Communications of the ACM 35 (3), 93111.CrossRefGoogle Scholar