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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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.
- 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.
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
Abiteboul, S., Bourhis, P., Muscholl, A., Wu, Z.: Recursive queries on trees and data trees. In: ICDT, pp. 93–104 (2013)
Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison Wesley, Boston (1995)
Bancilhon, F., Ramakrishnan, R.: An amateur’s introduction to recursive query processing strategies. In: ACM SIGMOD, pp. 16–52 (1986)
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)
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)
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)
Bonatti, P.: On the decidability of containment of recursive datalog queries - preliminary report. In: PODS, pp. 297–306 (2004)
Calvanese, D., De Giacomo, G., Vardi, M.: Decidable containment of recursive queries. Theor. Comput. Sci. 336(1), 33–56 (2005)
Ceri, S., Gottlob, G., Tanca, L.: Logic Programming and Databases. Springer-Verlag, New York Inc (1990)
Chandra, A., Lewis, H., Makowsky, J.: Embedded implicational dependencies and their inference problem. In: STOC, pp. 342–354 (1981)
Chandra, A., Merlin, P.: Optimal implementation of conjunctive queries in relational data bases. In: STOC, pp. 77–90 (1977)
Chaudhuri, S., Vardi, M.: On the equivalence of recursive and nonrecursive datalog programs. In: PODS, pp. 55–66 (1992)
Cosmadakis, S., Gaifman, H., Kanellakis, P., Vardi, M.: Decidable optimization problems for database logic programs (preliminary report). In: STOC, pp. 477–490 (1988)
Cosmadakis, S., Kanellakis, P.: Parallel evaluation of recursive rule queries. In: PODS, pp. 280–293 (1986)
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)
Gaifman, H., Mairson, H., Sagiv, Y., Vardi, M.: Undecidable optimization problems for database logic programs. J. ACM 40(3), 683–713 (1993)
Hillebrand, G., Kanellakis, P., Mairson, H., Vardi, M.: Undecidable boundedness problems for datalog programs. J. Log. Program. 25(2), 163–190 (1995)
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)
Naughton, J.: Data independent recursion in deductive databases. J. Comput. Syst. Sci. 38(2), 259–289 (1989)
Naughton, J., Sagiv, Y.: A simple characterization of uniform boundedness for a class of recursions. J. Log. Program. 10, 232–253 (1991)
Sagiv, Y.: Optimizing datalog programs. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 659–698. Morgan Kaufmann, Los Altos (1988)
Shmueli, O.: Equivalence of datalog queries is undecidable. J. Log. Program. 15(3), 231–241 (1993)
Vardi, M.: The complexity of relational query languages (extended abstract). In: STOC, pp. 137–146 (1982)
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
Corresponding author
Editor information
Editors and Affiliations
Rights 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)