Optimizing datalog programs
- 1 June 1987
- proceedings article
- Published by Association for Computing Machinery (ACM)
- p. 349-362
- https://doi.org/10.1145/28659.28696
Abstract
Datalog programs, i.e., Prolog programs without function symbols, are considered It is assumed that a variable appearing in the head of a rule must also appear in the body of the rule. The input of a program is a set of ground atoms (which are given in addition to the program's rules) and, therefore, can be viewed as an assignment of relations to some of the program's predicates. Two programs are equivalent if they produce the same result for all possible assignments of relations to the extensional predicates (i.e., the predicates that do not appear as heads of rules). Two programs are uniformly equivalent if they produce the same result for all possible assignments of initial relations to all the predicates (i.e., both extensional and intentional). The equivalence problem for Datalog programs is known to be undecidable. It is shown that uniform equivalence is decidable, and an algorithm is given for minimizing a Datalog program under uniform equivalence. A technique for removing parts of a program that are redundant under equivalence (but not under uniform equivalence) is developed. A procedure for testing uniform equivalence is also developed for the case in which the database satisfies some constraints.This publication has 17 references indexed in Scilit:
- A problem-oriented inferential database systemACM Transactions on Database Systems, 1986
- Implementation of logical query languages for databasesACM Transactions on Database Systems, 1985
- A Proof Procedure for Data DependenciesJournal of the ACM, 1984
- On compiling queries in recursive first-order databasesJournal of the ACM, 1984
- Horn clauses and database dependenciesJournal of the ACM, 1982
- Determining View dependencies using tableauxACM Transactions on Database Systems, 1982
- Equivalences Among Relational Expressions with the Union and Difference OperatorsJournal of the ACM, 1980
- Testing implications of data dependenciesACM Transactions on Database Systems, 1979
- Equivalences among Relational ExpressionsSIAM Journal on Computing, 1979
- The Semantics of Predicate Logic as a Programming LanguageJournal of the ACM, 1976