A Typed C11 Semantics for Interactive Theorem Proving

R. Krebbers, F. Wiedijk
{"title":"A Typed C11 Semantics for Interactive Theorem Proving","authors":"R. Krebbers, F. Wiedijk","doi":"10.1145/2676724.2693571","DOIUrl":null,"url":null,"abstract":"We present a semantics of a significant fragment of the C programming language as described by the C11 standard. It consists of a small step semantics of a core language, which uses a structured memory model to capture subtleties of C11, such as strict-aliasing restrictions related to unions, that have not yet been addressed by others. The semantics of actual C programs is defined by translation into this core language. We have an explicit type system for the core language, and prove type preservation and progress, as well as type correctness of the translation. Due to unspecified order of evaluation, our operational semantics is non-deterministic. To explore all defined and undefined behaviors, we present an executable semantics that computes a stream of finite sets of reachable states. It is proved sound and complete with respect to the operational semantics. Both the translation into the core language and the executable semantics are defined as Coq programs. Extraction to OCaml is used to obtain a C interpreter to run and test the semantics on actual C programs. All proofs are fully formalized in Coq.","PeriodicalId":187702,"journal":{"name":"Proceedings of the 2015 Conference on Certified Programs and Proofs","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"25","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2015 Conference on Certified Programs and Proofs","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2676724.2693571","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 25

Abstract

We present a semantics of a significant fragment of the C programming language as described by the C11 standard. It consists of a small step semantics of a core language, which uses a structured memory model to capture subtleties of C11, such as strict-aliasing restrictions related to unions, that have not yet been addressed by others. The semantics of actual C programs is defined by translation into this core language. We have an explicit type system for the core language, and prove type preservation and progress, as well as type correctness of the translation. Due to unspecified order of evaluation, our operational semantics is non-deterministic. To explore all defined and undefined behaviors, we present an executable semantics that computes a stream of finite sets of reachable states. It is proved sound and complete with respect to the operational semantics. Both the translation into the core language and the executable semantics are defined as Coq programs. Extraction to OCaml is used to obtain a C interpreter to run and test the semantics on actual C programs. All proofs are fully formalized in Coq.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
用于交互定理证明的类型化C11语义
我们提出了C11标准所描述的C编程语言的一个重要片段的语义。它由核心语言的小步骤语义组成,它使用结构化内存模型来捕捉C11的细微之处,例如与联合相关的严格混叠限制,这是其他人尚未解决的问题。实际C程序的语义是通过翻译成这种核心语言来定义的。我们对核心语言有一个明确的类型系统,并证明了类型的保存和进步,以及翻译的类型正确性。由于未指定的求值顺序,我们的操作语义是非确定的。为了探索所有已定义和未定义的行为,我们提出了一个可执行语义,它计算可达状态的有限集合流。就运算语义而言,它被证明是健全和完备的。核心语言的翻译和可执行语义都被定义为Coq程序。提取到OCaml用于获得C解释器,以便在实际的C程序上运行和测试语义。所有的证明都在Coq中完全形式化。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
A Framework for Verifying Depth-First Search Algorithms Recording Completion for Certificates in Equational Reasoning Verified Validation of Program Slicing Clean-Slate Development of Certified OS Kernels Certified Abstract Interpretation with Pretty-Big-Step Semantics
×
引用
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