A Segment-Swap** Approach for Executing Trapped Computations

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7149))

Included in the following conference series:

  • 539 Accesses

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.

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, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. 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)

    Article  Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. Hermenegildo, M., Greene, K.: The &-Prolog System: Exploiting Independent And-Parallelism. New Generation Computing 9(3,4), 233–257 (1991)

    Article  Google Scholar 

  5. Shen, K.: Overview of DASWAM: Exploitation of Dependent And-parallelism. Journal of Logic Programming 29(1-3), 245–293 (1996)

    Article  MATH  Google Scholar 

  6. 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)

    Google Scholar 

  7. Janson, S.: AKL. A Multiparadigm Programming Language. PhD thesis, Uppsala University (1994)

    Google Scholar 

  8. Santos-Costa, V.M.: Compile-Time Analysis for the Parallel Execution of Logic Programs in Andorra-I. PhD thesis, University of Bristol (August 1993)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Article  Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. 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)

    Chapter  Google Scholar 

  16. Warren, D.: An Abstract Prolog Instruction Set. Technical Report 309, Artificial Intelligence Center, SRI International, 333 Ravenswood Ave, Menlo Park CA 94025 (1983)

    Google Scholar 

  17. Ait-Kaci, H.: Warren’s Abstract Machine, A Tutorial Reconstruction. MIT Press (1991)

    Google Scholar 

  18. 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)

    Chapter  Google Scholar 

  19. Ericsson, A.B.: Erlang Efficiency Guide. 5.8.5 edn. (October 2011), http://www.erlang.org/doc/efficiency_guide/users_guide.html

  20. 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

  21. Demoen, B., Sagonas, K.: CHAT: the copy-hybrid approach to tabling. Future Generation Computer Systems 16, 809–830 (2000)

    Article  Google Scholar 

  22. 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

  23. 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

  24. 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)

    Article  MathSciNet  MATH  Google Scholar 

  25. 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)

    Article  MathSciNet  MATH  Google Scholar 

  26. 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)

    Google Scholar 

  27. 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)

    Chapter  Google Scholar 

  28. 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)

    Google Scholar 

  29. Chico de Guzmán, P., Carro, M., Warren, D.S.: Swap** 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)

    Google Scholar 

  30. 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)

    Google Scholar 

  31. Warren, D.S.: Memoing for logic programs. Communications of the ACM 35(3), 93–111 (1992)

    Article  Google Scholar 

  32. 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)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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-Swap** 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)

Publish with us

Policies and ethics

Navigation