Strongly-Normalizing Higher-Order Relational Queries

by   Wilmer Ricciotti, et al.

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.



page 1

page 2

page 3

page 4


Mixing set and bag semantics

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

Query Lifting: Language-integrated query for heterogeneous nested collections

Language-integrated query based on comprehension syntax is a powerful te...

Generating collection queries from proofs

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

The Optics of Language-Integrated Query

Monadic comprehensions reign over the realm of language-integrated query...

Language-integrated provenance by trace analysis

Language-integrated provenance builds on language-integrated query techn...

Explaining Wrong Queries Using Small Examples

For testing the correctness of SQL queries, e.g., evaluating student sub...

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.