Verifying Exact Samplers for Continuous Distributions with a Discrete Program Logic

📅 2026-05-13
📈 Citations: 0
Influential: 0
📄 PDF

career value

200K/year
🤖 AI Summary
Rounding errors in floating-point sampling can compromise the correctness and security of continuous distribution samplers, posing significant risks in highly sensitive contexts such as differential privacy. This work proposes Continuous-Eris, a formal verification framework based on higher-order separation logic that, for the first time, supports mechanized verification of exact sampling programs featuring probabilistic choice, higher-order functions, and dynamic state. Built upon computable real numbers and incorporating lazy arbitrary-precision sample generation, the framework is implemented in the Rocq proof assistant. Using Continuous-Eris, we have successfully verified the correctness of exact samplers for uniform, Gaussian, and Laplace distributions, along with their underlying real-number arithmetic libraries, thereby guaranteeing mathematically precise sampling semantics.
📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

exact sampling
continuous distributions
program verification
computable reals
probabilistic algorithms
Innovation

Methods, ideas, or system contributions that make the work stand out.

exact sampling
computable reals
program verification
separation logic
differential privacy
🔎 Similar Papers
No similar papers found.