Abstract
Global SLS-resolution and SLG-resolution are two representative mechanisms for top-down evaluation of the well-founded semantics of general logic programs. Global SLS-resolution is linear for query evaluation but suffers from infinite loops and redundant computations. In contrast, SLG-resolution resolves infinite loops and redundant computations by means of tabling, but it is not linear. The principal disadvantage of a nonlinear approach is that it cannot be implemented by using a simple, efficient stack-based memory structure nor can it be easily extended to handle some strictly sequential operators such as cuts in Prolog. In this paper, we present a linear tabling method, called SLT-resolution, for top-down evaluation of the well-founded semantics. SLT-resolution is a substantial extension of SLDNF-resolution with tabling. Its main features are the following. First, it resolves infinite loops and redundant computations while preserving the linearity. Second, it is terminating and is sound and complete w.r.t. the well-founded semantics for programs with the bounded-term-size property with nonfloundering queries. Its time complexity is comparable with SLG-resolution and polynomial for function-free logic programs. Third, because of its linearity for query evaluation, SLT-resolution bridges the gap between the well-founded semantics and standard Prolog implementation techniques. It can be implemented by an extension to any existing Prolog abstract machines such as WAM or ATOAM.
Similar content being viewed by others
References
Apt, K. R. and Van Emden, M. H.: Contributions to the theory of logic programming, J. ACM29(3) (1982), 841-862.
Bol, R. N., Apt, K. R. and Klop, J. W.: An analysis of loop checking mechanisms for logic programs, Theoret. Comput. Sci.86(1) (1991), 35-79.
Bol, R. N. and Degerstedt, L.: The underlying search for magic templates and tabulation, in Proc. of the Tenth International Conference on Logic Programming, MIT Press, 1993.
Bol, R. N. and Degerstedt, L.: Tabulated resolution for the well-founded semantics, J. Logic Programming34(2) (1998), 67-109.
Chan, D.: Constructive negation based on the completed database, in R. A. Kowalski and K. A. Bowen (eds.), Proc. of the Fifth International Conference and Symposium on Logic Programming, MIT Press, Cambridge, Mass., 1988, pp. 111-125.
Chen, W. D., Swift, T. and Warren, D. S.: Efficient top-down computation of queries under the well-founded semantics, J. Logic Programming24(3) (1995), 161-199.
Chen, W. D. and Warren, D. S.: Tabled evaluation with delaying for general logic programs, J. ACM43(1) (1996), 20-74.
Clark, K. L.: Negation as failure, in H. Gallaire and J. Minker (eds.), Logic and Databases, Plenum, New York, 1978, pp. 293-322.
De Schreye, D. and Decorte, S.: Termination of logic programs: The never-ending story, J. Logic Programming19/20 (1993), 199-260.
Drabent, W.:What is failure? An approach to constructive negation, Acta Inform.32(1) (1995), 27-59.
Gelfond, M. and Lifschitz, V.: The stable model semantics for logic programming, in R.A. Kowalski and K. A. Bowen (eds.), Proc. of the Fifth International Conference and Symposium on Logic Programming, MIT Press, Cambridge, Mass., 1988, pp. 1070-1080.
Kowalski, R. A. and Kuehner, D.: Linear resolution with selection functions, Artificial Intelligence2 (1971), 227-260.
Kowalski, R. A.: Predicate logic as a programming language, in IFIP 74, pp. 569-574.
Liu, J. Y., Adams, L. and Chen, W.: Constructive negation under the well-founded semantics, J. Logic Programming38(3) (1999), 295-330.
Lloyd, J. W.: Foundations of Logic Programming, 2nd edn, Springer-Verlag, Berlin, 1987.
Nilsson, U. and Maluszynski, J.: Logic Programming and Prolog, 2nd edn, Wiley, New York, 1995.
Przymusunski, T.: On the declarative and procedural semantics of logic programs, J. Automated Reasoning5 (1989), 167-205.
Przymusunski, T.: Every logic program has a natural stratification and an iterated fixed point model, in Proc. of the 8th ACM Symposium on Principles of Database Systems, 1989, pp. 11-21.
Przymusunski, T.: On constructive negation in logic programming, in E. L. Lusk and R. A. Overbeek (eds.), Proc. of the North American Conference on Logic Programming, MIT Press, Cambridge, Mass., 1989, Addendum to the volume.
Przymusunski, T.: The well-founded semantics coincides with the three-valued stable semantics, Fund. Inform.13 (1990), 445-463.
Robinson, J. A.: A machine-oriented logic based on the resolution principle, J. ACM12(1) (1965), 23-41.
Ross, K.: A procedural semantics for well-founded negation in logic programs, J. Logic Programming13(1) (1992), 1-22.
Sagonas, K., Swift, T. and Warren, D. S.: XSB as an efficient deductive database engine, in Proc. of the ACM SIGMOD Conference on Management of Data, Minneapolis, 1994, pp. 442-453.
Sagonas, K. and Swift, T.: An abstract machine for tabled execution of fixed-order stratified logic programs, ACM Trans. Programming Languages and Systems20(3) (1998).
Sagonas, K., Swift, T., Warren, D. S., Freire, J. and Rao, P.: The XSB Programmer's Manual (Version 1.8), 1998.
Shen, Y. D.: An extended variant of atoms loop check for positive logic programs, New Generation Comput.15(2) (1997), 187-204.
Shen, Y. D., Yuan, L. Y., You, J. H. and Zhou, N. F.: Linear tabulated resolution based on Prolog control strategy, Theory and Practice of Logic Programming(previously J. Logic Programming) 1(1) (2001), 71-103.
Shen, Y. D., Yuan, L. Y., You, J. H. and Zhou, N. F.: Linear tabulated resolution for the well founded semantics, in Proc. of the 5th International Conference on Logic Programming and Nonmonotonic Reasoning, Texas, 1999, pp. 192-205.
Shepherdson, J. C.: Negation in logic programming, in J. Minker (ed.), Foundations of Deductive Databases and Logic Programming, Morgan Kaufmann, 1988, pp. 19-88.
Tamaki, H. and Sato, T.: OLD resolution with tabulation, in Proc. of the Third International Conference on Logic Programming, London, 1986, pp. 84-98.
Van Emden, M. H. and Kowalski, R. A.: The semantics of predicate logic as a programming language, J. ACM23(4) (1976), 733-742.
Van Gelder, A.: Negation as failure using tight derivations for general logic programs, J. Logic Programming6 (1&2) (1989), 109-133.
Van Gelder, A., Ross, K. and Schlipf, J.: The well-founded semantics for general logic programs, J. ACM38(3) (1991), 620-650.
Vardi, M.: The complexity of relational query languages, in ACM Symposium on Theory of Computing, 1982, pp. 137-146.
Vieille, L.: Recursive query processing: The power of logic, Theoret. Comput. Sci.69 (1989), 1-53.
Warren, D. H. D.: An abstract Prolog instruction set, Technical Report 309, SRI International, 1983.
Warren, D. S.: Memoing for logic programs, CACM35(3) (1992), 93-111.
Zhou, N. F.: Parameter passing and control stack management in Prolog implementation revisited, ACM Trans. Programming Languages and Systems18(6) (1996), 752-779.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Shen, YD., Yuan, LY. & You, JH. SLT-Resolution for the Well-Founded Semantics. Journal of Automated Reasoning 28, 53–97 (2002). https://doi.org/10.1023/A:1020116927466
Issue Date:
DOI: https://doi.org/10.1023/A:1020116927466