Suspending and Resuming Computations in Engines for SLG Evaluation

  • Luís F. Castro
  • Terrance Swift
  • David S. Warren
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2257)


SLD resolution, the evaluation mechanism for Prolog programs, is modeled as a sequence of SLD trees. Since only one branch of an SLD tree needs to be active at any time, SLD can be implemented via engines whose memory management is stack-based, as the WAM. Tabling, and more specifically SLG resolution, is modeled as a sequence of forests of trees in which several computation paths may need to be active at any time. This reflects the fact that a computation path that consumes answers may need to be suspended and resumed multiple times as answers are derived.

The SLGWAM architecture defines instructions to implement SLG resolution. Implementations of the SLGWAM architecture have so far shown a great deal of similarity in table access methods, high-level scheduling strategies, and support for incremental completion. However they have made different choices in what may be termed environment management: how to store suspended environments and how to check whether these environments need to be resumed. This paper describes the environment management techniques of different implementations of the SLGWAM architecture and analyzes their performance.


Logic Program Computation Path Choice Point Prolog Program Schedule Chain 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    J. J. Alferes, F. Azevedo, P. Barahona, C. Damásio, and T. Swift. Logic programming techniques for solving circuit diagnosis. Technical report, Universidade Nova de Lisboa, 2001.Google Scholar
  2. 2.
    W. Chen and D. S. Warren. Tabled Evaluation with Delaying for General Logic Programs. Journal of the ACM, 43(1):20–74, January 1996.zbMATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    B. Demoen and K. Sagonas. CAT: A copying approach to tabling. In PLILP, pages 21–35, 1998.Google Scholar
  4. 4.
    B. Demoen and K. Sagonas. Chat is Θ(slg-wam). In Proceedings of the 6th International Conference on Logic for Programming and Automated Reasoning, pages 337–357, 1999.Google Scholar
  5. 5.
    B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In Practical Aspects of Declarative Languages: First International Workshop, 1999.Google Scholar
  6. 6.
    J. Freire, T. Swift, and D. S. Warren. Beyond depth-first: Improving tabled logic programs through alternative scheduling strategies. Journal of Functional and Logic Programming, 1998(3), 1998.Google Scholar
  7. 7.
    Haifeng Guo and Gopal Gupta. A new tabling scheme with dynamic reordering of alternatives. In Workshop on Parallelism and Implementation Technology for (Constraint) Logic Languages, July 2000.Google Scholar
  8. 8.
    Y. S. Ramakrishna, C. R. Ramakrishnan, I. V. Ramakrishnan, S. Smolka, T. Swift, and D. S. Warren. Efficient model checking using tabled resolution. In Proceedings on the Conference on Automated Verification, pages 143–154, 1997.Google Scholar
  9. 9.
    I. V. Ramakrishnan, P. Rao, K. Sagonas, T. Swift, and D. S. Warren. Efficient access mechanisms for tabled logic programs. Journal of Logic Programming, 38(1):31–55, January 1999.zbMATHCrossRefGoogle Scholar
  10. 10.
    R. Rocha. On applying Or-parallelism and tabling to logic programs. PhD thesis, Universidade do Porto, 2001.Google Scholar
  11. 11.
    K. Sagonas and T. Swift. An abstract machine for tabled execution of fixed-order stratified logic programs. ACM TOPLAS, 20(3):586–635, May 1998.CrossRefGoogle Scholar
  12. 12.
    Vítor Santos Costa. Optimising bytecode emulation for prolog. In LNCS 1702, Proceedings of PPDP’99, pages 261–267. Springer-Verlag, September 1999.Google Scholar
  13. 13.
    Yi-Dong Shen, Li-Yan Yuan, Jia-Huai You, and Neng-Fa Zhou. Linear tabulated resolution based on Prolog control strategy. Journal of Theory and Practice of Logic Programming, 1(1):71–122, 2001.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    T. Swift. Tabling for non-monotonic programming. Annals of Mathematics and Artificial Intelligence, 25(3–4):201–240, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    A. van Gelder, K. A. Ross, and J. S. Schlipf. Unfounded sets and well-founded semantics for general logic programs. Journal of the ACM, 38(3):620–650, 1991.zbMATHCrossRefGoogle Scholar
  16. 16.
    D. S. Warren. Efficient Prolog memory management for flexible control. In ILPS, pages 198–202, 1984.Google Scholar
  17. 17.
    D. H. D. Warren. An abstract Prolog instruction set. Technical Report 309, SRI, 1983.Google Scholar
  18. 18.
    G. Yang and M. Kifer. Flora: Implementing an efficient DOOD system using a tabling logic engine. In DOOD’2000: 6th International Conference on Rules and Objects in Databases, 2000.Google Scholar
  19. 19.
    Neng-Fa Zhou, Yi-Dong Shen, Li-Yan Yuan, and Jia-Huai You. Implementation of a linear tabling mechanism. In Proceedings of PADL 2000, pages 109–123, 2000.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Luís F. Castro
    • 1
  • Terrance Swift
    • 1
  • David S. Warren
    • 1
  1. 1.Department of Computer Science SUNY Stony BrookUSA

Personalised recommendations