Abstract
The number of variables used by a first-order query is a fundamental measure which has been studied in numerous contexts, and which is known to be highly relevant to the task of query evaluation. In this article, we study this measure in the context of existential positive queries. Building on previous work, we present a combinatorial quantity defined on existential positive queries; we show that this quantity not only characterizes the minimum number of variables needed to express a given existential positive query by another existential positive query, but also that it characterizes the minimum number of variables needed to express a given existential positive query, over all first-order queries. Put differently and loosely, we show that for any existential positive query, no variables can ever be saved by moving out of existential positive logic to first-order logic. One component of this theorem’s proof is the construction of a winning strategy for a certain Ehrenfeucht-Fraïssé type game.
Similar content being viewed by others
Notes
A class of queries has bounded arity if there is a constant upper bound on the arity of all relation symbols appearing in a query of the class.
This can be justified as follows. We write g ∘ f = g(f) to denote the composition of g and f , with f applied first. We have that π1 is a homomorphism from B to A. Hence π1 ∘ h is an endomorphism of A, and since A is a core, π1 ∘ h is an automorphism of A. By associativity of function composition,
$$\text{id}_{A} = (\pi_{1} \circ h) \circ (\pi_{1} \circ h)^{-1}=\pi_{1} \circ (h \circ (\pi_{1} \circ h)^{-1})=\pi_{1} \circ h^{\prime}$$that is, if h′ = h ∘ (π1 ∘ h)− 1, then π1(h′(a)) = a for all a ∈ A. Moreover, h′ is a homomorphism from A to B because (π1 ∘ h)− 1 is an automorphism of A and h is a homomorphism from A to B.
References
Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Reading (1995)
Adler, I., Weyer, M.: Tree-Width for First-Order Formulae. Logical Methods in Computer Science 8(1) (2012). https://lmcs.episciences.org/786
Atserias, A., Bulatov, A.A., Dalmau, V.: On the power of k -consistency. In: Proceedings of the 34th International Colloquium on Automata, vol. 2007 (2007)
Barceló, P., Gottlob, G., Pieris, A.: Semantic acyclicity under constraints. In: Proceedings of the 35th Symposium on Principles of Database Systems (PODS 2016), pp. 343–354 (2016)
Barwise, J.: On moschovakis closure ordinals. J. Symb. Log. 42, 292–296 (1977)
Bova, S., Chen, H.: The complexity of width minimization for existential positive queries. In: Proceedings of the 17th International Conference on Database Theory (ICDT 2014), pp 235–244 (2014)
Bova, S., Chen, H.: How many variables are needed to express an existential positive query? In: 20th International Conference on Database Theory (ICDT) 2017, pp. 9:1–9:16 (2017)
Chandra, A.K., Merlin, P.M.: Optimal implementation of conjunctive queries in relational data bases. In: Proceedings of the 9th Symposium on Theory of Computing (STOC 1977), pp 77–90 (1977)
Chen, H.: Beyond Q-resolution and prenex form: a proof system for quantified constraint satisfaction. Logical Methods in Computer Science, 10(4) (2014)
Chen, H.: On the complexity of existential positive queries. ACM Transactions on Computational Logic, 15(1) (2014)
Chen, H.: The tractability frontier of graph-like first-order query sets. In: Proceedings of the Joint Meeting of the 23rd Conference on Computer Science Logic and the 29th Symposium on Logic in Computer Science (CSL-LICS 2014), pp. 31:1–31:9 (2014)
Chen, H.: The tractability frontier of graph-like first-order query sets. CoRR, arXiv:1407.3429 (2014)
Chen, H., Dalmau, V.: Width: Beyond hypertree decomposition methods without decompositions. In: Proceedings of the 11th International Conference on Principles and Practice of Constraint Programming (CP 2015), pp. 167–181 (2015)
Chen, H., Dalmau, V.: From pebble games to tractability an ambidextrous consistency algorithm for quantified constraint satisfaction. In: Proceedings of the 19th Conference on Computer Science Logic (CSL 2005), pp. 232–247 (2005)
Chen, H., Müller, M.: One hierarchy spawns another: graph deconstructions and the complexity classification of conjunctive queries. In: Proceedings of the Joint Meeting of the 23rd Conference on Computer Science Logic and the 29th Symposium on Logic in Computer Science (CSL-LICS 2014), pp. 32:1–32:10 (2014)
Dalmau, V., Kolaitis, P.G., Vardi, M.Y.: Constraint satisfaction, bounded treewidth, and finite-variable logics. In: Proceedings of the 8th International Conference on Principles and Practice of Constraint Programming (CP 2002), pp. 310–326 (2002)
Diestel, R.: Graph theory. Springer, Berlin (2012)
Grohe, M.: The complexity of homomorphism and constraint satisfaction problems seen from the other side. Journal of the ACM, 54(1) (2007)
Hell, P., Nesetril, J.: The core of a graph. Discret. Math. 109, 117–126 (1992)
Immerman, N.: Upper and lower bounds for first-order expressibility. J. Comput. Syst. Sci. 25, 76–98 (1982)
Kolaitis, P.G., Vardi, M.Y.: On the expressive power of datalog: tools and a case study. J. Comput. Syst. Sci. 51(1), 110–134 (1995)
Vardi, M.Y.: On the complexity of bounded-variable queries. In: Proceedings of the 14th Symposium on Principles of Database Systems (PODS 1995), pp. 266–276 (1995)
Acknowledgments
The first author was supported by the FWF Austrian Science Fund (Parameterized Compilation, P26200). The second author was supported by the Spanish Project MINECO COMMAS TIN2013-46181-C2-R, Basque Project GIU15/30, and Basque Grant UFI11/45.
Author information
Authors and Affiliations
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This article is part of the Topical Collection on Special Issue on Database Theory
Rights and permissions
About this article
Cite this article
Bova, S., Chen, H. How Many Variables are Needed to Express an Existential Positive Query?. Theory Comput Syst 63, 1573–1594 (2019). https://doi.org/10.1007/s00224-018-9884-z
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-018-9884-z