Generating collection queries from proofs

05/13/2020 ∙ by Michael Benedikt, et al. ∙ 0

Nested relations, built up from atomic types via tupling and set types, form a rich data model. Over the last decades the nested relational calculus, NRC, has emerged as a standard language for defining transformations on nested collections. NRC is a strongly-typed functional language which allows building up queries using products and projections, a singleton-former, and a map operation that lifts queries on tuples to queries on sets. In this work we show that NRC has a strong connection with first-order logic: it contains exactly the transformations that are implicitly definable by formulas φ in first-order logic with quantification suited for nested collections. We also prove an effective variant of our result, providing a procedure that synthesizes an NRC expression in polynomial time from a proof witnessing that φ provides an implicit definition for one subset of its free variables in terms of another subset of the variables. This synthesis result works off of proofs within an intuitionistic calculus that captures a natural style of reasoning about implicit definability in the context of nested collections.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.