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

Authors

page 1

page 2

page 3

page 4

05/06/2019

Mixing set and bag semantics

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

Query Lifting: Language-integrated query for heterogeneous nested collections

Language-integrated query based on comprehension syntax is a powerful te...
05/13/2020

Generating collection queries from proofs

Nested relations, built up from atomic types via tupling and set types, ...
09/02/2020

The Optics of Language-Integrated Query

Monadic comprehensions reign over the realm of language-integrated query...
05/06/2019

Language-integrated provenance by trace analysis

Language-integrated provenance builds on language-integrated query techn...
04/09/2019

Explaining Wrong Queries Using Small Examples

For testing the correctness of SQL queries, e.g., evaluating student sub...
04/19/2018

Bar recursion is not computable via iteration

We show that the bar recursion operators of Spector and Kohlenbach, cons...
This week in AI

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