Subset Logic Programs and Their Implementation

Abstract This paper discusses the design and implementation of a set-oriented logic programming paradigm, called subset-logic programming. Subset-logic programs are built up of three kinds of program clauses: subset, equational and relational clauses. Using these clauses, we can program solutions to a broad range of problems of interest in logic programming and deductive databases. In previous research, we developed the implementation of subset and equational program clauses. This paper substantially extends that work, and focuses on the more expressive paradigm of subset and relational clauses. This paradigm supports setof operations, transitive closures, monotonic aggregation as well as incremental and lazy enumeration of sets. Although the subset-logic paradigm differs substantially from that of Prolog, we show that few additional changes are needed to the Warren Abstract Machine (WAM) to implement the paradigm and that these changes blend well with the overall machinery of the WAM. A central feature in the implementation of subset-logic programs is that of a monotonic memotable, i.e., a memo-table whose entries can monotonically grow or shrink in an appropriate partial order. We present in stages the paradigm of subset-logic progams, showing the effect of each feature on the implementation. The implementation has been completed, and we present performance figures to show the efficiency and costs of memoization. Our conclusion is that the monotonic memo-tables are a practical tool for implementing a set-oriented logic programming language. We also compare this system with other closely related systems, especially XSB and CORAL.

[1]  I. V. Ramakrishnan,et al.  Efficient Tabling Mechanisms for Logic Programs , 1995, ICLP.

[2]  Peter J. Stuckey,et al.  Semantics of Logic Programs with Aggregates , 1991, ISLP.

[3]  Agostino Dovier,et al.  A WAM-Based Implementation of a Logical Language with Sets , 1993, PLILP.

[4]  Kenneth A. Ross,et al.  Monotonic aggregation in deductive databases , 1992, J. Comput. Syst. Sci..

[5]  David A. Plaisted,et al.  Programming with Equations, Subsets, and Relations , 1989, NACLP.

[6]  Allen Van Gelder,et al.  The well-founded semantics of aggregation , 1992, PODS.

[7]  Teodor C. Przymusinski On the Declarative Semantics of Deductive Databases and Logic Programs , 1988, Foundations of Deductive Databases and Logic Programming..

[8]  Sergio Greco,et al.  Dynamic Programming Optimization for Logic Queries with Aggregates , 1993, ILPS.

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

[10]  David Scott Warren,et al.  Analysis of SLG-WAM Evaluation of Definite Programs , 1994, ILPS.

[11]  John Wylie Lloyd,et al.  Foundations of Logic Programming , 1987, Symbolic Computation.

[12]  David A. Plaisted,et al.  Functional programming with sets , 1987, FPCA.

[13]  Anil Nair,et al.  Subset-Logic Programming: Application and Implementation , 1988, ICLP/SLP.

[14]  Mauricio Javier Osorio Semantics of logic programs with sets , 1996 .

[15]  Divesh Srivastava,et al.  The CORAL deductive database system , 1993, SIGMOD '93.

[16]  Mengchi Liu,et al.  Relationlog: A Typed Extension to Datalog with Sets and Tuples , 1998, J. Log. Program..

[17]  I. V. Ramakrishnan,et al.  Eecient Tabling Mechanisms for Logic Programs , 1995 .

[18]  Gabriel M. Kuper,et al.  Logic programming with sets , 1987, PODS '87.

[19]  Catriel Beeri,et al.  Set Constructors in a Logic Database Language , 1991, J. Log. Program..

[20]  Hamid Pirahesh,et al.  The Magic of Duplicates and Aggregates , 1990, VLDB.

[21]  David A. Plaisted,et al.  Theory of Partial-Order Programming , 1999, Sci. Comput. Program..

[22]  Serge Abiteboul,et al.  A rule-based language with functions and sets , 1991, TODS.

[23]  Agostino Dovier,et al.  A Language for Programming in Logic with Finite Sets , 1996, J. Log. Program..

[24]  Divesh Srivastava,et al.  Extending the Well-Founded and Valid Semantics for Aggregation , 1993, ILPS.

[25]  Kyonghee Moon Implementation of subset logic languages , 1997 .

[26]  Bharat Jayaraman,et al.  The SuRE Programming Framework , 1995, AMAST.

[27]  Alfred V. Aho,et al.  Principles of Compiler Design , 1977 .

[28]  Mitchell Wand,et al.  Recursive programming through table look-up , 1976, SYMSAC '76.

[29]  Gopalan Nadathur,et al.  Towards a WAM model for ?Prolog , 1989 .

[30]  Bharat Jayaraman Implementation of Subset-Equational Programs , 1992, J. Log. Program..

[31]  Bharat Jayaraman,et al.  Set Constructors, Finite Sets, and Logical Semantics , 1999, J. Log. Program..

[32]  Divesh Srivastava,et al.  CORAL - Control, Relations and Logic , 1992, VLDB.

[33]  Hassan Aït-Kaci,et al.  Warren's Abstract Machine: A Tutorial Reconstruction , 1991 .

[34]  Devashis Jana,et al.  Semantics of subset-logic languages , 1995 .