Abstract
A variety of optimizations in logic databases [20] involve the transformation of safe, function-free (Datalog) logic programs to simpler, more efficiently évaluable programs. The essence of these transformations is the detection of program equivalence. Equivalence has been shown to be undecidable in [1, 17, 18, 19], but those results are unsatisfactory in that they involve highly nonlinear rules, or an unbounded number of linear recursive rules, and hence yield no insight into the behaviour of small, linear recursive programs. In this paper, we consider programs that consist of one nonrecursive linear rule, one linear recursive rule and one initialization rule. We provide a tight characterization of the decidability of program equivalence, proving it undecidable for such programs, and proving it decidable for a subclass that includes binary chain programs and programs with no repeated predicates in the rule body. We then apply these results to various normal-form optimizations [12, 18], including the detection of serializability, cornmutativity, basis-linearizability and rule redundancy.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Abiteboul, S. Boundedness is undecidable for Datalog programs with a single recursive rule. Information Processing Letters 32, 281–287, 1989.
Chandra, A.K. and P.M. Merlin. Optimal implementation of conjunctive queries in relational databases. Proc. Ninth Annual ACM Symposium on the Theory of Computing, 77–90, 1977.
Feder, T. and Y. Saraiya. Undecidable normal forms for logic databases, Tech. report TM-ARH-019576, Bellcore, June 1991.
Feder, T. and Y. Saraiya. Detecting commutativity, Tech. report TM-ARH-019716, Bellcore, June 1991.
Hopcroft, J.E. and J. D. Ullman. Introduction to automata theory, languages and computation, Addison-Wesley, 1979.
Ioannidis, Y. E. Commutativity and its role in the processing of linear recursion. Tech. Report 804, University of Wisconsin-Madison, 1989.
Ioannidis, Y. E. and E. Wong. Towards an algebraic theory of recursion. JACM, to appear.
Ioannidis, Y.E. and E. Wong. Transforming nonlinear recursion to linear recursion. J. Logic Programming, to appear.
Jagadish, H. V., R. Agrawal and L. Ness. A study of transitive closure as a recursion mechanism. ACM SIGMOD International conference on Management of data, 1987.
Kannan, R. Solution of the Frobenius problem and its generalization. Combinatorica, to appear.
Naughton, J. F. Compiling separable recursions. ACM SIGMOD Intl. Conf. on the Management of Data, 312–319, 1988.
Ramakrishnan, R., Y. Sagiv, J.D. Ullman and M.Y. Vardi. Proof-tree transformation theorems and their applications. Proc. Eighth ACM Symposium on Principles of Database Systems, 172–181, 1989.
Sagiv, Y. Optimizing Datalog programs. Proc. Sixth ACM Symposium on Principles of Database Systems, 349–362, 1987.
Sagiv, Y. and M. Yannakakis. Equivalence among relational expressions with the union and difference operators. J. ACM 27, 633–655, 1981.
Saraiya, Y. Linearizing nonlinear recursions in polynomial time. Proc. Eighth ACM Symposium on Principles of Database Systems, 182–189, 1989.
Saraiya, Y. Polynomial-time program transformations in deductive databases. Proc. Ninth ACM Symposium on Principles of Database Systems, 1990.
Saraiya, Y. Hard problems for simple logic programs. Proc. ACM SIGMOD International Conference on Management of Data, 64–73, 1990.
Saraiya, Y. Subtree-elimination algorithms in deductive databases, Ph.D. Thesis, Stanford University, 1991.
Shmueli, O. Decidability and expressiveness aspects of logic queries. Proc. Sixth ACM Symposium on Principles of Database Systems, 237–249, 1987.
Ullman, J. D. Principles of Database and Knowledge-base Systems. 2 volumes. Computer Science Press, Rockville, Md., 1989.
Ullman, J. D. and A. van Gelder. The parallel complexity of logical query languages. Proc. IEEE Symposium on Foundations of Computer Science, 1986.
Zhang, W., C.T. Yu and D. Troy. Necessary and sufficient conditions to linearize doubly recursive programs in logic databases. ACM Transactions on Database Systems 15:3, 459–482, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Feder, T., Saraiya, Y. (1992). Decidability and undecidability of equivalence for linear Datalog, with applications to normal-form optimizations. In: Biskup, J., Hull, R. (eds) Database Theory — ICDT '92. ICDT 1992. Lecture Notes in Computer Science, vol 646. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-56039-4_49
Download citation
DOI: https://doi.org/10.1007/3-540-56039-4_49
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-56039-5
Online ISBN: 978-3-540-47360-2
eBook Packages: Springer Book Archive