CHAT Is Θ (SLG-WAM)
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.
KeywordsSchedule Strategy Execution Environment Choice Point Abstract Machine Schedule Generator
Unable to display preview. Download preview PDF.
- 1.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.Google Scholar
- 2.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.Google Scholar
- 4.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.Google Scholar
- 6.J. Preire, T. Swift, and D. S. Warren. Beyond depth-first strategies: Improving tabled logic programs through alternative scheduling. JFLP, 1998(3), Apr. 1998.Google Scholar
- 9.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.Google Scholar
- 12.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.Google Scholar
- 13.P. Van Roy. 1983–1993: The wonder years of sequential Prolog implementation. J. of Logic Program., 19/20:385–441, May/July 1994.Google Scholar
- 14.D. H. D. Warren. An abstr5act Prolog instruction set. Technical Report 309, SRI International, Menlo Park, U.S.A., Oct. 1983.Google Scholar
- 15.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.Google Scholar