带空的SQL的形式化。

IF 0.9 3区 计算机科学 Q4 COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE Journal of Automated Reasoning Pub Date : 2022-01-01 Epub Date: 2022-07-27 DOI:10.1007/s10817-022-09632-4
Wilmer Ricciotti, James Cheney
{"title":"带空的SQL的形式化。","authors":"Wilmer Ricciotti,&nbsp;James Cheney","doi":"10.1007/s10817-022-09632-4","DOIUrl":null,"url":null,"abstract":"<p><p>SQL is the world's most popular declarative language, forming the basis of the multi-billion-dollar database industry. Although SQL has been standardized, the full standard is based on ambiguous natural language rather than formal specification. Commercial SQL implementations interpret the standard in different ways, so that, given the same input data, the same query can yield different results depending on the SQL system it is run on. Even for a particular system, mechanically checked formalization of all widely-used features of SQL remains an open problem. The lack of a well-understood formal semantics makes it very difficult to validate the soundness of database implementations. Although formal semantics for fragments of SQL were designed in the past, they usually did not support set and bag operations, lateral joins, nested subqueries, and, crucially, null values. Null values complicate SQL's semantics in profound ways analogous to null pointers or side-effects in other programming languages. Since certain SQL queries are equivalent in the absence of null values, but produce different results when applied to tables containing incomplete data, semantics which ignore null values are able to prove query equivalences that are unsound in realistic databases. A formal semantics of SQL supporting all the aforementioned features was only proposed recently. In this paper, we report about our mechanization of SQL semantics covering set/bag operations, lateral joins, nested subqueries, and nulls, written in the Coq proof assistant, and describe the validation of key metatheoretic properties. Additionally, we are able to use the same framework to formalize the semantics of a flat relational calculus (with null values), and show a certified translation of its normal forms into SQL.</p>","PeriodicalId":15082,"journal":{"name":"Journal of Automated Reasoning","volume":"66 4","pages":"989-1030"},"PeriodicalIF":0.9000,"publicationDate":"2022-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9637088/pdf/","citationCount":"2","resultStr":"{\"title\":\"A Formalization of SQL with Nulls.\",\"authors\":\"Wilmer Ricciotti,&nbsp;James Cheney\",\"doi\":\"10.1007/s10817-022-09632-4\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p><p>SQL is the world's most popular declarative language, forming the basis of the multi-billion-dollar database industry. Although SQL has been standardized, the full standard is based on ambiguous natural language rather than formal specification. Commercial SQL implementations interpret the standard in different ways, so that, given the same input data, the same query can yield different results depending on the SQL system it is run on. Even for a particular system, mechanically checked formalization of all widely-used features of SQL remains an open problem. The lack of a well-understood formal semantics makes it very difficult to validate the soundness of database implementations. Although formal semantics for fragments of SQL were designed in the past, they usually did not support set and bag operations, lateral joins, nested subqueries, and, crucially, null values. Null values complicate SQL's semantics in profound ways analogous to null pointers or side-effects in other programming languages. Since certain SQL queries are equivalent in the absence of null values, but produce different results when applied to tables containing incomplete data, semantics which ignore null values are able to prove query equivalences that are unsound in realistic databases. A formal semantics of SQL supporting all the aforementioned features was only proposed recently. In this paper, we report about our mechanization of SQL semantics covering set/bag operations, lateral joins, nested subqueries, and nulls, written in the Coq proof assistant, and describe the validation of key metatheoretic properties. Additionally, we are able to use the same framework to formalize the semantics of a flat relational calculus (with null values), and show a certified translation of its normal forms into SQL.</p>\",\"PeriodicalId\":15082,\"journal\":{\"name\":\"Journal of Automated Reasoning\",\"volume\":\"66 4\",\"pages\":\"989-1030\"},\"PeriodicalIF\":0.9000,\"publicationDate\":\"2022-01-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9637088/pdf/\",\"citationCount\":\"2\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Automated Reasoning\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://doi.org/10.1007/s10817-022-09632-4\",\"RegionNum\":3,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"2022/7/27 0:00:00\",\"PubModel\":\"Epub\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Automated Reasoning","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1007/s10817-022-09632-4","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2022/7/27 0:00:00","PubModel":"Epub","JCR":"Q4","JCRName":"COMPUTER SCIENCE, ARTIFICIAL INTELLIGENCE","Score":null,"Total":0}
引用次数: 2

摘要

SQL是世界上最流行的声明性语言,它构成了价值数十亿美元的数据库行业的基础。虽然SQL已经标准化了,但是完整的标准是基于模糊的自然语言,而不是正式的规范。商业SQL实现以不同的方式解释标准,因此,给定相同的输入数据,相同的查询可以产生不同的结果,这取决于它所运行的SQL系统。即使对于特定的系统,所有广泛使用的SQL特性的机械检查形式化仍然是一个开放的问题。由于缺乏易于理解的形式化语义,因此很难验证数据库实现的可靠性。尽管过去为SQL片段设计了形式化语义,但它们通常不支持set和bag操作、横向连接、嵌套子查询以及最重要的空值。Null值以一种深刻的方式使SQL的语义复杂化,类似于其他编程语言中的空指针或副作用。由于某些SQL查询在没有空值的情况下是等价的,但在应用于包含不完整数据的表时产生不同的结果,因此忽略空值的语义能够证明在实际数据库中不可靠的查询等价。支持上述所有特性的SQL的形式化语义最近才被提出。在本文中,我们报告了我们在Coq证明助手中编写的SQL语义的机械化,包括集合/包操作、横向连接、嵌套子查询和null,并描述了关键元理论属性的验证。此外,我们能够使用相同的框架来形式化平面关系演算(带空值)的语义,并显示其正常形式到SQL的经过认证的转换。
本文章由计算机程序翻译,如有差异,请以英文原文为准。

摘要图片

摘要图片

摘要图片

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
A Formalization of SQL with Nulls.

SQL is the world's most popular declarative language, forming the basis of the multi-billion-dollar database industry. Although SQL has been standardized, the full standard is based on ambiguous natural language rather than formal specification. Commercial SQL implementations interpret the standard in different ways, so that, given the same input data, the same query can yield different results depending on the SQL system it is run on. Even for a particular system, mechanically checked formalization of all widely-used features of SQL remains an open problem. The lack of a well-understood formal semantics makes it very difficult to validate the soundness of database implementations. Although formal semantics for fragments of SQL were designed in the past, they usually did not support set and bag operations, lateral joins, nested subqueries, and, crucially, null values. Null values complicate SQL's semantics in profound ways analogous to null pointers or side-effects in other programming languages. Since certain SQL queries are equivalent in the absence of null values, but produce different results when applied to tables containing incomplete data, semantics which ignore null values are able to prove query equivalences that are unsound in realistic databases. A formal semantics of SQL supporting all the aforementioned features was only proposed recently. In this paper, we report about our mechanization of SQL semantics covering set/bag operations, lateral joins, nested subqueries, and nulls, written in the Coq proof assistant, and describe the validation of key metatheoretic properties. Additionally, we are able to use the same framework to formalize the semantics of a flat relational calculus (with null values), and show a certified translation of its normal forms into SQL.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Journal of Automated Reasoning
Journal of Automated Reasoning 工程技术-计算机:人工智能
CiteScore
3.60
自引率
9.10%
发文量
31
审稿时长
>12 weeks
期刊介绍: The Journal of Automated Reasoning is an interdisciplinary journal that maintains a balance between theory, implementation and application. The spectrum of material published ranges from the presentation of a new inference rule with proof of its logical properties to a detailed account of a computer program designed to solve various problems in industry. The main fields covered are automated theorem proving, logic programming, expert systems, program synthesis and validation, artificial intelligence, computational logic, robotics, and various industrial applications. The papers share the common feature of focusing on several aspects of automated reasoning, a field whose objective is the design and implementation of a computer program that serves as an assistant in solving problems and in answering questions that require reasoning. The Journal of Automated Reasoning provides a forum and a means for exchanging information for those interested purely in theory, those interested primarily in implementation, and those interested in specific research and industrial applications.
期刊最新文献
Single-Set Cubical Categories and Their Formalisation with a Proof Assistant Towards a Scalable Proof Engine: A Performant Prototype Rewriting Primitive for Coq Verifying the Generalization of Deep Learning to Out-of-Distribution Domains Dependency Schemes in CDCL-Based QBF Solving: A Proof-Theoretic Study Verifying a Sequent Calculus Prover for First-Order Logic with Functions in Isabelle/HOL
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1