Abstract
CHAT offers an alternative to SLG-WAM for implementing the suspension and resumption of consumers that tabling needs: unlike SLG-WAM, it does not use freeze registers nor a complicated trail to preserve their execution environments. CHAT also limits the amount of copying of CAT, which was previously put forward as another alternative to SLG-WAM. Although experimental results show that in practice CHAT is competitive with — if not better than — SLG-WAM, there remains the annoying fact that on contrived programs the original CHAT can be made arbitrarily worse than SLG-WAM, i.e. the original CHAT has an intrinsically higher complexity. In this paper we show how to overcome this problem, in particular, we deal with the two sources of higher complexity of CHAT: the repeated traversal of the choice point stack, and the lack of sufficient sharing of the trail. This is achieved without fundamentally changing the underlying principle of CHAT by a technique that manipulates a Prolog choice point so that it assumes temporarily a different functionality and in a way that is transparent to the underlying WAM. There is more potential use of this technique besides lowering the worst case complexity of CHAT: it leads to considering scheduling strategies that were not feasible before either in CHAT or in SLG-WAM. We also discuss extensively issues related to the implementation of the trail in a tabled logic programming system.
A tight correspondence between alternatives for suspension/resumption in the WAM.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
E. Börger and D. Rosenzweig. The WAM — Definition and compiler correctness. In C. Beierle and L. Plümer, editors, Logic Programming: Formal Methods and Practical Applications, pages 20–90. Elsevier Science, North-Holland, 1995.
S. Dawson, C. R. Ramakrishnan, and D. S. Warren. Practical program analysis using general purpose logic programming systems — A case study. In Proceedings of the ACM SIGPLAN PLDI, pages 117–126, Philadelphia, May 1996. ACM Press.
B. Demoen and K. Sagonas. CAT: the Copying Approach to Tabling. In C. Palamidessi, H. Glaser, and K. Meinke, editors, Principles of Declarative Programming (PLILP’98), number 1490 in LNCS, pages 21–35, Sept. 1998. Springer.
B. Demoen and K. Sagonas. Memory Management for Prolog with Tabling. In Proceedings of ISMM’98: ACM SIGPLAN International Symposium on Memory Management, pages 97–106, Vancouver, B.C., Canada, Oct. 1998. ACM Press.
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages (PADL), number 1551 in LNCS, pages 106–121, San Antonio, Texas, Jan. 1999. Springer.
J. Preire, T. Swift, and D. S. Warren. Beyond depth-first strategies: Improving tabled logic programs through alternative scheduling. JFLP, 1998(3), Apr. 1998.
G. Gupta and B. Jayaraman. Analysis of Or-parallel execution models. ACM Trans. Prog. Lang. Syst., 15(4):659–680, Sept. 1993.
P. Kursawe. How to invent a Prolog machine. New Gen. Comp., 5(1):97–114, 1987.
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 of the 9th CAV, number 1254 in LNCS, pages 143–154, July 1997. Springer.
D. M. Russinoff. A verified Prolog compiler for the Warren Abstract Machine. J. of Logic Program., 13(4):367–412, Aug. 1992.
K. Sagonas and T. Swift. An abstract machine for tabled execution of fixed-order stratified logic programs. ACM Trans. Prog. Lang. Syst., 20(3):586–634, May 1998.
K. Sagonas, T. Swift, and D. S. Warren. XSB as an efficient deductive database engine. In Proceedings of the ACM SIGMOD’94, pages 442–453, May 1994. ACM.
P. Van Roy. 1983–1993: The wonder years of sequential Prolog implementation. J. of Logic Program., 19/20:385–441, May/July 1994.
D. H. D. Warren. An abstr5act Prolog instruction set. Technical Report 309, SRI International, Menlo Park, U.S.A., Oct. 1983.
D. S. Warren. Efficient Prolog memory management for flexible control strategies. In Proceedings of the 1984 Symp. Logic Program., pages 198–202, Feb. 1984. IEEE.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Demoen, B., Sagonas, K. (1999). CHAT Is Θ (SLG-WAM). In: Ganzinger, H., McAllester, D., Voronkov, A. (eds) Logic for Programming and Automated Reasoning. LPAR 1999. Lecture Notes in Computer Science(), vol 1705. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48242-3_21
Download citation
DOI: https://doi.org/10.1007/3-540-48242-3_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66492-5
Online ISBN: 978-3-540-48242-0
eBook Packages: Springer Book Archive