# Tabling for non‐monotonic programming

- 87 Downloads
- 26 Citations

## 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.

## Keywords

Model Check Logic Program Normal Program Preference Logic Answer Return## Preview

Unable to display preview. Download preview PDF.

## References

- [1]S. Adah and V.S. Subrahmanian, Amalgamating knowledge bases, II: Algorithms, data structures and query processing, J. Logic Programming (1996).Google Scholar
- [2]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.zbMATHCrossRefGoogle Scholar
- [3]J. Alferes and L.M. Pereira,
*Reasoning with Logic Programming*, Lecture Notes in Artificial Intelligence, Vol. 1111 (Springer, Berlin, 1996).Google Scholar - [4]J. Alferes, L.M. Pereira and T. Swift, Well-founded abduction via tabling dual programs, Technical Report, SUNY Stony Brook (1999, in preparation).Google Scholar
- [5]G. Antoniou, D. Billington and M. Maher, Normal forms for defeasible logic, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1998).Google Scholar - [6]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.Google Scholar - [7]H. Blair and V.S. Subrahmanian, Paraconsistent logic programming, Theoret. Comput. Sci. 68 (1989) 135-154.zbMATHMathSciNetCrossRefGoogle Scholar
- [8]R. Bol and L. Degerstedt, Tabulated resolution for well-founded semantics, J. Logic Programming 38(1) (1998) 31-55.MathSciNetGoogle Scholar
- [9]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.Google Scholar - [10]W. Chen and D.S. Warren, Tabled evaluation with delaying for general logic programs, J. ACM 43(1) (1996) 20-74.zbMATHMathSciNetCrossRefGoogle Scholar
- [11]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.Google Scholar
- [12]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.zbMATHCrossRefGoogle Scholar
- [13]C. Crowner, K. Govindarajan, B. Jayaraman and S. Mantha, Preference logic grammars, Computer Languages (1999, to appear).Google Scholar
- [14]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.Google Scholar - [15]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).Google Scholar
- [16]C. Damásio, Paraconsistent extended logic programming with constraints, Ph.D. thesis, University Nova de Lisboa (1996).Google Scholar
- [17]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.Google Scholar - [18]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.Google Scholar - [19]A. Dekhtyar and V.S. Subrahmanian, Hybrid probabilistic programs, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1997) pp. 391-407.Google Scholar - [20]K. Devlin,
*Fundamentals of Contemporary Set Theory*(Springer, Berlin, 1980).Google Scholar - [21]
*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.Google Scholar - [22]Diagnostica, Available from Medicine Rules Inc: http://medicinerules.com.Google Scholar
- [23]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.Google Scholar - [24]M. Fitting, Bilattices and the semantics of logic programming, J. Logic Programming 11 (1991) 91-116.zbMATHMathSciNetCrossRefGoogle Scholar
- [25]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.Google Scholar - [26]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).Google Scholar
- [27]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.Google Scholar - [28]M. Gelfond and V. Lifshitz, Logic programs with classical negation, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1990) pp. 579-597.Google Scholar - [29]K. Govindarajan, B. Jayaraman and S. Mantha, Preference logic programming, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1995) pp. 731-746.Google Scholar - [30]ISO working group JTC1/SC22, Prolog international standard, Technical Report, International Standards Organization (1995).Google Scholar
- [31]C. Jonker, Constraints and negations in logic programs, Ph.D. thesis, Utrecht University (1994).Google Scholar
- [32]M. Kifer and V.S. Subrahmanian, Theory of generalized annotated logic programming and its applications, J. Logic Programming 12(4) (1992) 335-368.MathSciNetCrossRefGoogle Scholar
- [33]E. Lamma, F. Riguzzi and L.M. Pereira, Strategies in learning with extended logic programs, Technical Report, Universita di Bologna (1998).Google Scholar
- [34]R. Larson, D.S. Warren, J. Freire and K. Sagonas,
*Syntactica, Symantica*(MIT Press, Cambridge, MA, 1995).Google Scholar - [35]S. Leach and J. Lu, Computing annotated logic programs, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1994) pp. 257-271.Google Scholar - [36]J. Leite and L.M. Pereira, Iterated logic programming updates, in:
*International Conference on Logic Programming*(MIT Press, Cambridge, MA, 1998) pp. 265-278.Google Scholar - [37]R. Li and L.M. Pereira, Representing and reasoning about actions with abductive logic programming, Ann. Math. Artif. Intell. 21 (1997) 245-303.zbMATHMathSciNetCrossRefGoogle Scholar
- [38]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.Google Scholar - [39]J. W. Lloyd,
*Foundations of Logic Programming*(Springer, Berlin, 1984).Google Scholar - [40]R. Milner,
*Communication and Concurrency*(Prentice-Hall, New York, 1989).Google Scholar - [41]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.Google Scholar - [42]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.Google Scholar - [43]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.Google Scholar - [44]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.zbMATHCrossRefGoogle Scholar
- [45]I.V. Ramakrishnan, A. Roychoudhury and T. Swift, A standardization tool for data warehousing, in:
*Practical Applications of Prolog*(1997).Google Scholar - [46]K. Sagonas and T. Swift, An abstract machine for tabled execution of fixed-order stratified logic programs, ACM TOPLAS 20(3) (1998) 586-635.CrossRefGoogle Scholar
- [47]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.Google Scholar - [48]K. Sagonas, T. Swift and D.S. Warren, The limits of fixed-order computation, Theoret. Comput. Sci. (1999, to appear).Google Scholar
- [49]K. Sagonas, T. Swift, D.S. Warren, J. Freire and P. Rao,
*The XSB Programmer's Manual: Version 1.9*(1998).Google Scholar - [50]M. Schroeder,
*Autonomous, Model-Based Diagnosis Agents*(Kluwer Academic, Dordrecht, 1998).Google Scholar - [51]S. Smolka, O. Sokolsky and S. Zhang, Model checking in the modal
*μ*-calculus, in:*IEEE Symposium on Logic in Computer Science*(1994).Google Scholar - [52]V.S. Subrahmanian, Amalgamating knowledge bases, ACM Trans. Database Systems 19(2) (1994) 291-331.MathSciNetCrossRefGoogle Scholar
- [53]T. Swift, A new formulation of tabled resolution with delay, submitted for publication; available at http://www.cs.sunysb.edu/~tswift.Google Scholar
- [54]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.Google Scholar - [55]H. Tamaki and T. Sato, OLDT resolution with tabulation, in:
*International Conference on Logic Programming*(Springer, Berlin, 1986) pp. 84-98.Google Scholar - [56]M. van Emden, Quantitative deduction and its fixpoint theory, J. Logic Programming 4 (1986) 37-53.MathSciNetCrossRefGoogle Scholar
- [57]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.zbMATHMathSciNetCrossRefGoogle Scholar
- [58]L. Vieille, Recursive query processing: The power of logic, Theoret. Comput. Sci. 69 (1989) 1-53.zbMATHMathSciNetCrossRefGoogle Scholar
- [59]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.Google Scholar