通过符号语义实现 Rust 的可靠借用检查(长版本)
Sound Borrow-Checking for Rust via Symbolic Semantics (Long Version)
AI总结:
本文证明高层借用模型 LLBC 相对于低层指针语言可靠,并引入混合状态证明风格及连接操作,为 Aeneas 框架增加循环支持,提升其表达能力。
摘要:
Rust 编程语言持续受到越来越多的关注,因此值得编程语言研究界给予密切关注。在这项工作中,我们为 Rust 语义的理论理解提出了一项新的基础性贡献。我们证明了 LLBC——一个先前为 Rust 的语义和执行提出的、以借用为中心的高层模型——相对于一个类似于 CompCert 的、基于指针的低层语言是可靠的。具体来说,我们证明了以下内容:LLBC 是对传统执行模型的一种正确视图;LLBC 的符号语义是对 LLBC 程序的正确抽象;并且 LLBC 的符号语义充当 LLBC 的借用检查器,也就是说,经过符号检查的 LLBC 程序在堆和地址执行模型上运行时不会卡住。为了证明这些结果,我们引入了一种新的证明风格,它显著简化了我们的模拟证明,该风格依赖于混合状态的概念。借助这一推理框架,我们证明了 LLBC 符号语义的一项新增内容,即连接操作,能够保持抽象性和借用检查性质。这进而使我们能够为 Aeneas 框架增加对循环的支持;我们通过一系列示例和案例研究表明,这为 Aeneas 解锁了新的表达能力。
英文摘要:
The Rust programming language continues to rise in popularity, and as such, warrants the close attention of the programming languages community. In this work, we present a new foundational contribution towards the theoretical understanding of Rust's semantics. We prove that LLBC, a high-level, borrow-centric model previously proposed for Rust's semantics and execution, is sound with regards to a low-level pointer-based language à la CompCert. Specifically, we prove the following: that LLBC is a correct view over a traditional model of execution; that LLBC's symbolic semantics are a correct abstraction of LLBC programs; and that LLBC's symbolic semantics act as a borrow-checker for LLBC, i.e. that symbolically-checked LLBC programs do not get stuck when executed on a heap-and-addresses model of execution. To prove these results, we introduce a new proof style that considerably simplifies our proofs of simulation, which relies on a notion of hybrid states. Equipped with this reasoning framework, we show that a new addition to LLBC's symbolic semantics, namely a join operation, preserves the abstraction and borrow-checking properties. This in turn allows us to add support for loops to the Aeneas framework; we show, using a series of examples and case studies, that this unlocks new expressive power for Aeneas.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。