On the Complexity of Single-Rule Datalog Queries

Datalog is a well-known database query language based on the logic programming paradigm. A general datalog program consists of a number of rules and facts. Programs containing a unique rule and possibly some facts are called single rule programs (sirups). We study both the combined and the program complexity of sirups, ie., the complexity of evaluating sirups over variable and fixed databases, respectively. Moreover, we study the descriptive complexity of sirups, i.e., their expressive power. In all cases it turns out that even very restricted classes of sirups have the same complexity and essentially the same expressive power as general datalog programs. We show that the evaluation of single clause programs is EXPTIME complete (combined complexity), and, if restricted to linear recursive rules, PSPACE complete. Moreover, sirups with one recursive rule and one additional fact capture PTIME on ordered structures, if a certain data representation is assumed and certain predefined relations are provided. Our results are obtained by a uniform product construction which maps a datalog program into a single rule by essentially maintaining its semantics. We also prove that the datalog clause implication problem, i.e., deciding whether a datalog clause implies another one, is EXPTIME complete.

[1]  Philippe Devienne,et al.  Halting Problem of One Binary Horn Clause is Undecidable , 1993, STACS.

[2]  Erich Grädel,et al.  The Expressive Power of Second Order Horn Logic , 1991, STACS.

[3]  Neil Immerman,et al.  Descriptive Complexity and Model Checking , 1998, FSTTCS.

[4]  Paris C. Kanellakis,et al.  Logic Programming and Parallel Complexity , 1986, Foundations of Deductive Databases and Logic Programming..

[5]  Paris C. Kanellakis Logic Programming and Parallel Complexity , 1988, Foundations of Deductive Databases and Logic Programming..

[6]  Jeffrey D. Ullman,et al.  Parallel complexity of logical query programs , 1986, 27th Annual Symposium on Foundations of Computer Science (sfcs 1986).

[7]  Neil Immerman,et al.  Relational Queries Computable in Polynomial Time , 1986, Inf. Control..

[8]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[9]  Yuri Gurevich,et al.  The Classical Decision Problem , 1997, Perspectives in Mathematical Logic.

[10]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[11]  Christos H. Papadimitriou,et al.  The parallel complexity of simple logic programs , 1993, JACM.

[12]  Harry R. Lewis Krom Formulas with One Dyadic Predicate Letter , 1976, J. Symb. Log..

[13]  Saso Dzeroski,et al.  Inductive logic programming and learnability , 1994, SGAR.

[14]  Stål O. Aanderaa On the Decision Problem for Formulas in which all Disjunctions are Binary , 1971 .

[15]  Jörg Flum,et al.  Finite model theory , 1995, Perspectives in Mathematical Logic.

[16]  Georg Gottlob,et al.  Complexity and expressive power of logic programming , 1997, Proceedings of Computational Complexity. Twelfth Annual IEEE Conference.

[17]  Letizia Tanca,et al.  Logic Programming and Databases , 1990, Surveys in Computer Science.

[18]  Serge Abiteboul Boundedness is Undecidable for Datalog Programs with a Single Recursive Rule , 1989, Inf. Process. Lett..

[19]  A. Dawar FINITE MODEL THEORY (Perspectives in Mathematical Logic) , 1997 .

[20]  Larry J. Stockmeyer,et al.  The Polynomial-Time Hierarchy , 1976, Theor. Comput. Sci..

[21]  Georg Gottlob,et al.  Subsumption and Implication , 1987, Inf. Process. Lett..

[22]  Jörg Würtz,et al.  Satisfiability of the Smallest Binary Program , 1993, Inf. Process. Lett..

[23]  J. Marcinkowski DATALOG SIRUPs uniform boundedness is undecidable , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

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

[25]  Leszek Pacholski,et al.  Undecidability of the Horn-clause implication problem , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

[26]  Harry G. Mairson,et al.  Undecidable Boundedness Problems for Datalog Programs , 1995, J. Log. Program..

[27]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[28]  Johann A. Makowsky,et al.  Embedded implicational dependencies and their inference problem , 1981, STOC '81.

[29]  Jörg Flum,et al.  Descriptive Complexity Theory , 1995 .

[30]  Jerzy Marcinkowski The 3 Frenchmen Method Proves Undecidability of the Uniform Boundedness for Single Recursive Rule Ternary DATALOG Programs , 1996, STACS.

[31]  Erich Grädel,et al.  Capturing Complexity Classes by Fragments of Second-Order Logic , 1991, Theor. Comput. Sci..