Affiliation:
1. ETH Zurich, Switzerland
2. Technion, Israel
3. University of California at San Diego, USA
4. National University of Singapore, Singapore
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.
Funder
National Science Foundation
Singapore Ministry of Education
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference28 articles.
1. The existence of refinement mappings
2. Leveraging rust types for modular specification and verification
3. Aria Beingessner. 2015. Learning Rust With Entirely Too Many Linked Lists. https://rust-unofficial.github.io/too-many-lists/ Aria Beingessner. 2015. Learning Rust With Entirely Too Many Linked Lists. https://rust-unofficial.github.io/too-many-lists/
4. Fractional Permissions
5. Concise Read-Only Specifications for Better Synthesis of Programs with Pointers
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Term Search in Rust;Proceedings of the 9th ACM SIGPLAN International Workshop on Type-Driven Development;2024-08-28
2. Survey of annotation generators for deductive verifiers;Journal of Systems and Software;2024-05
3. RPG: Rust Library Fuzzing with Pool-based Fuzz Target Generation and Generic Support;Proceedings of the IEEE/ACM 46th International Conference on Software Engineering;2024-04-12
4. Program Synthesis from Graded Types;Lecture Notes in Computer Science;2024