Skip to main content

Eliminating Recursion from Monadic Datalog Programs on Trees

  • Conference paper
  • First Online:
Mathematical Foundations of Computer Science 2015 (MFCS 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9234))

Abstract

We study the problem of eliminating recursion from monadic datalog programs on trees with labels taken from an infinite alphabet. We show that the boundedness problem, i.e., determining whether a datalog program is equivalent to some nonrecursive one is undecidable but the decidability is regained if the descendant relation is disallowed. Under similar restrictions we obtain decidability of the problem of equivalence to a given nonrecursive program. We investigate the connection between these two problems in more detail.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    One could consider a definition allowing additionally nodes connected by the equality relation but we expect that this would be as hard as the disconnected case e.g. the main problem we leave open in Sect. 3, the equivalence of child-only non-linear programs, becomes undecidable by the results of [18] for boolean queries.

  2. 2.

    In [18] the non-linear case required an additional exponential blow-up. However, the improvement of complexity is not caused by considering unary instead of boolean queries. It is easy to see that Theorem 1 holds also in the boolean case.

  3. 3.

    Indeed, the main idea of the undecidability proof is to use the UCQ \(\mathcal Q\) to find errors in the run of a Turing machine encoded by the program \(\mathcal P\). If the nonrecursive query \(\mathcal Q\) is unary it can only find errors close to the node X, such that \(\mathcal P(X)\).

  4. 4.

    Observe that we are only interested in the output on the goal predicate. This is why the property we consider is sometimes called the predicate boundedness [17].

References

  1. Abiteboul, S., Bourhis, P., Muscholl, A., Wu, Z.: Recursive queries on trees and data trees. In: ICDT, pp. 93–104 (2013)

    Google Scholar 

  2. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison Wesley, Boston (1995)

    MATH  Google Scholar 

  3. Bancilhon, F., Ramakrishnan, R.: An amateur’s introduction to recursive query processing strategies. In: ACM SIGMOD, pp. 16–52 (1986)

    Google Scholar 

  4. Benedikt, Michael, Bourhis, Pierre, Senellart, Pierre: Monadic Datalog Containment. In: Czumaj, Artur, Mehlhorn, Kurt, Pitts, Andrew, Wattenhofer, Roger (eds.) ICALP 2012, Part II. LNCS, vol. 7392, pp. 79–91. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  5. Björklund, Henrik, Martens, Wim, Schwentick, Thomas: Optimizing Conjunctive Queries over Trees Using Schema Information. In: Ochmański, Edward, Tyszkiewicz, Jerzy (eds.) MFCS 2008. LNCS, vol. 5162, pp. 132–143. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  6. Bojańczyk, Mikołaj, Murlak, Filip, Witkowski, Adam: Containment of Monadic Datalog Programs via Bounded Clique-Width. In: Halldórsson, Magnús M., Iwama, Kazuo, Kobayashi, Naoki, Speckmann, Bettina (eds.) ICALP 2015. LNCS, vol. 9135, pp. 427–439. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  7. Bonatti, P.: On the decidability of containment of recursive datalog queries - preliminary report. In: PODS, pp. 297–306 (2004)

    Google Scholar 

  8. Calvanese, D., De Giacomo, G., Vardi, M.: Decidable containment of recursive queries. Theor. Comput. Sci. 336(1), 33–56 (2005)

    Article  MATH  Google Scholar 

  9. Ceri, S., Gottlob, G., Tanca, L.: Logic Programming and Databases. Springer-Verlag, New York Inc (1990)

    Book  Google Scholar 

  10. Chandra, A., Lewis, H., Makowsky, J.: Embedded implicational dependencies and their inference problem. In: STOC, pp. 342–354 (1981)

    Google Scholar 

  11. Chandra, A., Merlin, P.: Optimal implementation of conjunctive queries in relational data bases. In: STOC, pp. 77–90 (1977)

    Google Scholar 

  12. Chaudhuri, S., Vardi, M.: On the equivalence of recursive and nonrecursive datalog programs. In: PODS, pp. 55–66 (1992)

    Google Scholar 

  13. Cosmadakis, S., Gaifman, H., Kanellakis, P., Vardi, M.: Decidable optimization problems for database logic programs (preliminary report). In: STOC, pp. 477–490 (1988)

    Google Scholar 

  14. Cosmadakis, S., Kanellakis, P.: Parallel evaluation of recursive rule queries. In: PODS, pp. 280–293 (1986)

    Google Scholar 

  15. Frochaux, A., Grohe, M., Schweikardt, N.: Monadic datalog containment on trees. In: Proceedings of the 8th Alberto Mendelzon Workshop on Foundations of Data Management (2014)

    Google Scholar 

  16. Gaifman, H., Mairson, H., Sagiv, Y., Vardi, M.: Undecidable optimization problems for database logic programs. J. ACM 40(3), 683–713 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  17. Hillebrand, G., Kanellakis, P., Mairson, H., Vardi, M.: Undecidable boundedness problems for datalog programs. J. Log. Program. 25(2), 163–190 (1995)

    Article  MathSciNet  Google Scholar 

  18. Mazowiecki, Filip, Murlak, Filip, Witkowski, Adam: Monadic Datalog and Regular Tree Pattern Queries. In: Csuhaj-Varjú, Erzsébet, Dietzfelbinger, Martin, Ésik, Zoltán (eds.) MFCS 2014, Part I. LNCS, vol. 8634, pp. 426–437. Springer, Heidelberg (2014)

    Google Scholar 

  19. Naughton, J.: Data independent recursion in deductive databases. J. Comput. Syst. Sci. 38(2), 259–289 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  20. Naughton, J., Sagiv, Y.: A simple characterization of uniform boundedness for a class of recursions. J. Log. Program. 10, 232–253 (1991)

    Article  MathSciNet  Google Scholar 

  21. Sagiv, Y.: Optimizing datalog programs. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 659–698. Morgan Kaufmann, Los Altos (1988)

    Google Scholar 

  22. Shmueli, O.: Equivalence of datalog queries is undecidable. J. Log. Program. 15(3), 231–241 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  23. Vardi, M.: The complexity of relational query languages (extended abstract). In: STOC, pp. 137–146 (1982)

    Google Scholar 

Download references

Acknowledgments

We are grateful to Anca Muscholl, Pierre Bourhis and Filip Murlak for helpful discussions and constructive comments that lead to a great improvement of the presentation of this paper. The first and third authors were supported by Poland’s National Science Center grant 2013/09/N/ST6/01170, the second author was supported by Poland’s National Science Center grant 2013/11/D/ST6/03075.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Filip Mazowiecki .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mazowiecki, F., Ochremiak, J., Witkowski, A. (2015). Eliminating Recursion from Monadic Datalog Programs on Trees. In: Italiano, G., Pighizzini, G., Sannella, D. (eds) Mathematical Foundations of Computer Science 2015. MFCS 2015. Lecture Notes in Computer Science(), vol 9234. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-48057-1_31

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-48057-1_31

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-48056-4

  • Online ISBN: 978-3-662-48057-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics