Design and implementation of aggregate functions in the DLV system*

Disjunctive logic programming (DLP) is a very expressive formalism. It allows for expressing every property of finite structures that is decidable in the complexity class ΣP2(=NPNP). Despite this high expressiveness, there are some simple properties, often arising in real-world applications, which cannot be encoded in a simple and natural manner. Especially properties that require the use of arithmetic operators (like sum, times, or count) on a set or multiset of elements, which satisfy some conditions, cannot be naturally expressed in classic DLP. To overcome this deficiency, we extend DLP by aggregate functions in a conservative way. In particular, we avoid the introduction of constructs with disputed semantics, by requiring aggregates to be stratified. We formally define the semantics of the extended language (called ), and illustrate how it can be profitably used for representing knowledge. Furthermore, we analyze the computational complexity of , showing that the addition of aggregates does not bring a higher cost in that respect. Finally, we provide an implementation of in DLVa state-of-the-art DLP systemand report on experiments which confirm the usefulness of the proposed extension also for the efficiency of computation.

[1]  Jeffrey D. Ullman,et al.  Principles of Database and Knowledge-Base Systems, Volume II , 1988, Principles of computer science series.

[2]  Wolfgang Faber,et al.  Enhancing Eciency and Expressiveness in Answer Set Programming Systems , 2002 .

[3]  Francesco Buccafurri,et al.  Enhancing Disjunctive Datalog by Constraints , 2000, IEEE Trans. Knowl. Data Eng..

[4]  Maurice Bruynooghe,et al.  Partial Stable Models for Logic Programs with Aggregates , 2004, LPNMR.

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

[6]  Wolfgang Faber,et al.  Using Database Optimization , 1999 .

[7]  Vladimir Lifschitz,et al.  Weight constraints as nested expressions , 2003, Theory and Practice of Logic Programming.

[8]  Wolfgang Faber,et al.  Declarative problem-solving using the DLV system , 2000 .

[9]  Wolfgang Faber,et al.  Experimenting with Heuristics for Answer Set Programming , 2001, IJCAI.

[10]  Georg Gottlob,et al.  Modular Logic Programming and Generalized Quantifiers , 1997, LPNMR.

[11]  Enrico Pontelli,et al.  On Logic Programming with Aggregates , 2006 .

[12]  Enrico Pontelli,et al.  A Constructive Semantic Characterization of Aggregates in ASP , 2006, ArXiv.

[13]  Alex M. Andrew,et al.  Knowledge Representation, Reasoning and Declarative Problem Solving , 2004 .

[14]  Jeffrey D. Uuman Principles of database and knowledge- base systems , 1989 .

[15]  Rina Dechter,et al.  Propositional semantics for disjunctive logic programs , 1994, Annals of Mathematics and Artificial Intelligence.

[16]  Jack Minker,et al.  Logic-Based Artificial Intelligence , 2000 .

[17]  Yuliya Lierler Cmodels for Tight Disjunctive Logic Programs , 2005, WLP.

[18]  Jean H. Gallier,et al.  Linear-Time Algorithms for Testing the Satisfiability of Propositional Horn Formulae , 1984, J. Log. Program..

[19]  Victor W. Marek,et al.  Autoepistemic logic , 1991, JACM.

[20]  Kotagiri Ramamohanarao,et al.  Efficient Recursive Aggregation and Negation in Deductive Databases , 1998, IEEE Trans. Knowl. Data Eng..

[21]  Wolfgang Faber,et al.  Pushing Goal Derivation in DLP Computations , 1999, LPNMR.

[22]  Chitta Baral,et al.  Knowledge Representation, Reasoning and Declarative Problem Solving , 2003 .

[23]  Wolfgang Faber,et al.  Unfounded Sets for Disjunctive Logic Programs with Arbitrary Aggregates , 2005, LPNMR.

[24]  Michel Minoux,et al.  LTUR: A Simplified Linear-Time Unit Resolution Algorithm for Horn Formulae and Computer Implementation , 1988, Inf. Process. Lett..

[25]  Francesco Scarcello,et al.  Improving ASP Instantiators by Join-Ordering Methods , 2001, LPNMR.

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

[27]  Timo Soininen,et al.  Extending and implementing the stable model semantics , 2000, Artif. Intell..

[28]  Nardine Osman,et al.  Twentieth International Joint Conference on Artificial Intelligence , 2007 .

[29]  Martin Gebser,et al.  Conflict-Driven Answer Set Solving , 2007, IJCAI.

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

[31]  Miroslaw Truszczynski,et al.  The First Answer Set Programming System Competition , 2007, LPNMR.

[32]  Wolfgang Faber,et al.  DLV - A System for Declarative Problem Solving , 2000, ArXiv.

[33]  Jack Minker,et al.  On Indefinite Databases and the Closed World Assumption , 1987, CADE.

[34]  Michael Gelfond,et al.  Classical negation in logic programs and disjunctive databases , 1991, New Generation Computing.

[35]  Georg Gottlob,et al.  Disjunctive datalog , 1997, TODS.

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

[37]  Georg Gottlob,et al.  On the computational cost of disjunctive logic programming: Propositional case , 1995, Annals of Mathematics and Artificial Intelligence.

[38]  Lauri Hella,et al.  Logics with aggregate operators , 2001, JACM.

[39]  Wolfgang Faber,et al.  Recursive Aggregates in Disjunctive Logic Programs: Semantics and Complexity , 2004, JELIA.

[40]  Georg Gottlob,et al.  Succinctness as a Source of Complexity in Logical Formalisms , 1999, Ann. Pure Appl. Log..

[41]  Paolo Ferraris,et al.  Answer Sets for Propositional Theories , 2005, LPNMR.

[42]  Miroslaw Truszczynski,et al.  Properties of Programs with Monotone and Convex Constraints , 2005, AAAI.

[43]  Wolfgang Faber,et al.  Aggregate Functions in DLV , 2003, Answer Set Programming.

[44]  Antonis C. Kakas,et al.  Computational Logic: Logic Programming and Beyond , 2002, Lecture Notes in Computer Science.

[45]  Michael Gelfond,et al.  Representing Knowledge in A-Prolog , 2002, Computational Logic: Logic Programming and Beyond.

[46]  Victor W. Marek,et al.  On logic programs with cardinality constraints , 2002, NMR.

[47]  Victor W. Marek,et al.  Logic Programs With Monotone Cardinality Atoms , 2003, LPNMR.

[48]  Carlo Zaniolo,et al.  The LDL System Prototype , 1990, IEEE Trans. Knowl. Data Eng..

[49]  Wolfgang Faber,et al.  Declarative and Computational Properties of Logic Programs with Aggregates , 2005, IJCAI.

[50]  Wolfgang Faber,et al.  The DLV system for knowledge representation and reasoning , 2002, TOCL.

[51]  Ilkka Niemelä,et al.  Stable Model Semantics of Weight Constraint Rules , 1999, LPNMR.

[52]  Enrico Pontelli,et al.  A Constructive semantic characterization of aggregates in answer set programming , 2007, Theory Pract. Log. Program..

[53]  Enrico Pontelli,et al.  SmodelsA - A System for Computing Answer Sets of Logic Programs with Aggregates , 2005, LPNMR.

[54]  Francesco Scarcello,et al.  Disjunctive Stable Models: Unfounded Sets, Fixpoint Semantics, and Computation , 1997, Inf. Comput..

[55]  Jack Minker Foundations of deductive databases and logic programming , 1988 .