CHAT Is Theta(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.

[1]  Konstantinos Sagonas,et al.  Xsb as an Eecient Deductive Database Engine , 1994 .

[2]  Bart Demoen,et al.  Memory management for Prolog with tabling , 1998, ISMM '98.

[3]  Juliana Freire,et al.  Beyond Depth-First Strategies: Improving Tabled Logic Programs through Alternative Scheduling , 1998, J. Funct. Log. Program..

[4]  Konstantinos Sagonas,et al.  An abstract machine for tabled execution of fixed-order stratified logic programs , 1998, TOPL.

[5]  Y. S. Ramakrishna,et al.  Eecient Model Checking Using Tabled Resolution ? , 1997 .

[6]  Gopal Gupta,et al.  Analysis of Or-parallel execution models , 1993, TOPL.

[7]  Reinhard Wilhelm,et al.  Solving shape-analysis problems in languages with destructive updating , 1998, TOPL.

[8]  C. R. Ramakrishnan,et al.  Efficient Model Checking Using Tabled Resolution , 1997, CAV.

[9]  Pierre-Etienne Moreau A Choice-Point Library for Backtrack Programming , 1998, Implementation Technology for Programming Languages based on Logic.

[10]  Egon Börger,et al.  The WAM - Definition and Compiler Correctness , 1995, Logic Programming: Formal Methods and Practical Applications.

[11]  Bart Demoen,et al.  A better CAT made-in-Belgium: CHAT (of KAT) , 1998 .

[12]  David M. Russinoff A Verified Prolog Compiler for the Warren Abstract Machine , 1992, J. Log. Program..

[13]  Konstantinos Sagonas,et al.  XSB as an efficient deductive database engine , 1994, SIGMOD '94.

[14]  Bart Demoen,et al.  CHAT: the copy-hybrid approach to tabling , 1999, Future Gener. Comput. Syst..

[15]  C. R. Ramakrishnan,et al.  Practical program analysis using general purpose logic programming systems—a case study , 1996, PLDI '96.

[16]  Peter Van Roy,et al.  1983-1993: The Wonder Years of Sequential Prolog Implementation , 1994, J. Log. Program..

[17]  Bart Demoen,et al.  CAT: The Copying Approach to Tabling , 1999, J. Funct. Log. Program..

[18]  Peter Van Roy,et al.  The Wonder Years of Sequential Prolog Implementation , 1996 .