Verifying Exact Samplers for Continuous Distributions with a Discrete Program Logic
Markus de Medeiros, Puming Liu, Kwing Hei Li, Alejandro Aguirre, Lars Birkedal, Joseph Tassarotti
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on14
- Semantics of higher-order probabilistic programs with conditioningFredrik Dahlqvist, Dexter KozenPOPL 2020 · 35 citations
- Asynchronous Probabilistic Couplings in Higher-Order Separation LogicSimon Oddershede Gregersen, Alejandro Aguirre, Philipp G. Haselwarter, Joseph Tassarotti et al.POPL 2024 · 23 citations
- Lilac: A Modal Separation Logic for Conditional ProbabilityJohn M. Li, Amal Ahmed, Steven HoltzenPLDI 2023 · 22 citations
- Guaranteed bounds for posterior inference in universal probabilistic programmingRaven Beutner, C.-H. Luke Ong, Fabian ZaiserPLDI 2022 · 18 citations
- Towards an API for the real numbersHans-Juergen BoehmPLDI 2020 · 12 citations
Related papers
- Approximate Algorithms for Verifying Differential Privacy with Gaussian DistributionsBishnu Bhusal, Rohit Chadha, A. Prasad Sistla, Mahesh ViswanathanCCS 2025
- Deterministic stream-sampling for probabilistic programming: semantics and verificationFredrik Dahlqvist, Alexandra Silva, William SmithLICS 2023 · 4 citations
- Verified Foundations for Differential PrivacyMarkus de Medeiros, Muhammad Naveed, Tancrède Lepoint, Temesghen Kahsai et al.PLDI 2025 · 7 citations
- The Discrete Gaussian for Differential PrivacyClément L. Canonne, Gautam Kamath, Thomas SteinkeNeurIPS 2020 · 355 citations
- Infinitary Relational LogicVladimir Gladshtein, Qiyuan Zhao, Yuxi Ling, Sean Wang et al.OOPSLA 2026
