×

Synthesizing nested relational queries from implicit specifications: via model theory and via proof theory. (English) Zbl 07906369

Summary: Derived datasets can be defined implicitly or explicitly. An implicit definition (of dataset \(O\) in terms of datasets \(\vec{I}\)) is a logical specification involving two distinguished sets of relational symbols. One set of relations is for the “source data” \(\vec{I}\), and the other is for the “interface data” \(O\). Such a specification is a valid definition of \(O\) in terms of \(\vec{I}\), if any two models of the specification agreeing on \(\vec{I}\) agree on \(O\). In contrast, an explicit definition is a transformation (or “query” below) that produces \(O\) from \(\vec{I}\). Variants of Beth’s theorem [E. W. Beth, Nederl. Akad. Wet., Proc., Ser. A 56 (Indag. Math. 15), 330–339 (1953; Zbl 0053.34402)] state that one can convert implicit definitions to explicit ones. Further, this conversion can be done effectively given a proof witnessing implicit definability in a suitable proof system.
We prove the analogous implicit-to-explicit result for nested relations: implicit definitions, given in the natural logic for nested relations, can be converted to explicit definitions in the nested relational calculus (NRC). We first provide a model-theoretic argument for this result, which makes some additional connections that may be of independent interest, between NRC queries, interpretations, a standard mechanism for defining structure-to-structure translation in logic, and between interpretations and implicit to definability “up to unique isomorphism”. The latter connection uses a variation of a result of Gaifman concerning “relatively categorical” theories. We also provide a a proof-theoretic result that provides an effective argument: from a proof witnessing implicit definability, we can efficiently produce an NRC definition. This will involve introducing the appropriate proof system for reasoning with nested sets, along with some auxiliary Beth-type results for this system. As a consequence, we can effectively extract rewritings of NRC queries in terms of NRC views, given a proof witnessing that the query is determined by the views.

MSC:

03B70 Logic in computer science
68-XX Computer science

Citations:

Zbl 0053.34402

References:

[1] H. Andréka, J. X. Madarász, and I. Németi. Definability of new universes in many-sorted logic, 2008. manuscript available at old.renyi.hu/pub/algebraic-logic/kurzus10/amn-defi.pdf.
[2] Vince Bárány, Michael Benedikt, and Balder ten Cate. Some model theory of guarded negation. J. Symb. Log., 83(4):1307-1344, 2018. · Zbl 1522.03098
[3] Michael Benedikt, Pierre Bourhis, and Michael Vanden Boom. Definability and interpolation within decidable fixpoint logics. Log. Methods Comput. Sci., 15(3):29:1-29:53, 2019. · Zbl 1509.03088
[4] Michael Benedikt, Balden Ten Cate, Julien Leblay, and Efthymia Tsamoura. Generating Plans from Proofs: The Interpolation-Based Approach to Query Reformulation. Morgan Claypool, San Rafael, CA, 2016. · Zbl 1345.68003
[5] Mikolaj Bojanczyk, Laure Daviaud, and Shankara Narayanan Krishna. Regular and first-order list functions. In LICS, 2018.
[6] E. W. Beth. On Padoa’s method in the theory of definitions. Indag. Mathematicae, 15:330 -339, 1953. · Zbl 0053.34402
[7] Michael Benedikt and Christoph Koch. From XQuery to Relational Logics. ACM TODS, 34(4):25:1-25:48, 2009.
[8] Michael Benedikt, Egor V. Kostylev, Fabio Mogavero, and Efthymia Tsamoura. Reformulating queries: Theory and practice. In IJCAI, 2017.
[9] Peter Buneman, Shamim A. Naqvi, Val Tannen, and Limsoon Wong. Principles of programming with complex objects and collection types. Theor. Comput. Sci., 149(1):3-48, 1995. · Zbl 0874.68092
[10] Michael Benedikt and Cécilia Pradic. Generating collection transformations from proofs. In POPL, 2021.
[11] Michael Benedikt, Cécilia Pradic, and Christoph Wernhard. Synthesizing nested relational queries from implicit specifications. In PODS, pages 33-45, 2023.
[12] Michael Benedikt, Balder ten Cate, and Michael Vanden Boom. Effective interpolation and preservation in guarded logics. ACM TOCL, 17(2):8:1-8:46, 2016. · Zbl 1367.03036
[13] Zoé Chatzadakis and Ehud Hrushovski. Model theory of difference fields. Transactions of the American Mathematical Society, 351:2997-3071, 1999. · Zbl 0922.03054
[14] C. C. Chang. Some new results in definability. Bull. of the AMS, 70(6):808 -813, 1964. · Zbl 0137.00805
[15] C. C. Chang and H. Jerome Keisler. Model Theory. North-Holland, 1992.
[16] Thomas Colcombet and Christof Löding. Transforming structures by set interpretations. Logical Methods in Computer Science, 3(2), 2007. · Zbl 1128.03026
[17] William Craig. Linear reasoning. a new form of the Herbrand-Gentzen theorem. J. Symb. Log., 22(03):250-268, 1957. · Zbl 0081.24402
[18] William Craig. Three uses of the Herbrand-Gentzen theorem in relating model theory and proof theory. J. Symb. Log., 22(3):269-285, 1957. · Zbl 0079.24502
[19] Giovanna D’Agostino and Marco Hollenberg. Logical Questions Concerning The mu-Calculus: Interpolation, Lyndon and Los-Tarski. J. Symb. Log., 65(1):310-332, 2000. · Zbl 0982.03011
[20] Melvin Fitting. First-order Logic and Automated Theorem Proving. Springer, second edition, 1996. · Zbl 0848.68101
[21] Enrico Franconi, Volha Kerhet, and Nhung Ngo. Exact query reformulation over databases with first-order and description logics ontologies. J. Artif. Int. Res., 48:885-922, 2013. · Zbl 1314.68118
[22] Haim Gaifman. Operations on relational structures, functors and classes I. In Proc. of the Tarski Symposium, volume 25 of Proc. of Symposia in Pure Mathematics, pages 20-40, 1974. · Zbl 0319.02048
[23] Jeremy Gibbons, Fritz Henglein, Ralf Hinze, and Nicolas Wu. Relational algebra by way of adjunctions. PACMPL, 2(ICFP), 2018.
[24] Jeremy Gibbons. Comprehending Ringads -for Phil Wadler, on the occasion of his 60th birthday. In A List of Successes That Can Change the World -Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, 2016. · Zbl 1343.68058
[25] Wilfrid Hodges, I.M. Hodkinson, and Dugald Macpherson. Omega-categoricity, relative cate-goricity and coordinatisation. Annals of Pure and Applied Logic, 46(2):169 -199, 1990. · Zbl 0699.03016
[26] Eva Hoogland, Maarten Marx, and Martin Otto. Beth definability for the guarded fragment. In LPAR, 1999.
[27] Wilfrid Hodges. A normal form for algebraic constructions II. Logique et Analyse, 18(71/72):429-487, 1975. · Zbl 0346.02029
[28] Wilfrid Hodges. Model Theory. Cambridge University Press, 1993. · Zbl 0789.03031
[29] Ehud Hrushovski. Groupoids, imaginaries and internal covers. Turkish Journal of Mathematics, 36:173 -198, 2014. · Zbl 1260.03065
[30] Guoxiang Huang. Constructing Craig interpolation formulas. In Computing and Combinatorics. 1995.
[31] Thomas Jech. Set Theory. Springer, 2003. · Zbl 1007.03002
[32] S. C. Kleene. Permutability of inferences in Gentzen’s calculi lk and lj. Memoirs of the American Mathematical Society, 10:1-26, 1952. · Zbl 0047.25002
[33] Christoph Koch. On the Complexity of Non-recursive XQuery and Functional Query Languages on Complex Values. ACM TODS, 31(4):1215-1256, 2006.
[34] Vol. 20:3 SYNTHESIZING NESTED RELATIONAL QUERIES 7:41
[35] Phokion G. Kolaitis. Implicit definability on finite structures and unambiguous computations. In LICS, 1990.
[36] David Kueker. Generalized interpolation and definability. Annals of Mathematical Logic, 1(4):423-468, 1971. · Zbl 0204.31002
[37] E. G. K. Lopez-Escobar. An interpolation theorem for denumerably long sentences. Fundamenta Mathametica, 57:253-272, 1965. · Zbl 0137.00701
[38] Roger C. Lyndon. An interpolation theorem in the predicate calculus. Pacific J. Math., 9:129-142, 1959. · Zbl 0093.01002
[39] Michael Makkai. On a generalization of a theorem of E. W. Beth. Acta Math. Ac. Sci. Hung., 15:227-235, 1964. · Zbl 0202.30104
[40] Erik Meijer, Brian Beckman, and Gavin Bierman. LINQ: Reconciling object, relations and XML in the .NET framework. In SIGMOD, 2006.
[41] MGL + 10] Sergey Melnik, Andrey Gubarev, Jing Jing Long, Geoffrey Romer, Shiva Shivakumar, Matt Tolton, and Theo Vassilakis. Dremel: Interactive Analysis of Web-Scale Datasets. PVLDB, 3(1-2):330-339, 2010.
[42] Andrzej Mostowski. An undecidable arithmetical statement. Fundamenta Mathematicae, 36(1):143-164, 1949. · Zbl 0039.00802
[43] Alan Nash, Luc Segoufin, and Victor Vianu. Views and queries: Determinacy and rewriting. ACM TODS, 35(3):1-41, 2010.
[44] Sara Negri and Jan von Plato. Cut elimination in the presence of axioms. Bull. Symb. Log., 4(4):418-435, 1998. · Zbl 0934.03072
[45] Sara Negri and Jan von Plato. Structural Proof Theory. Cambridge University Press, 2001. · Zbl 1113.03051
[46] Martin Otto. An interpolation theorem. Bull. Symb. Log., 6(4):447-462, 2000. · Zbl 0981.03040
[47] Raymond Smullyan. First Order Logic. Springer, 1968. · Zbl 0172.28901
[48] Raymond M. Smullyan. Craig’s Interpolation Lemma and Beth’s Definability Theorem. In: First-Order Logic, pages 127-133. Springer, 1968.
[49] Dan Suciu. Parallel Programming Languages for Collections. PhD thesis, Univ. Pennsylvania, 1995.
[50] Luc Segoufin and Victor Vianu. Views and queries: Determinacy and rewriting. In PODS, 2005.
[51] Gaisi Takeuti. Proof Theory. North-Holland, second edition, 1987. · Zbl 0609.03019
[52] Balder ten Cate, Enrico Franconi, and Inanç Seylan. Beth definability in expressive description logics. J. Artif. Int. Res., 48(1):347-414, 2013. · Zbl 1442.68223
[53] Arne S. Troelstra and Helmut Schwichtenberg. Basic Proof Theory. Cambridge University Press, 2000. · Zbl 0957.03053
[54] David Toman and Grant Weddell. Fundamentals of Physical Design and Query Compilation. Morgan Claypool, 2011. · Zbl 1238.68004
[55] Jan Van den Bussche. Simulation of the Nested Relational Algebra by the Flat Relational Algebra, with an Application to the Complexity of Evaluating Powerset Algebra Expressions. Theor. Comput. Sci., 254(1-2):363-377, 2001. · Zbl 0974.68047
[56] Limsoon Wong. Querying Nested Collections. PhD thesis, Univ. Pennsylvania, 1994. 7:56 M. Benedikt, C. Pradic, and C. Wernhard Vol. 20:3
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.