paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Leveraging Rust Types for Program Synthesis

利用 Rust 类型进行程序合成
PLDI 7(PLDI)2023匹配度 3/10 · 论文属于程序合成、类型系统与程序逻辑,虽兼具理论形式化和工具实现,但与用户核心方向(LLM/Agent 与静态分析/形式化验证交叉、浮点程序分析、贝叶斯程序分析)没有直接关系;其方法不涉及 LLM/Agent,也不是面向机器学习系统或 Agentic 程序的静态分析。引用 17 inbox
Jonáš Fiala, Shachar Itzhaky, Peter Müller, Nadia Polikarpova, Ilya Sergey
crossref: 2026-09-10

AI 速览

一句话:提出首个面向安全 Rust 的按构造正确程序合成方法,用 Synthetic Ownership Logic 将类型约束与功能规约结合。

Rust 类型系统虽保证内存安全与无数据竞争,但其严格规则使许多惯用实现模式需大幅改写,增加手工编程负担。本文指出自动合成反而可受益于 Rust 类型:类型可推断数据结构形状、别名与效果,从而简化规约;类型约束还能缩小搜索空间。作者提出首个在 safe Rust 中自动合成构造正确程序的方法,核心是 Synthetic Ownership Logic,一种保证程序同时满足用户功能规约与 Rust 类型系统的新型程序逻辑,并实现工具 RusSOL。评估表明 RusSOL 在标注负担与性能上均有效,能为 Rust 新手常见问题合成可证明正确的解。

问题
Rust 类型规则使手工编程复杂,传统合成器又需冗长注解来描述数据结构、别名和副作用;如何自动合成 safe Rust 中既满足功能规约又通过类型检查的程序?
方法
提出 Synthetic Ownership Logic,将 Rust 所有权与类型约束编码为程序逻辑,用于按构造推导满足功能规约和类型系统的程序,并实现工具 RusSOL。
评估
在 Rust 新手常见编程问题上评估 RusSOL,考察规约标注负担和合成性能,并验证生成程序可证明正确。
原文摘要(Abstract)

The Rust type system guarantees memory safety and data-race freedom. However, to satisfy Rust's type rules, many familiar implementation patterns must be adapted substantially. These necessary adaptations complicate programming and might hinder language adoption. In this paper, we demonstrate that, in contrast to manual programming, automatic synthesis is not complicated by Rust's type system, but rather benefits in two major ways. First, a Rust synthesizer can get away with significantly simpler specifications. While in more traditional imperative languages, synthesizers often require lengthy annotations in a complex logic to describe the shape of data structures, aliasing, and potential side effects, in Rust, all this information can be inferred from the types, letting the user focus on specifying functional properties using a slight extension of Rust expressions. Second, the Rust type system reduces the search space for synthesis, which improves performance. In this work, we present the first approach to automatically synthesizing correct-by-construction programs in safe Rust. The key ingredient of our synthesis procedure is Synthetic Ownership Logic, a new program logic for deriving programs that are guaranteed to satisfy both a user-provided functional specification and, importantly, Rust's intricate type system. We implement this logic in a new tool called RusSOL. Our evaluation shows the effectiveness of RusSOL, both in terms of annotation burden and performance, in synthesizing provably correct solutions to common problems faced by new Rust developers.

链接与引用

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

BibTeX
@article{paperbot2001,
  title = {Leveraging Rust Types for Program Synthesis},
  author = {Jonáš Fiala and Shachar Itzhaky and Peter Müller and Nadia Polikarpova and Ilya Sergey},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591278}
}