Suspending and Resuming Computations in Engines for SLG Evaluation
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.
KeywordsLogic Program Computation Path Choice Point Prolog Program Schedule Chain
Unable to display preview. Download preview PDF.
- 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
- 3.B. Demoen and K. Sagonas. CAT: A copying approach to tabling. In PLILP, pages 21–35, 1998.Google Scholar
- 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.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.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.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.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
- 10.R. Rocha. On applying Or-parallelism and tabling to logic programs. PhD thesis, Universidade do Porto, 2001.Google Scholar
- 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
- 16.D. S. Warren. Efficient Prolog memory management for flexible control. In ILPS, pages 198–202, 1984.Google Scholar
- 17.D. H. D. Warren. An abstract Prolog instruction set. Technical Report 309, SRI, 1983.Google Scholar
- 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.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