Reference. Modular Specifications and Implementations of Random Samplers in Higher-Order Separation Logic
Cite
Cited by (1)
Verifying Exact Samplers for Continuous Distributions with a Discrete Program Logic demedeiros-2026-verifying
Most implementations of sampling algorithms for continuous distributions use floating-point numbers, which introduce round-off errors and approximations. These errors can be difficult to analyze, and can cause security issues when used in algorithms for differential privacy. An alternative is to use exact sampling algorithms based on computable reals, which can lazily generate the digits of a continuous sample to arbitrary precision. However, these algorithms are intricate, and implementing and using them involves a combination of semantically challenging language features, such as probabilistic choice, higher-order functions, and dynamically-allocated mutable state. In this paper we present Continuous-Eris, a higher-order separation logic for verifying the correctness of exact sampling algorithms for computable distributions. To demonstrate Continuous-Eris, we verify the correctness of computable samplers for the uniform, Gaussian, and Laplace distributions, as well as a library for exact real arithmetic for working with generated samples. All of the results in this paper have been verified in the Rocq proof assistant.
Cites 27 works (4 here)
With notes (4)
Probabilistic Concurrent Reasoning in Outcome Logic: Independence, Conditioning, and Invariants zilberstein-2026-probabilistic
Although randomization has long been used in distributed computing, formal methods for reasoning aboutprobabilistic concurrent programs have lagged behind. No existing program logics can express specificationsabout the full distributions of outcomes resulting from programs that are both probabilistic and concurrent. To address this, we introduce Probabilistic Concurrent Outcome Logic ( pcOL ), which incorporates ideas fromconcurrent and probabilistic separation logics into Outcome Logic to introduce new compositional reasoningprinciples. At its core, pcOL reinterprets the rules of Concurrent Separation Logic in a setting where separationmodels probabilistic independence, so as to compositionally describe joint distributions over variables inconcurrent threads. Reasoning about outcomes also proves crucial, as case analysis is often necessary to deriveprecise information about threads that rely on randomized shared state. We demonstrate pcOL on a variety ofexamples, including to prove almost sure termination of unbounded loops.
Error Credits: Resourceful Reasoning about Error Bounds for Higher-Order Probabilistic Programs aguirre-2024-error
Probabilistic programs often trade accuracy for efficiency, and thus may, with a small probability, return an incorrect result. It is important to obtain precise bounds for the probability of these errors, but existing verification approaches have limitations that lead to error probability bounds that are excessively coarse, or only apply to first-order programs. In this paper we present Eris, a higher-order separation logic for proving error probability bounds for probabilistic programs written in an expressive higher-order language. Our key novelty is the introduction of error credits , a separation logic resource that tracks an upper bound on the probability that a program returns an erroneous result. By representing error bounds as a resource, we recover the benefits of separation logic, including compositionality, modularity, and dependency between errors and program terms, allowing for more precise specifications. Moreover, we enable novel reasoning principles such as expectation-preserving error composition, amortized error reasoning, and error induction. We illustrate the advantages of our approach by proving amortized error bounds on a range of examples, including collision probabilities in hash functions, which allow us to write more modular specifications for data structures that use them as clients. We also use our logic to prove correctness and almost-sure termination of rejection sampling algorithms. All of our results have been mechanized in the Coq proof assistant using the Iris separation logic framework and the Coquelicot real analysis library.
Lilac: A Modal Separation Logic for Conditional Probability li-2023-lilac
We present Lilac, a separation logic for reasoning about probabilistic programs where separating conjunction captures probabilistic independence. Inspired by an analogy with mutable state where sampling corresponds to dynamic allocation, we show how probability spaces over a fixed, ambient sample space appear to be the natural analogue of heap fragments, and present a new combining operation on them such that probability spaces behave like heaps and measurability of random variables behaves like ownership. This combining operation forms the basis for our model of separation, and produces a logic with many pleasant properties. In particular, Lilac has a frame rule identical to the ordinary one, and naturally accommodates advanced features like continuous random variables and reasoning about quantitative properties of programs. Then we propose a new modality based on disintegration theory for reasoning about conditional probability. We show how the resulting modal logic validates examples from prior work, and give a formal verification of an intricate weighted sampling algorithm whose correctness depends crucially on conditional independence structure.
Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning jung-2015-iris
External (23)
- A Quantitative Probabilistic Relational Hoare Logic (2025)
- Artifact for Modular Specifications and Implementations of Random Samplers in Higher-Order Separation Logic (2025)
- The Rocq prover (2025)
- Bluebell: An Alliance of Relational Lifting and Independence for Probabilistic Reasoning (2024)
- Approximate Relational Reasoning for Higher-Order Probabilistic Programs (2024)
- Sound and Complete Proof Rules for Probabilistic Termination (2024)
- Asynchronous Probabilistic Couplings in Higher-Order Separation Logic (2023)
- A Deductive Verification Infrastructure for Probabilistic Programs (2023)
- An Assertion-Based Program Logic for Probabilistic Programs (2018)
- Quantitative separation logic: a logic for reasoning about probabilistic pointer programs (2018)
- The Beta-Bernoulli process and algebraic effects (2018)
- A Program Logic for Union Bounds (2016)
- Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs (2016)
- Relational Reasoning via Probabilistic Coupling (2015)
- Probabilistic Recursion Theory and Implicit Computational Complexity (2014)
- EasyCrypt: A Tutorial (2013)
- Probabilistic Program Analysis with Martingales (2013)
- Probabilistic relational reasoning for differential privacy (2012)
- Monads need not be endofunctors (2010)
- Formal certification of code-based cryptographic proofs (2009)
- Abstraction, refinement and proof for probabilistic systems (2005)
- Randomized Algorithms (1995)
- Probabilistic encryption & how to play mental poker keeping secret all partial information (1982)