First-order definable counting-only queries
Many data sources can be represented easily by collections of sets of objects. For several practical queries on such collections of sets of objects, the answer does not depend on the precise composition of these sets, but only on the number of sets to which each object belongs. This is the case k= 1 for the more general situation where the query answer only depends on the number of sets to which each collection of at most k objects belongs. We call such queries k-counting-only. Here, we focus on k-SyCALC, i.e., k-counting-only queries that are first-order definable. As k-SyCALC is semantically defined, however, it is not surprising that it is already undecidable whether a first-order query is in 1-SyCALC. Therefore, we introduce SimpleCALC-k, a syntactically defined (strict) fragment of k-SyCALC. It turns out that many practical queries in k-SyCALC can already be expressed in SimpleCALC− k. We also define the query language GCount− k, which expresses counting-only queries directly by using generalized counting terms, and show that this language is equivalent to SimpleCALC-k. We prove that the k-counting-only queries form a non-collapsing hierarchy: for every k, there exist (k+ 1)-counting-only queries that are not k-counting-only. This result specializes to both SimpleCALC− k and k-SyCALC. Finally, we establish a strong dichotomy between 1-SyCALC and SimpleCALC− k on the one hand and 2-SyCALC on the other hand by showing that satisfiability, validity, query containment, and query equivalence are decidable for the former two languages, but not for the latter one.
KeywordsBag of sets Counting-only query First-order definable query Satisfiability
Mathematics Subject Classification (2010)03C07 03C80 03D15 03D55 68P15
Unable to display preview. Download preview PDF.
This is a revised and extended version of the conference paper ‘First-order definable counting-only queries’, presented at the 10th International Symposium on Foundations of Information and Knowledge Systems, Budapest, Hungary (FoIKS 2018) .
- 1.Abiteboul, S., Hull, R., Vianu, V. (eds.): Foundations of Databases: The Logical Level, 1st edn. Addison-Wesley Longman Publishing Co. Inc, Reading (1995)Google Scholar
- 2.Anderson, I.: Combinatorics of Finite Sets. Dover Publications, New York (2011)Google Scholar
- 3.Bachmair, L., Ganzinger, H., Waldmann, U.: Set constraints are the monadic class. In: Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science, pp. 75–83 (1993)Google Scholar
- 4.Badia, A., Van Gucht, D., Gyssens, M.: Querying with Generalized Quantifiers, pp 235–258. Springer, Boston (1995)Google Scholar
- 5.Bancilhon, F.: On the completeness of query languages for relational data bases. In: Winkowski, J. (ed.) Mathematical Foundations of Computer Science 1978, Proceedings, 7th Symposium, Zakopane, Poland, September 4-8, 1978, Lecture Notes in Computer Science. https://doi.org/10.1007/3-540-08921-7_60, vol. 64, pp 112–123. Springer (1978)
- 9.Goethals, B.: Survey on Frequent Pattern Mining. Technical report, University of Helsinki (2003)Google Scholar
- 12.Gyssens, M., Hellings, J., Paredaens, J., Van Gucht, D., Wijsen, J., Wu, Y.: Calculi for symmetric queries. J. Comput. Syst. Sci. 105, 54–86 (2019)Google Scholar
- 15.Hellings, J., Gyssens, M., Van Gucht, D., Wu, Y.: First-order definable counting-only queries. In: Foundations of Information and Knowledge Systems, pp. 225–243. Springer International Publishing (2018)Google Scholar
- 16.Kuske, D., Schweikardt, N.: First-order logic with counting. In: 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pp. 1–12 (2017)Google Scholar
- 21.Peters, S., Westerståhl, D.: Quantifiers in Language and Logic. Oxford University Press, London (2008). https://doi.org/10.1093/acprof:oso/9780199291267.001.0001 CrossRefGoogle Scholar
- 22.Quine, W.V.: Selected Logic Papers. Harvard University Press, Cambridge (1995)Google Scholar
- 23.Sayrafi, B., Van Gucht, D.: Differential constraints. In: Proceedings of the Twenty-fourth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 348–357. ACM (2005)Google Scholar
- 24.Sayrafi, B., Van Gucht, D., Gyssens, M.: Measures in Databases and Data Mining. Tech. Rep. TR602, Indiana University. https://www.cs.indiana.edu/cgi-bin/techreports/TRNNN.cgi?trnum=TR602 (2004)
- 25.Thomas, S.J., Fischer, P.C.: Nested relational structures. Adv. Comput. Res. 3, 269–307 (1986)Google Scholar
- 26.Väänänen, J.: Generalized Quantifiers, an Introduction. In: Generalized Quantifiers and Computation: 9th European Summer School in Logic, Language, and Information, pp. 1–17. Springer, Berlin (1999)Google Scholar
- 27.Vianu, V., Van Gucht, D.: Computationally complete relational query languages. In: Liu, L., Özsu, M.T. (eds.) Encyclopedia of Database Systems. 1st edn., pp 1–7. Springer, New York (2017)Google Scholar
- 28.Westerståhl, D.: Generalized quantifiers. In: Zalta, E. N. (ed.) The Stanford Encyclopedia of Philosophy, winter 2016 edn. Metaphysics Research Lab, Stanford University (2016)Google Scholar