论文标题
强大的高级别关系查询
Strongly-Normalizing Higher-Order Relational Queries
论文作者
论文摘要
语言集成查询是一种强大的编程结构,允许数据库查询和普通程序代码无缝,安全地互操作。语言集成的查询技术依赖于嵌套的关系演算的经典结果,表明其查询可以将算法转换为SQL,只要它们的结果类型是平坦的关系。库珀和其他人主张高阶的嵌套关系计算作为功能语言(例如链接和f#)语言集成查询的基础。但是,将高阶关系查询转换为SQL的翻译取决于重写系统,该系统没有发布强大的标准化证明:先前的证明尝试并未正确处理重复复制hutterms的重写规则。本文填补了文献中的差距,解释了以前的证明尝试的困难,并展示了如何扩展Lindley和Stark的$ \ top \ top $放置方法以适应重复的重写。我们还展示了如何将证明扩展到最近引入的探测器,以进行异质查询混合集和多语义语义。
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 the nested relational calculus, stating that its queries can be algorithmically translated to SQL, as long as their result type is a flat relation. 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, the translation of higher-order relational queries to SQL relies on a rewrite system for which no strong normalization proof has been published: 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 $\top\top$-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.