Reference. Modular Verification of Differential Privacy in Probabilistic Higher-Order Separation Logic
Differential privacy is the standard method for privacy-preserving data analysis. The importance of having strong guarantees on the reliability of implementations of differentially private algorithms is widely recognized and has sparked fruitful research on formal methods. However, the design patterns and language features used in modern DP libraries as well as the classes of guarantees that the library designers wish to establish often fall outside of the scope of previous verification approaches. We introduce a program logic suitable for verifying differentially private implementations written in complex, general-purpose programming languages. Our logic has first-class support for reasoning about privacy budgets as a separation logic resource. The expressiveness of the logic and the target language allow our approach to handle common programming patterns used in the implementation of libraries for differential privacy, such as privacy filters and caching. While previous work has focused on developing guarantees for programs written in domain-specific languages or for privacy mechanisms in isolation, our logic can reason modularly about primitives, higher-order combinators, and interactive algorithms. We demonstrate the applicability of our approach by implementing a verified library of differential privacy mechanisms, including an online version of the Sparse Vector Technique, as well as a privacy filter inspired by the popular Python library OpenDP, which crucially relies on our ability to handle the combination of randomization, local state, and higher-order functions. We demonstrate that our specifications are general and reusable by instantiating them to verify clients of our library. All of our results have been foundationally verified in the Rocq Prover.
Cite
Cites 51 works (5 here)
With notes (5)
Verified Foundations for Differential Privacy demedeiros-2025-verified
Differential privacy (DP) has become the gold standard for privacy-preserving data analysis, but implementing it correctly has proven challenging. Prior work has focused on verifying DP at a high level, assuming either that the foundations are correct or that a perfect source of random noise is available. However, the underlying theory of differential privacy can be very complex and subtle. Flaws in basic mechanisms and random number generation have been a critical source of vulnerabilities in real-world DP systems. In this paper, we present SampCert, the first comprehensive, mechanized foundation for executable implementations of differential privacy. SampCert is written in Lean with over 12,000 lines of proof. It offers a generic and extensible notion of DP, a framework for constructing and composing DP mechanisms, and formally verified implementations of Laplace and Gaussian sampling algorithms. SampCert provides (1) a mechanized foundation for developing the next generation of differentially private algorithms, and (2) mechanically verified primitives that can be deployed in production systems. Indeed, SampCert’s verified algorithms power the DP offerings of Amazon Web Services, demonstrating its real-world impact. SampCert’s key innovations include: (1) A generic DP foundation that can be instantiated for various DP definitions (e.g., pure, concentrated, Rényi DP); (2) formally verified discrete Laplace and Gaussian sampling algorithms that avoid the pitfalls of floating-point implementations; and (3) a simple probability monad and novel proof techniques that streamline the formalization. To enable proving complex correctness properties of DP and random number generation, SampCert makes heavy use of Lean’s extensive Mathlib library, leveraging theorems in Fourier analysis, measure and probability theory, number theory, and topology.
Tachis: Higher-Order Separation Logic with Credits for Expected Costs haselwarter-2024-tachis
We present Tachis, a higher-order separation logic to reason about the expected cost of probabilistic programs. Inspired by the uses of time credits for reasoning about the running time of deterministic programs, we introduce a novel notion of probabilistic cost credit. Probabilistic cost credits are a separation logic resource that can be used to pay for the cost of operations in programs, and that can be distributed across all possible branches of sampling instructions according to their weight, thus enabling us to reason about expected cost. The representation of cost credits as separation logic resources gives Tachis a great deal of flexibility and expressivity. In particular, it permits reasoning about amortized expected cost by storing excess credits as potential into data structures to pay for future operations. Tachis further supports a range of cost models, including running time and entropy usage. We showcase the versatility of this approach by applying our techniques to prove upper bounds on the expected cost of a variety of probabilistic algorithms and data structures, including randomized quicksort, hash tables, and meldable heaps. All of our results have been mechanized using Coq, Iris, and the Coquelicot real analysis library.
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.
ReLoC Reloaded: A Mechanized Relational Logic for Fine-Grained Concurrency and Logical Atomicity frumin_krebbers_birkedal_reloc_2021
We present a new version of ReLoC: a relational separation logic for proving refinements of programs with higher-order state, fine-grained concurrency, polymorphism and recursive types. The core of ReLoC is its refinement judgment , which states that a program refines a program at type . ReLoC provides type-directed structural rules and symbolic execution rules in separation-logic style for manipulating the judgment, whereas in prior work on refinements for languages with higher-order state and concurrency, such proofs were carried out by unfolding the judgment into its definition in the model. ReLoC’s abstract proof rules make it simpler to carry out refinement proofs, and enable us to generalize the notion of logically atomic specifications to the relational case, which we call logically atomic relational specifications. We build ReLoC on top of the Iris framework for separation logic in Coq, allowing us to leverage features of Iris to prove soundness of ReLoC, and to carry out refinement proofs in ReLoC. We implement tactics for interactive proofs in ReLoC, allowing us to mechanize several case studies in Coq, and thereby demonstrate the practicality of ReLoC. ReLoC Reloaded extends ReLoC (LICS’18) with various technical improvements, a new Coq mechanization, and support for Iris’s prophecy variables. The latter allows us to carry out refinement proofs that involve reasoning about the program’s future. We also expand ReLoC’s notion of logically atomic relational specifications with a new flavor based on the HOCAP pattern by Svendsen et al.
Iris from the ground up: A modular foundation for higher-order concurrent separation logic jung_etal_iris_ground_up_2018
Iris is a framework for higher-order concurrent separation logic, which has been implemented in the Coq proof assistant and deployed very effectively in a wide variety of verification projects. Iris was designed with the express goal of simplifying and consolidating the foundations of modern separation logics, but it has evolved over time, and the design and semantic foundations of Iris itself have yet to be fully written down and explained together properly in one place. Here, we attempt to fill this gap, presenting a reasonably complete picture of the latest version of Iris (version 3.1), from first principles and in one coherent narrative.
External (46)
- Modular Verification of Differential Privacy in Probabilistic Higher-Order Separation Logic - Artifact (2026)
- Bluebell: An Alliance of Relational Lifting and Independence for Probabilistic Reasoning (2025)
- Approximate Relational Reasoning for Higher-Order Probabilistic Programs (2025)
- Sound and Complete Proof Rules for Probabilistic Termination (2025)
- Formalization of Differential Privacy in Isabelle/HOL (2025)
- Hands-on Differential Privacy: Introduction to the Theory and Practice Using OpenDP (first edition ed.) (2024)
- Almost-Sure Termination by Guarded Refinement (2024)
- Asynchronous Probabilistic Couplings in Higher-Order Separation Logic (2024)
- Sensitivity by Parametricity (2024)
- An Iris for Expected Cost Analysis (2024)
- Turbo: Effective Caching in Differentially-Private Databases (2023)
- Contextual Linear Types for Differential Privacy (2023)
- Solo: a lightweight static analysis for differential privacy (2022)
- Cache Me If You Can: Accuracy-Aware Inference Engine for Differentially Private Data Exploration (2022)
- Higher-order probabilistic adversarial computations: categorical semantics and program logics (2021)
- Programming Differential Privacy (2021)
- The Discrete Gaussian for Differential Privacy (2020)
- Termination Analysis of Probabilistic Programs with Martingales (2020)
- A Programming Framework for Differential Privacy with Accuracy Concentration Bounds (2020)
- PrivateSQL: A Differentially Private SQL Query Engine (2019)
- Duet: an expressive higher-order language and linear type system for statically enforcing differential privacy (2019)
- Approximate Span Liftings: Compositional Semantics for Relaxations of Differential Privacy (2019)
- Fuzzi: a three-level logic for differential privacy (2019)
- Probabilistic Relational Reasoning via Metrics (2019)
- Privacy amplification by subsampling: tight analyses via couplings and divergences (2018)
- Synthesizing coupling proofs of differential privacy (2017)
- Probabilistic Couplings for Probabilistic Reasoning (2017)
- Understanding the Sparse Vector Technique for Differential Privacy (2017)
- A framework for adaptive differential privacy (2017)
- LightDP: towards automating differential privacy proofs (2017)
- Deep Learning with Differential Privacy (2016)
- Advanced Probabilistic Couplings for Differential Privacy (2016)
- Proving Differential Privacy via Probabilistic Couplings (2016)
- Approximate Relational Hoare Logic for Continuous Random Samplings (2016)
- Privacy Odometers and Filters: Pay-as-you-Go Composition (2016)
- Relational Reasoning via Probabilistic Coupling (2015)
- Higher-Order Approximate Relational Refinement Types for Mechanism Design and Differential Privacy (2015)
- The Algorithmic Foundations of Differential Privacy (2014)
- Linear dependent types for differential privacy (2013)
- Query optimization for differentially private data management systems (2013)
- Probabilistic relational reasoning for differential privacy (2012)
- Universally Utility-maximizing Privacy Mechanisms (2012)
- On significance of the least significant bits for differential privacy (2012)
- Distance makes the types grow stronger: a calculus for differential privacy (2010)
- Calibrating Noise to Sensitivity in Private Data Analysis (2006)
- A discrete analogue of the Laplace distribution (2006)