Skip to content

Verifying Probabilistic Programs in Rust

Jul 2026 · arXiv.org · Vol abs/2607.12282 · 0 citations · 52 references
Computer Science

TL;DR

Alerus is a framework for verifying probabilistic Rust programs based on Verus, a verification tool for Rust that supports SMT-based automation and separation-logic-inspired reasoning features and extends Verus with support for probabilistic reasoning while retaining these expressive features.

Abstract

Recent work has developed many techniques for formally verifying probabilistic programs. However, existing verification frameworks for probabilistic programs are restricted to idealized languages designed for verification. As a result, they cannot be used to verify off-the-shelf probabilistic programs written in standard languages. In contrast, for non-probabilistic programs, a number of verification tools now support verifying realistic code written in widely used languages such as Go, C, and Rust. To verify probabilistic programs written in these languages, it would be useful to be able to reuse, as much as possible, the extensive development work that has gone into such tools. This paper presents Alerus, a framework for verifying probabilistic Rust programs. Alerus is based on Verus, a verification tool for Rust that supports SMT-based automation and separation-logic-inspired reasoning features. Alerus extends Verus with support for probabilistic reasoning while retaining these expressive features. To do so, Alerus uses a lightweight encoding of probabilistic error credits, a form of ghost state for randomized reasoning introduced in the Eris program logic. By deriving an appropriate specification using error credits, Alerus supports verifying the correctness of randomized sampling algorithms. We use this technique to verify several sampling routines for discrete distributions, including samplers for the discrete Gaussian distributions, the alias method, and the fast loaded dice roller. We establish the soundness of our error credit extension by adapting VerusBelt, a recently developed logical relations model of Verus that encodes its features in terms of the Iris separation logic. To do so, we replace the use of Iris's standard weakest precondition in this model with Eris's probabilistic weakest precondition instead. The resulting soundness proof is fully mechanized in Rocq.

View source

Similar papers

2026

Securing the Foundations of an Intermediate Language for Probabilistic Program Verification

This paper develops mechanized foundations for writing formal correctness proofs for both HeyVL encodings and PP verification techniques that are grounded in the basics of probability theory and formalizes Markov decision processes (MDPs).

Oliver Bøving, Christoph Matheja · 0 citations
Open access Oct 2026

Bringing Foundational Verification to Real-World Rust Code

Rust is a modern systems programming language that, thanks to its strong memory safety guarantees, is well-suited to the domain of safety-critical systems. Since memory safety alone is not ultimately enough for safety-critical systems, there have emerged in recent years a number of tools for deductive verification of f...

Lennard Gäher, Vincent Lafeychine, Sascha Kehrli et al. · 0 citations
Review Aug 2026

Combining Tests and Proofs with Contracts for Better Software Verification

Test or prove? These two approaches to software verification have long been presented as opposites. One is dynamic, the other static: A test executes the program, a proof only analyzes the program text. A different perspective is emerging, in which testing and proving are complementary rather than competing techniques...

Li Huang, Bertrand Meyer, M. Oriol · 0 citations
Preprint Aug 2026

Synchronous Observers Revisited for Runtime Verification of Lustre Using STL

Signal Temporal Logic (STL) is a popular formalism for the temporal safety properties of cyber-physical systems, most often used for runtime verification. In the synchronous family of languages, safety properties are instead expressed as synchronous observers, modules composed with a program for static verification, wh...

Logan Kenwright, Partha S. Roop, Sobhan Chatterjee et al. · 0 citations
#software testing Book Open access Sep 2026

All Your Assembly Belongs to Rust: Automated Lifting for Uniform Testing and Verification

This paper translates Rust code containing RISC-V inline assembly into pure Rust code by emulating each instruction using a machine model extracted from the official RISC-V Sail ISA specification, and demonstrates how each category is handled by the translation.

Charly Castes, Gurvan Debaussart, Thomas Bourgeat · 0 citations

SymCert: Verifying SMT-Based Policy Analyses

SymCert is presented, a framework implemented in Lean for building verified SMT-based analyses of Cedar policies that provide a verified symbolic compiler and authorizer for reducing policies to SMT formulas, a hierarchy enforcer for ensuring well-formedness of counterexamples, and a counterex-ample extractor for provi...

Emina Torlak · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.