Aeneas: Rust Verification by Functional Translation

06/14/2022
by   Son Ho, et al.
0

We present Aeneas, a new verification toolchain for Rust programs based on a lightweight functional translation. We leverage Rust's rich region-based type system to eliminate memory reasoning for many Rust programs, as long as they do not rely on interior mutability or unsafe code. Doing so, we relieve the proof engineer of the burden of memory-based reasoning, allowing them to instead focus on functional properties of their code. Our first contribution is a new approach to borrows and controlled aliasing. We propose a pure, functional semantics for LLBC, a Low-Level Borrow Calculus that captures a large subset of Rust programs. Our semantics is value-based, meaning there is no notion of memory, addresses or pointer arithmetic. Our semantics is also ownership-centric, meaning that we enforce soundness of borrows via a semantic criterion based on loans rather than through a syntactic type-based lifetime discipline. We claim that our semantics captures the essence of the borrow mechanism rather than its current implementation in the Rust compiler. Our second contribution is a translation from LLBC to a pure lambda-calculus. This allows the user to reason about the original Rust program through the theorem prover of their choice. To deal with the well-known technical difficulty of terminating a borrow, we rely on a novel approach, in which we approximate the borrow graph in the presence of function calls. This in turn allows us to perform the translation using a new technical device called backward functions. We implement our toolchain in a mixture of Rust and OCaml. Our evaluation shows significant gains of verification productivity for the programmer. Rust goes to great lengths to enforce static control of aliasing; the proof engineer should not waste any time on memory reasoning when so much already comes "for free"!

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/04/2023

Lifting the Reasoning Level in Generic Weak Memory Verification (Extended Version)

Weak memory models specify the semantics of concurrent programs on multi...
research
11/22/2018

Verifying C11 Programs Operationally

This paper develops an operational semantics for a release-acquire fragm...
research
05/14/2018

Structural Operational Semantics for Control Flow Graph Machines

Compilers use control flow graph (CFG) representations of low-level prog...
research
06/24/2019

Automatic verification of heap-manipulating programs

Theoretical foundations of compositional reasoning about heaps in impera...
research
05/18/2022

An approach to translating Haskell programs to Agda and reasoning about them

We are using the Agda programming language and proof assistant to formal...
research
10/25/2019

Pointer Life Cycle Types for Lock-Free Data Structures with Memory Reclamation

We consider the verification of lock-free data structures that manually ...
research
04/23/2019

A Syntactic Model of Mutation and Aliasing

Traditionally, semantic models of imperative languages use an auxiliary ...

Please sign up or login with your details

Forgot password? Click here to reset