Reference. Verus: Verifying Rust Programs using Linear Ghost Types
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.
Cite
Cited by (8)
Place Capability Graphs: A General-Purpose Model of Rust’s Ownership and Borrowing Guarantees grannan-2025-place
Rust’s novel type system has proved an attractive target for verification and program analysis tools, due to the rich guarantees it provides for controlling aliasing and mutability. However, fully understanding, extracting and exploiting these guarantees is subtle and challenging: existing models for Rust’s type checking either support a smaller idealised language disconnected from real-world Rust code, or come with severe limitations in terms of precise modelling of Rust borrows, composite types storing them, function signatures and loops. In this paper, we present Place Capability Graphs : a novel model of Rust’s type-checking results, which lifts these limitations, and which can be directly calculated from the Rust compiler’s own programmatic representations and analyses. We demonstrate that our model supports over 97% of Rust functions in the most popular public crates, and show its suitability as a general-purpose basis for verification and program analysis tools by developing promising new prototype versions of the existing Flowistry and Prusti tools.
Formally Verified Cloud-Scale Authorization chakarov-2025-formally
Substructural Parametricity aberle-2025-substructural
Ordered, linear, and other substructural type systems allow us to expose deep properties of programs at the syntactic level of types. In this paper, we develop a family of unary logical relations that allow us to prove consequences of parametricity for a range of substructural type systems. A key idea is to parameterize the relation by an algebra, which we exemplify with a monoid and commutative monoid to interpret ordered and linear type systems, respectively. We prove the fundamental theorem of logical relations and apply it to deduce extensional properties of inhabitants of certain types. Examples include demonstrating that the ordered types for list append and reversal are inhabited by exactly one function, as are types of some tree traversals. Similarly, the linear type of the identity function on lists is inhabited only by permutations of the input. Our most advanced example shows that the ordered type of the list fold function is inhabited only by the fold function.
Cazamariposas: Automated Instability Debugging in SMT-Based Program Verification zhou-2025-cazamariposas
Program verification languages such as Dafny and F often rely heavily on Satisfiability Modulo Theories (SMT) solvers for proof automation. However, SMT-based verification suffers from instability, where semantically irrelevant changes in the source program can cause spurious proof failures. While existing mitigation techniques emphasize preemptive measures, we propose a complementary approach that focuses on diagnosing and repairing specific instances of instability-induced failures. Our key technique is a novel differential analysis to pinpoint problematic quantified formulas in an unstable query. We implement this technique in Cazamariposas, a tool that automatically identifies such quantified formulas and suggests fixes. We evaluate Cazamariposas on multiple large-scale systems verification projects written in three different program verification languages. Our results demonstrate Cazamariposas’ effectiveness as an instability debugger. In the majority of cases, Cazamariposas successfully isolates the issue to a single problematic quantifier, while providing a stabilizing fix.
AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinement aggarwal-2024-alphaverus
Automated code generation with large language models has gained significant traction, but there remains no guarantee on the correctness of generated code. We aim to use formal verification to provide mathematical guarantees that the generated code is correct. However, generating formally verified code with LLMs is hindered by the scarcity of training data and the complexity of formal proofs. To tackle this challenge, we introduce AlphaVerus, a self-improving framework that bootstraps formally verified code generation by iteratively translating programs from a higher-resource language and leveraging feedback from a verifier. AlphaVerus operates in three phases: exploration of candidate translations, Treefinement – a novel tree search algorithm for program refinement using verifier feedback, and filtering misaligned specifications and programs to prevent reward hacking. Through this iterative process, AlphaVerus enables a LLaMA-3.1-70B model to generate verified code without human intervention or model finetuning. AlphaVerus shows an ability to generate formally verified solutions for HumanEval and MBPP, laying the groundwork for truly trustworthy code-generation agents.
Verus: A Practical Foundation for Systems Verification lattuada-2024-verus
FlowCert: Translation Validation for Asynchronous Dataflow via Dynamic Fractional Permissions lin-2024-flowcert
Coarse-grained reconfigurable arrays (CGRAs) have gained attention in recent years due to their promising power efficiency compared to traditional von Neumann architectures. To program these architectures using ordinary languages such as C, a dataflow compiler must transform the original sequential, imperative program into an equivalent dataflow graph, composed of dataflow operators running in parallel. This transformation is challenging since the asynchronous nature of dataflow graphs allows out-of-order execution of operators, leading to behaviors not present in the original imperative programs. Weaddress this challenge by developing a translation validation technique for dataflow compilers to ensure that the dataflow program has the same behavior as the original imperative program on all possible inputs and schedules of execution. We apply this method to a state-of-the-art dataflow compiler targeting the RipTide CGRAarchitecture. Our tool uncovers 8 compiler bugs where the compiler outputs incorrect dataflow graphs, including a data race that is otherwise hard to discover via testing. After repairing these bugs, our tool verifies the correct compilation of all programs in the RipTide benchmark suite.
A Framework for Debugging Automated Program Verification Proofs via Proof Actions cho-2024-a
Many program verification tools provide automation via SMT solvers, allowing them to automatically discharge many proofs. However, when a proof fails, it can be hard to understand why it failed or how to fix it. The main feedback the developer receives is simply the verification result (i.e., success or failure), with no visibility into the solver’s internal state. To assist developers using such tools, we introduce ProofPlumber, a novel and extensible proof-action framework for understanding and debugging proof failures. Proof actions act on the developer’s source-level proofs (e.g., assertions and lemmas) to determine why they failed and potentially suggest remedies. We evaluate ProofPlumber by writing a collection of proof actions that capture common proof debugging practices. We produce 17 proof actions, each only 29–177 lines of code.
Cites 48 works (2 here)
With notes (2)
Iris from the ground up: A modular foundation for higher-order concurrent separation logic jung_etal_iris_ground_up_2018
Iris is a framework for higher-order concurrent separation logic, which has been implemented in the Coq proof assistant and deployed very effectively in a wide variety of verification projects. Iris was designed with the express goal of simplifying and consolidating the foundations of modern separation logics, but it has evolved over time, and the design and semantic foundations of Iris itself have yet to be fully written down and explained together properly in one place. Here, we attempt to fill this gap, presenting a reasonably complete picture of the latest version of Iris (version 3.1), from first principles and in one coherent narrative.
Separation logic: A logic for shared mutable data structures reynolds_separation_2002
In joint work with Peter O’Hearn and others, based on early ideas of Burstall, we have developed an extension of Hoare logic that permits reasoning about low-level imperative programs that use shared mutable data structure. The simple imperative programming language is extended with commands (not expressions) for accessing and modifying shared structures, and for explicit allocation and deallocation of storage. Assertions are extended by introducing a “separating conjunction” that asserts that its subformulas hold for disjoint parts of the heap, and a closely related “separating implication”. Coupled with the inductive definition of predicates on abstract data structures, this extension permits the concise and flexible description of structures with controlled sharing. In this paper, we survey the current development of this program logic, including extensions that permit unrestricted address arithmetic, dynamically allocated arrays, and recursive procedures. We also discuss promising future directions.
External (46)
- Verus: Verifying Rust Programs using Linear Ghost Types – Artifact (2023)
- Verus: Verifying Rust Programs using Linear Ghost Types – Supplementary Material (2023)
- The Prusti Project: Formal Verification for Rust (2022)
- Creusot: A Foundry for the Deductive Verification of Rust Programs (2022)
- Aeneas: Rust verification by functional translation (2022)
- Linear types for large-scale systems verification (2022)
- RustHornBelt: a semantic foundation for functional verification of Rust programs with unsafe code (2022)
- Linus Torvalds: Rust will go into Linux (2022)
- The Coq Proof Assistant (2022)
- RustHornBelt: A Semantic Foundation for Functional Verification of Rust Programs With Unsafe Code (2022)
- Steel: proof-oriented programming in a dependently typed concurrent separation logic (2021)
- A Lightweight Formalism for Reference Lifetimes and Borrowing in Rust (2021)
- GhostCell: separating permissions from data in Rust (2021)
- Rust in the Android platform (Google Security Blog) (2021)
- RustHorn: CHC-Based Verification for Rust Programs (2020)
- Dafny issue 851: unsoundness: dafny seems to assume tuple and inductive datatypes are inhabited (2020)
- Leveraging rust types for modular specification and verification (2019)
- RustBelt meets relaxed memory (2019)
- Stacked borrows: an aliasing model for Rust (2019)
- Oxide: The Essence of Rust (2019)
- RustBelt: securing the foundations of the rust programming language (2017)
- Cogent: Verifying High-Assurance File System Implementations (2016)
- Dependent types and multi-monadic effects in F* (2016)
- Viper: A Verification Infrastructure for Permission-Based Reasoning (2015)
- The Lean Theorem Prover (System Description) (2015)
- The rust language (2014)
- VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java (2011)
- Why3: Shepherd Your Herd of Provers (2011)
- VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java (2011)
- Dafny: An Automatic Program Verifier for Functional Correctness (2010)
- Conference: Tools and Algorithms for the Construction and Analysis of Systems, 16th International Conference, TACAS (2010)
- The SMT-LIB Standard: Version 2.0 (2010)
- Z3: An Efficient SMT Solver (2008)
- Z3: An Efficient SMT Solver (2008)
- Efficient E-Matching for SMT Solvers (2007)
- Resources, concurrency, and local reasoning (2007)
- Boogie: A Modular Reusable Verifier for Object-Oriented Programs (2005)
- L3: A Linear Language with Locations (2005)
- Safe Programming with Pointers Through Stateful Views (2005)
- Alias Types (2000)
- Typed memory management in a calculus of capabilities (1999)
- On the frame problem in procedure specifications (1995)
- Linear Types can Change the World! (1990)
- Guarded commands, nondeterminacy and formal derivation of programs (1975)
- Sharding the State Machine: Automated Modular Reasoning for Complex Concurrent Systems. CyLab
- The Rust Programming Language