[Paper Review] A program logic for union bounds
This paper introduces aHL, a lightweight probabilistic Hoare logic based on the union bound for verifying accuracy in probabilistic programs, especially differential privacy mechanisms. By expressing failure events as non-probabilistic assertions and tracking cumulative failure probability via a numeric index, aHL enables compositional, modular verification of both non-interactive and interactive algorithms with precise accuracy bounds.
We propose a probabilistic Hoare logic aHL based on the union bound, a tool from basic probability theory. While the union bound is simple, it is an extremely common tool for analyzing randomized algorithms. In formal verification terms, the union bound allows flexible and compositional reasoning over possible ways an algorithm may go wrong. It also enables a clean separation between reasoning about probabilities and reasoning about events, which are expressed as standard first-order formulas in our logic. Notably, assertions in our logic are non-probabilistic, even though we can conclude probabilistic facts from the judgments. Our logic can also prove accuracy properties for interactive programs, where the program must produce intermediate outputs as soon as pieces of the input arrive, rather than accessing the entire input at once. This setting also enables adaptivity, where later inputs may depend on earlier intermediate outputs. We show how to prove accuracy for several examples from the differential privacy literature, both interactive and non-interactive.
Motivation & Objective
- To address the challenge of verifying accuracy in probabilistic programs, particularly in differential privacy, where traditional formal methods often require complex probabilistic reasoning.
- To develop a lightweight Hoare logic that uses non-probabilistic assertions while still enabling reasoning about probabilistic outcomes through the union bound.
- To support both non-interactive and interactive programs, including adaptive and streaming-style algorithms, where outputs are produced incrementally as input arrives.
- To provide a clean separation between event specification (as first-order formulas) and probability reasoning, enhancing modularity and reusability in verification.
- To demonstrate the logic's effectiveness by verifying accuracy properties of concrete differential privacy mechanisms, both interactive and non-interactive.
Proposed method
- The logic aHL uses judgments of the form ⊢β c : Φ ⟹ Ψ, where β tracks the maximum allowed failure probability for program c to satisfy postcondition Ψ starting from precondition Φ.
- Events representing potential failures are expressed as standard first-order assertions (e.g., x > 10), avoiding direct probabilistic assertions in the logic.
- The union bound is formally encoded: if each of n failure events has probability ≤ βi, then the total failure probability is ≤ ∑βi, enabling compositional reasoning.
- A sound embedding into standard Hoare logic is defined by instrumenting programs with ghost code that maintains the β index as a variable, enabling integration with existing verification tools.
- The logic is applied to verify accuracy of Laplace mechanism and other differentially private algorithms, both in non-interactive and interactive settings.
- The approach supports adaptive inputs, where later inputs may depend on earlier outputs, by treating each interaction step as a separate verification task.
Experimental results
Research questions
- RQ1Can a lightweight Hoare logic based on the union bound enable modular and compositional verification of probabilistic program accuracy?
- RQ2How can non-probabilistic assertions be used to reason about probabilistic outcomes in a way that supports both non-interactive and interactive program structures?
- RQ3Can the logic handle adaptive and streaming-style programs where outputs are produced incrementally as input arrives?
- RQ4Is the union bound sufficient to verify accuracy in differential privacy mechanisms, including those with interactive and adaptive behavior?
- RQ5Can the logic be embedded into standard Hoare logic via ghost code, enabling reuse of existing verification infrastructure?
Key findings
- The logic aHL successfully verifies accuracy of the Laplace mechanism with failure probability bounded by β, using a union bound over individual noise components.
- For the OMW (Oblivious Multiplicative Weighting) algorithm, the paper proves that accuracy holds except with probability at most β by combining bounds for sampling and Laplace noise using the union bound.
- The logic supports interactive and adaptive programs, enabling modular verification of components that produce intermediate outputs upon input arrival.
- The authors demonstrate the first formal verification of accuracy for both non-interactive and interactive differentially private algorithms using a non-relational logic.
- The sound embedding of aHL into standard Hoare logic via ghost code enables compatibility with existing verification tools and frameworks.
- The approach achieves a balance between expressivity and simplicity, avoiding complex probabilistic reasoning while remaining effective for common probabilistic reasoning patterns like the union bound.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.