Linear tabulated resolution based on Prolog control strategy

Infinite loops and redundant computations are long recognized open problems in Prolog. Two methods have been explored to resolve these problems: loop checking and tabling. Loop checking can cut infinite loops, but it cannot be both sound and complete even for function-free logic programs. Tabling seems to be an effective way to resolve infinite loops and redundant computations. However, existing tabulated resolutions, such as OLDT-resolution, SLG-resolution and Tabulated SLS-resolution, are non-linear because they rely on the solution-lookup mode in formulating tabling. The principal disadvantage of non-linear resolutions is that they cannot be implemented using a simple stack-based memory structure like that in Prolog. Moreover, some strictly sequential operators such as cuts may not be handled as easily as in Prolog. In this paper, we propose a hybrid method to resolve infinite loops and redundant computations. We combine the ideas of loop checking and tabling to establish a linear tabulated resolution called TP-resolution. TP-resolution has two distinctive features: (1) it makes linear tabulated derivations in the same way as Prolog except that infinite loops are broken and redundant computations are reduced. It handles cuts as effectively as Prolog; and (2) it is sound and complete for positive logic programs with the bounded-term-size property. The underlying algorithm can be implemented by an extension to any existing Prolog abstract machines such as WAM or ATOAM.

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

[2]  Roland N. Bol,et al.  Tabulated Resolution for the Well-Founded Semantics , 1993, J. Log. Program..

[3]  Michael A. Covington Eliminating unwanted loops in Prolog , 1985, SIGP.

[4]  L. Vielle,et al.  Recursive query processing: the power of logic , 1989 .

[5]  J. W. Lloyd,et al.  Foundations of logic programming; (2nd extended ed.) , 1987 .

[6]  Roland N. Bol,et al.  Loop checking in partial deduction , 1993, J. Log. Program..

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

[8]  Roland N. Bol,et al.  The Underlying Search for Magic Templates and Tabulation , 1993, ICLP.

[9]  David Scott Warren,et al.  Efficient Top-Down Computation of Queries under the Well-Founded Semantics , 1995, J. Log. Program..

[10]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[11]  Hisao Tamaki,et al.  OLD Resolution with Tabulation , 1986, ICLP.

[12]  Juliana Freire,et al.  The XSB Programmer’s Manual , 1800 .

[13]  Alan van Gelser Negation as failure using tight derivations for general logic programs , 1989 .

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

[15]  Neng-Fa Zhou,et al.  Parameter passing and control stack management in Prolog implementation revisited , 1996, TOPL.

[16]  Krzysztof R. Apt,et al.  An Analysis of Loop Checking Mechanisms for Logic Programs , 1991, Theor. Comput. Sci..

[17]  Dimiter Skordev,et al.  An Abstract Approach to Some Loop Detection Problems , 1997, Fundam. Informaticae.

[18]  David Scott Warren,et al.  Memoing for logic programs , 1992, CACM.

[19]  R. Kowalski,et al.  Linear Resolution with Selection Function , 1971 .

[20]  Filomena Ferrucci,et al.  Redundancy Elimination and Loop Checks for Logic Programs , 1995, Inf. Comput..

[21]  David Scott Warren,et al.  Tabled evaluation with delaying for general logic programs , 1996, JACM.

[22]  J. Lloyd Foundations of Logic Programming , 1984, Symbolic Computation.

[23]  Allen Van Gelder,et al.  Negation as Failure using Tight Derivations for General Logic Programs , 1988, J. Log. Program..

[24]  Adrian Walker,et al.  Towards a Theory of Declarative Knowledge , 1988, Foundations of Deductive Databases and Logic Programming..

[25]  Li-Yan Yuan,et al.  Linear Tabulated Resolutions for the Well-Founded Semantics , 1999, LPNMR.

[26]  Allen Van Gelder Efficient Loop Detection in Prolog using the Tortoise-and-Hare Technique , 1987, J. Log. Program..

[27]  Laurent Vieille,et al.  Recursive Query Processing: The Power of Logic , 1989, Theor. Comput. Sci..

[28]  Juliana Freire,et al.  The XSB Programmer's Manual Version 1.7.1 , 1994 .