Strongly-Normalizing Higher-Order Relational Queries

11/26/2020
by   Wilmer Ricciotti, et al.
0

Language-integrated query is a powerful programming construct allowing database queries and ordinary program code to interoperate seamlessly and safely. Language-integrated query techniques rely on classical results about monadic comprehension calculi, including the conservativity theorem for nested relational calculus. Conservativity implies that query expressions can freely use nesting and unnesting, yet as long as the query result type is a flat relation, these capabilities do not lead to an increase in expressiveness over flat relational queries. Wong showed how such queries can be translated to SQL via a constructive rewriting algorithm, and Cooper and others advocated higher-order nested relational calculi as a basis for language-integrated queries in functional languages such as Links and F#. However there is no published proof of the central strong normalization property for higher-order nested relational queries: a previous proof attempt does not deal correctly with rewrite rules that duplicate subterms. This paper fills the gap in the literature, explaining the difficulty with a previous proof attempt, and showing how to extend the ⊤⊤-lifting approach of Lindley and Stark to accommodate duplicating rewrites. We also show how to extend the proof to a recently-introduced calculus for heterogeneous queries mixing set and multiset semantics.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/06/2019

Mixing set and bag semantics

The conservativity theorem for nested relational calculus implies that q...
research
01/11/2021

Query Lifting: Language-integrated query for heterogeneous nested collections

Language-integrated query based on comprehension syntax is a powerful te...
research
09/02/2020

The Optics of Language-Integrated Query

Monadic comprehensions reign over the realm of language-integrated query...
research
09/17/2022

Synthesizing Nested Relational Queries from Implicit Specifications

Derived datasets can be defined implicitly or explicitly. An implicit de...
research
12/06/2022

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...
research
05/06/2019

Language-integrated provenance by trace analysis

Language-integrated provenance builds on language-integrated query techn...
research
05/13/2020

Generating collection queries from proofs

Nested relations, built up from atomic types via tupling and set types, ...

Please sign up or login with your details

Forgot password? Click here to reset