paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Verus: Verifying Rust Programs using Linear Ghost Types

Verus:使用线性幽灵类型验证 Rust 程序
OOPSLA 7(OOPSLA1)2023匹配度 3/10 · 论文提出基于 SMT 的 Rust 形式化验证工具 Verus,属于程序验证/类型系统方向,但不涉及 LLM/Agent、静态分析在 ML/Agentic 程序中的应用、浮点程序分析或贝叶斯程序分析;仅与形式化验证背景有间接关联。引用 84 inbox
Andrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun, Isitha Subasinghe, Yi Zhou, Jon Howell, Bryan Parno, Chris Hawblitzel
crossref: 2026-09-10

AI 速览

一句话:提出基于 SMT 的 Verus,用线性 ghost 类型与模式系统验证 Rust 程序的功能正确性。

Rust 的类型系统通过线性与借用检查保证内存安全,但难以证明功能正确性。Verus 是一个基于 SMT 的 Rust 程序形式验证工具:程序员用 Rust 编写规范与证明,并利用线性类型和借用检查来操作线性 ghost 权限,从而安全地描述内存、指针与并发资源。其核心是新颖的模式系统,将不受线性/借用检查的规范与受检查的可执行代码和证明区分开。作者在小 λ 演算中形式化线性、借用与模式,并证明类型安全及规范/证明终止。案例包括 xor 双向链表、内部可变性与并发代码。

问题
Rust 的类型安全不足以证明低层高保障系统的功能正确性,如何在其线性类型与借用检查之上支持形式验证是核心问题。
方法
Verus 用 Rust 编写规范与证明,引入线性 ghost 权限和区分规范与代码/证明的模式系统,并基于 SMT 进行验证;作者在小 λ 演算中形式化其线性、借用与模式并证明安全性与终止性。
评估
通过指针操作(xor 双向链表)、内部可变性和并发代码等案例展示 Verus 的表达能力与验证能力。
原文摘要(Abstract)

The Rust programming language provides a powerful type system that checks linearity and borrowing, allowing code to safely manipulate memory without garbage collection and making Rust ideal for developing low-level, high-assurance systems. For such systems, formal verification can be useful to prove functional correctness properties beyond type safety. This paper presents Verus, an SMT-based tool for formally verifying Rust programs. With Verus, programmers express proofs and specifications using the Rust language, allowing proofs to take advantage of Rust's linear types and borrow checking. We show how this allows proofs to manipulate linearly typed permissions that let Rust code safely manipulate memory, pointers, and concurrent resources. Verus organizes proofs and specifications using a novel mode system that distinguishes specifications, which are not checked for linearity and borrowing, from executable code and proofs, which are checked for linearity and borrowing. We formalize Verus' linearity, borrowing, and modes in a small lambda calculus, for which we prove type safety and termination of specifications and proofs. We demonstrate Verus on a series of examples, including pointer-manipulating code (an xor-based doubly linked list), code with interior mutability, and concurrent code.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2041,
  title = {Verus: Verifying Rust Programs using Linear Ghost Types},
  author = {Andrea Lattuada and Travis Hance and Chanhee Cho and Matthias Brun and Isitha Subasinghe and Yi Zhou and Jon Howell and Bryan Parno and Chris Hawblitzel},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA1},
  year = {2023},
  doi = {10.1145/3586037}
}