Abstract
We consider the problem of supporting goal-level, independent and-parallelism (IAP) in the presence of non-determinism. IAP is exploited when two or more goals which will not interfere at run time are scheduled for simultaneous execution. Backtracking over non-deterministic parallel goals runs into the well-known trapped goal and garbage slot problems. The proposed solutions for these problems generally require complex low-level machinery which makes systems difficult to maintain and extend, and in some cases can even affect sequential execution performance. In this paper we propose a novel solution to the problem of trapped nondeterministic goals and garbage slots which is based on a single stack reordering operation and offers several advantages over previous proposals. While the implementation of this operation itself is not simple, in return it does not impose constraints on the scheduler. As a result, the scheduler and the rest of the run-time machinery can safely ignore the trapped goal and garbage slot problems and their implementation is greatly simplified. Also, standard sequential execution remains unaffected. In addition to describing the solution we report on an implementation and provide performance results. We also suggest other possible applications of the proposed approach beyond parallel execution.
Keywords
- Parallelism
- Logic Programming
- Trapped Computations
- Backtracking
- Performance
Work partially funded by EU project IST-215483 S-Cube, MICINN project TIN-2008-05624 DOVES, and CAM project S2009TIC-1465 PROMETIDOS. Pablo Chico is also funded by a MEC FPU scholarship.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Gupta, G., Pontelli, E., Ali, K., Carlsson, M., Hermenegildo, M.: Parallel Execution of Prolog Programs: a Survey. ACM Transactions on Programming Languages and Systems 23(4), 472–602 (2001)
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., Haridi, S.: The Aurora Or-parallel Prolog System. New Generation Computing 7(2/3), 243–271 (1988)
Ali, K.A.M., Karlsson, R.: The Muse Or-Parallel Prolog Model and its Performance. In: 1990 North American Conference on Logic Programming, pp. 757–776. MIT Press, Cambridge (1990)
Hermenegildo, M., Greene, K.: The &-Prolog System: Exploiting Independent And-Parallelism. New Generation Computing 9(3,4), 233–257 (1991)
Shen, K.: Overview of DASWAM: Exploitation of Dependent And-parallelism. Journal of Logic Programming 29(1-3), 245–293 (1996)
Pontelli, E., Gupta, G., Hermenegildo, M.: &ACE: A High-Performance Parallel Prolog System. In: International Parallel Processing Symposium IEEE Computer Society Technical Committee on Parallel Processing, pp. 564–572. IEEE Computer Society (April 1995)
Janson, S.: AKL. A Multiparadigm Programming Language. PhD thesis, Uppsala University (1994)
Santos-Costa, V.M.: Compile-Time Analysis for the Parallel Execution of Logic Programs in Andorra-I. PhD thesis, University of Bristol (August 1993)
Warren, D.: The Extended Andorra Model with Implicit Control. In: Jansson, S. (ed.) Parallel Logic Programming Workshop, Box 1263, S-163 13 Spanga, Sweden. SICS (June 1990)
Lopes, R., Santos Costa, V., Silva, F.: A Novel Implementation of the Extended Andorra Model. In: Ramakrishnan, I.V. (ed.) PADL 2001. LNCS, vol. 1990, pp. 199–213. Springer, Heidelberg (2001)
Hermenegildo, M.: An Abstract Machine Based Execution Model for Computer Architecture Design and Efficient Implementation of Logic Programs in Parallel. PhD thesis, U. of Texas at Austin (August 1986)
Hermenegildo, M.: Relating Goal Scheduling, Precedence, and Memory Management in AND-Parallel Execution of Logic Programs. In: 4th. ICLP, pp. 556–575. MIT Press (1987)
Pontelli, E., Gupta, G.: Backtracking in independent and-parallel implementations of logic programming languages. IEEE Transactions on Parallel and Distributed Systems 12(11), 1169–1189 (2001)
Casas, A., Carro, M., Hermenegildo, M.V.: A High-Level Implementation of Non-deterministic, Unrestricted, Independent And-Parallelism. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 651–666. Springer, Heidelberg (2008)
Moura, P., Crocker, P., Nunes, P.: High-Level Multi-threading Programming in Logtalk. In: Hudak, P., Warren, D.S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 265–281. Springer, Heidelberg (2008)
Warren, D.: An Abstract Prolog Instruction Set. Technical Report 309, Artificial Intelligence Center, SRI International, 333 Ravenswood Ave, Menlo Park CA 94025 (1983)
Ait-Kaci, H.: Warren’s Abstract Machine, A Tutorial Reconstruction. MIT Press (1991)
Shen, K., Hermenegildo, M.: Flexible Scheduling for Non-Deterministic, And-parallel Execution of Logic Programs. In: Fraigniaud, P., Mignotte, A., Robert, Y., Bougé, L. (eds.) Euro-Par 1996. LNCS, vol. 1124, pp. 635–640. Springer, Heidelberg (1996)
Ericsson, A.B.: Erlang Efficiency Guide. 5.8.5 edn. (October 2011), http://www.erlang.org/doc/efficiency_guide/users_guide.html
Chico de Guzmán, P., Casas, A., Carro, M., Hermenegildo, M.: Parallel Backtracking with Answer Memoing for Independent And-Parallelism. In: Theory and Practice of Logic Programming, 27th Int’l. Conference on Logic Programming (ICLP 2011) Special Issue, vol. 11(4–5), pp. 555–574 (July 2011), http://arxiv.org/abs/1107.4724
Demoen, B., Sagonas, K.: CHAT: the copy-hybrid approach to tabling. Future Generation Computer Systems 16, 809–830 (2000)
Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-García, P., Puebla, G. (eds.): The Ciao System. Ref. Manual (v1.13). Technical report, School of Computer Science, T.U. of Madrid, UPM (2009), http://www.ciaohome.org
Hermenegildo, M.V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J., Puebla, G.: An Overview of Ciao and its Design Philosophy. Theory and Practice of Logic Programming (2012), http://arxiv.org/abs/1102.5497
Hermenegildo, M., Puebla, G., Bueno, F., López-García, P.: Integrated Program Debugging, Verification, and Optimization Using Abstract Interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58(1-2), 115–140 (2005)
Muthukumar, K., Bueno, F., de la Banda, M.G., Hermenegildo, M.: Automatic Compile-time Parallelization of Logic Programs for Restricted, Goal-level, Independent And-parallelism. Journal of Logic Programming 38(2), 165–218 (1999)
Cabeza, D.: An Extensible, Global Analysis Friendly Logic Programming System. PhD thesis, Universidad Politécnica de Madrid (UPM), Facultad Informatica UPM, 28660-Boadilla del Monte, Madrid-Spain (August 2004)
Casas, A., Carro, M., Hermenegildo, M.: Annotation Algorithms for Unrestricted Independent And-Parallelism in Logic Programs. In: King, A. (ed.) LOPSTR 2007. LNCS, vol. 4915, pp. 138–153. Springer, Heidelberg (2008)
Casas, A.: Automatic Unrestricted Independent And-Parallelism in Declarative Multiparadigm Languages. PhD thesis, University of New Mexico (UNM), Electrical and Computer Engineering Department, University of New Mexico, Albuquerque, NM 87131-0001 (USA) (September 2008)
Chico de Guzmán, P., Carro, M., Warren, D.S.: Swapping Evaluation: A Memory-Scalable Solution for Answer-On-Demand Tabling. In: Theory and Practice of Logic Programming, 26th Int’l. Conference on Logic Programming (ICLP 2010) Special Issue, vol. 10(4-6), pp. 401–416 (July 2010)
Pereira, L., Porto, A.: Intelligent backtracking and sidetracking in horn clause programs - the theory. Report 2/79, Departamento de Informatica, Universidade Nova de Lisboa (October 1979)
Warren, D.S.: Memoing for logic programs. Communications of the ACM 35(3), 93–111 (1992)
Sagonas, K., Swift, T.: An Abstract Machine for Tabled Execution of Fixed-Order Stratified Logic Programs. ACM Transactions on Programming Languages and Systems 20(3), 586–634 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chico de Guzmán, P., Casas, A., Carro, M., Hermenegildo, M.V. (2012). A Segment-Swapping Approach for Executing Trapped Computations. In: Russo, C., Zhou, NF. (eds) Practical Aspects of Declarative Languages. PADL 2012. Lecture Notes in Computer Science, vol 7149. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-27694-1_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-27694-1_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-27693-4
Online ISBN: 978-3-642-27694-1
eBook Packages: Computer ScienceComputer Science (R0)