Abstract
Non‐monotonic extensions add power to logic programs. However, the main logic programming language, Prolog, is widely recognized as inadequate to implement these extensions due to its weak termination and complexity properties. By extending Prolog’s SLD resolution with tabling, Prolog can be improved in several ways. Tabling can allow a logic programming system to compute the well‐founded semantics for programs with bounded term depth, and to do so with polynomial data complexity. By exploiting these properties, tabling allows a variety of non‐monotonic extensions to be efficiently implemented, and used to solve practical problems. In this paper we describe tabling as it is implemented in the XSB system and show how it can be used to construct meta‐interpreters (or preprocessors) for two sample formalisms: the Well‐Founded Semantics with Explicit Negation, and Generalized Annotated Logic Programs. We also describe how non‐monotonic extensions are used in practical applications such as psychiatric diagnosis, extraction of information from poorly structured textual data, and model checking.
Similar content being viewed by others
References
S. Adah and V.S. Subrahmanian, Amalgamating knowledge bases, II: Algorithms, data structures and query processing, J. Logic Programming (1996).
J. Alferes, C. Damásio and L.M. Pereira, A logic programming system for non-monotonic reasoning, J. Automated Reasoning 14(1) (1995) 93-147.
J. Alferes and L.M. Pereira, Reasoning with Logic Programming, Lecture Notes in Artificial Intelligence, Vol. 1111 (Springer, Berlin, 1996).
J. Alferes, L.M. Pereira and T. Swift, Well-founded abduction via tabling dual programs, Technical Report, SUNY Stony Brook (1999, in preparation).
G. Antoniou, D. Billington and M. Maher, Normal forms for defeasible logic, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1998).
R. Ben-Eliahu and R. Dechter, Propositional semantics for disjunctive logic programs, in: Joint International Conference/Symposium on Logic Programming (MIT Press, Cambridge, MA, 1992) pp. 813-127.
H. Blair and V.S. Subrahmanian, Paraconsistent logic programming, Theoret. Comput. Sci. 68 (1989) 135-154.
R. Bol and L. Degerstedt, Tabulated resolution for well-founded semantics, J. Logic Programming 38(1) (1998) 31-55.
D. Boulanger, Fine-grained goal-directed declarative analysis of logic programs, in: Proceedings of the International Workshop on Verification, Model Checking and Abstract Interpretation (1997). Available through http://www.dsi.unive.it/~bossi/VMCAI.html.
W. Chen and D.S. Warren, Tabled evaluation with delaying for general logic programs, J. ACM 43(1) (1996) 20-74.
R. Cleaveland, J. Parrow and B. Steffen, The concurrency workbench: A semantics-based tool for the verification of concurrent systems, ACM Trans. Programming Languages and Systems (1993) 36-73.
M. Codish, B. Demoen and K. Sagonas, Semantics-based program analysis for logic-based languages using XSB, Springer Internat. J. Software Tools Technology Transfer 2(1) (1998) 29-45.
C. Crowner, K. Govindarajan, B. Jayaraman and S. Mantha, Preference logic grammars, Computer Languages (1999, to appear).
B. Cui, Y. Dong, X. Du, K. Kumar, C.R. Ramakrishnan, I.V. Ramakrishnan, A. Roychoudhury, S. Smolka and D.S. Warren, Logic programming and model checking, in: PLILP '98 (Springer, Berlin, 1998) pp. 1-20.
B. Cui, T. Swift and D.S. Warren, Using tabled logic programs and preference logic for data standardization, available at http://www.cs.sunysb.edu/~tswift (1998).
C. Damásio, Paraconsistent extended logic programming with constraints, Ph.D. thesis, University Nova de Lisboa (1996).
S. Dawson, C.R. Ramakrishnan, I.V. Ramakrishnan and T. Swift, Optimizing clause resolution: Beyond unification factoring, in: International Logic Programming Symposium (MIT Press, Cambridge, MA, 1995) pp. 194-208.
S. Dawson, C.R. Ramakrishnan and D.S. Warren, Practical program analysis using general purpose logic programming systems — a case study, in: ACM PLDI (May 1996) pp. 117-126.
A. Dekhtyar and V.S. Subrahmanian, Hybrid probabilistic programs, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1997) pp. 391-407.
K. Devlin, Fundamentals of Contemporary Set Theory (Springer, Berlin, 1980).
Diagnostic and Statistical Manual of Mental Disorders, 4th ed. (American Psychiatric Association, Washington, DC, 1994). Prepared by the Task Force on DSM-IV and other committees and work groups of the American Psychiatric Association.
Diagnostica, Available from Medicine Rules Inc: http://medicinerules.com.
E.A. Emerson and C.L. Lei, Efficient model checking in fragments of the propositional mu-calculus, in: Proceedings of the 1st Annual Conference on Logic in Computer Science (IEEE, 1986) pp. 267-278.
M. Fitting, Bilattices and the semantics of logic programming, J. Logic Programming 11 (1991) 91-116.
J. Freire, T. Swift and D.S. Warren, Treating I/O seriously: Resolution reconsidered for disk, in: International Conference on Logic Programming (1997) pp. 198-212.
J. Freire, T. Swift and D.S. Warren, Beyond depth-first: Improving tabled logic programs through alternative scheduling strategies, J. Functional Logic Programming 1998(3) (1998).
M. Gelfond and V. Lifshitz, The stable model semantics for logic programming, in: Joint International Conference/Symposium on Logic Programming (MIT Press, Cambridge, MA, 1988) pp. 1070-1080.
M. Gelfond and V. Lifshitz, Logic programs with classical negation, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1990) pp. 579-597.
K. Govindarajan, B. Jayaraman and S. Mantha, Preference logic programming, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1995) pp. 731-746.
ISO working group JTC1/SC22, Prolog international standard, Technical Report, International Standards Organization (1995).
C. Jonker, Constraints and negations in logic programs, Ph.D. thesis, Utrecht University (1994).
M. Kifer and V.S. Subrahmanian, Theory of generalized annotated logic programming and its applications, J. Logic Programming 12(4) (1992) 335-368.
E. Lamma, F. Riguzzi and L.M. Pereira, Strategies in learning with extended logic programs, Technical Report, Universita di Bologna (1998).
R. Larson, D.S. Warren, J. Freire and K. Sagonas, Syntactica, Symantica (MIT Press, Cambridge, MA, 1995).
S. Leach and J. Lu, Computing annotated logic programs, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1994) pp. 257-271.
J. Leite and L.M. Pereira, Iterated logic programming updates, in: International Conference on Logic Programming (MIT Press, Cambridge, MA, 1998) pp. 265-278.
R. Li and L.M. Pereira, Representing and reasoning about actions with abductive logic programming, Ann. Math. Artif. Intell. 21 (1997) 245-303.
X. Liu, C.R. Ramakrishnan and S. Smolka, Fully local and efficient evaluation of alternating fixed points, in: TACAS 98: Tools and Algorithms for Construction and Analysis of Systems (Springer, Berlin, 1998) pp. 5-19.
J. W. Lloyd, Foundations of Logic Programming (Springer, Berlin, 1984).
R. Milner, Communication and Concurrency (Prentice-Hall, New York, 1989).
I. Niemelä and P. Simons, Smodels — An implementation of the stable model and well-founded semantics for normal LP, in: International Workshop on Logic Programming and Non-Monotonic Reasoning (Springer, Berlin, 1997) pp. 420-429.
T. Przymusinski, Every logic program has a natural stratification and an iterated least fixed point model, in: ACM Principles of Database Systems (ACM Press, Cambridge, MA, 1989) pp. 11-21.
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 on the Conference on Automated Verification (1997) pp. 143-154.
I.V. Ramakrishnan, P. Rao, K. Sagonas, T. Swift and D.S. Warren, Efficient access mechanisms for tabled logic programs, J. Logic Programming 38(1) (1999) 31-55.
I.V. Ramakrishnan, A. Roychoudhury and T. Swift, A standardization tool for data warehousing, in: Practical Applications of Prolog (1997).
K. Sagonas and T. Swift, An abstract machine for tabled execution of fixed-order stratified logic programs, ACM TOPLAS 20(3) (1998) 586-635.
K. Sagonas, T. Swift and D.S. Warren, An abstract machine for computing the well-founded semantics. Extended version of article, in: Joint International Conference and Symposium on Logic Programming (MIT Press, Cambridge, MA, 1996) pp. 274-289.
K. Sagonas, T. Swift and D.S. Warren, The limits of fixed-order computation, Theoret. Comput. Sci. (1999, to appear).
K. Sagonas, T. Swift, D.S. Warren, J. Freire and P. Rao, The XSB Programmer's Manual: Version 1.9 (1998).
M. Schroeder, Autonomous, Model-Based Diagnosis Agents (Kluwer Academic, Dordrecht, 1998).
S. Smolka, O. Sokolsky and S. Zhang, Model checking in the modal μ-calculus, in: IEEE Symposium on Logic in Computer Science (1994).
V.S. Subrahmanian, Amalgamating knowledge bases, ACM Trans. Database Systems 19(2) (1994) 291-331.
T. Swift, A new formulation of tabled resolution with delay, submitted for publication; available at http://www.cs.sunysb.edu/~tswift.
T. Swift, C. Henderson, R. Holberger, J. Murphey and E. Neham, CCTIS: An expert transaction processing system, in: 6th Conference on Industrial Applications of Artificial Intelligence (1994) pp. 131-140.
H. Tamaki and T. Sato, OLDT resolution with tabulation, in: International Conference on Logic Programming (Springer, Berlin, 1986) pp. 84-98.
M. van Emden, Quantitative deduction and its fixpoint theory, J. Logic Programming 4 (1986) 37-53.
A. van Gelder, K. Ross and J. Schlipf, Unfounded sets and well-founded semantics for general logic programs, J. ACM 38(3) (1991) 620-650.
L. Vieille, Recursive query processing: The power of logic, Theoret. Comput. Sci. 69 (1989) 1-53.
G. Wagner, Reasoning with inconsistency in extended deductive databases, in: International Workshop on Logic Programming and Non-Monotonic Reasoning (MIT Press, Cambridge, MA, 1994) pp. 300-315.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Swift, T. Tabling for non‐monotonic programming. Annals of Mathematics and Artificial Intelligence 25, 201–240 (1999). https://doi.org/10.1023/A:1018990308362
Issue Date:
DOI: https://doi.org/10.1023/A:1018990308362