Skip to main content

Decidability and undecidability of equivalence for linear Datalog, with applications to normal-form optimizations

  • Conference paper
  • First Online:
Database Theory — ICDT '92 (ICDT 1992)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 646))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abiteboul, S. Boundedness is undecidable for Datalog programs with a single recursive rule. Information Processing Letters 32, 281–287, 1989.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. Feder, T. and Y. Saraiya. Undecidable normal forms for logic databases, Tech. report TM-ARH-019576, Bellcore, June 1991.

    Google Scholar 

  4. Feder, T. and Y. Saraiya. Detecting commutativity, Tech. report TM-ARH-019716, Bellcore, June 1991.

    Google Scholar 

  5. Hopcroft, J.E. and J. D. Ullman. Introduction to automata theory, languages and computation, Addison-Wesley, 1979.

    Google Scholar 

  6. Ioannidis, Y. E. Commutativity and its role in the processing of linear recursion. Tech. Report 804, University of Wisconsin-Madison, 1989.

    Google Scholar 

  7. Ioannidis, Y. E. and E. Wong. Towards an algebraic theory of recursion. JACM, to appear.

    Google Scholar 

  8. Ioannidis, Y.E. and E. Wong. Transforming nonlinear recursion to linear recursion. J. Logic Programming, to appear.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. Kannan, R. Solution of the Frobenius problem and its generalization. Combinatorica, to appear.

    Google Scholar 

  11. Naughton, J. F. Compiling separable recursions. ACM SIGMOD Intl. Conf. on the Management of Data, 312–319, 1988.

    Google Scholar 

  12. 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.

    Google Scholar 

  13. Sagiv, Y. Optimizing Datalog programs. Proc. Sixth ACM Symposium on Principles of Database Systems, 349–362, 1987.

    Google Scholar 

  14. Sagiv, Y. and M. Yannakakis. Equivalence among relational expressions with the union and difference operators. J. ACM 27, 633–655, 1981.

    Google Scholar 

  15. Saraiya, Y. Linearizing nonlinear recursions in polynomial time. Proc. Eighth ACM Symposium on Principles of Database Systems, 182–189, 1989.

    Google Scholar 

  16. Saraiya, Y. Polynomial-time program transformations in deductive databases. Proc. Ninth ACM Symposium on Principles of Database Systems, 1990.

    Google Scholar 

  17. Saraiya, Y. Hard problems for simple logic programs. Proc. ACM SIGMOD International Conference on Management of Data, 64–73, 1990.

    Google Scholar 

  18. Saraiya, Y. Subtree-elimination algorithms in deductive databases, Ph.D. Thesis, Stanford University, 1991.

    Google Scholar 

  19. Shmueli, O. Decidability and expressiveness aspects of logic queries. Proc. Sixth ACM Symposium on Principles of Database Systems, 237–249, 1987.

    Google Scholar 

  20. Ullman, J. D. Principles of Database and Knowledge-base Systems. 2 volumes. Computer Science Press, Rockville, Md., 1989.

    Google Scholar 

  21. Ullman, J. D. and A. van Gelder. The parallel complexity of logical query languages. Proc. IEEE Symposium on Foundations of Computer Science, 1986.

    Google Scholar 

  22. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Joachim Biskup Richard Hull

Rights and permissions

Reprints 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

Publish with us

Policies and ethics