DeepAI AI Chat
Log In Sign Up

Generating collection queries from proofs

by   Michael Benedikt, et al.

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.


page 1

page 2

page 3

page 4


Synthesizing nested relational queries from implicit specifications: via model theory and via proof theory

Derived datasets can be defined implicitly or explicitly. An implicit de...

Synthesizing Nested Relational Queries from Implicit Specifications

Derived datasets can be defined implicitly or explicitly. An implicit de...

Scalable Querying of Nested Data

While large-scale distributed data processing platforms have become an a...

Strongly-Normalizing Higher-Order Relational Queries

Language-integrated query is a powerful programming construct allowing d...

Mixing set and bag semantics

The conservativity theorem for nested relational calculus implies that q...

Parametricity for Nested Types and GADTs

This paper considers parametricity and its consequent free theorems for ...

A Knowledge Compilation Map

We propose a perspective on knowledge compilation which calls for analyz...