🤖 AI Summary
Discrete probabilistic sampling algorithms lack formal verification frameworks. Method: This paper proposes the first verification methodology based on *distributional loop invariants*: probabilistic programs are modeled as distribution transformers, and a Hoare-style logic is developed to support both total and partial correctness proofs. Contribution/Results: The key innovation is the systematic introduction of *distributional loop invariants*, enabling precise characterization and inductive reasoning about the evolution of output distributions during program execution. The framework unifies probabilistic program semantics, invariant inference, and formal verification techniques. Experimentally, it successfully verifies the correctness of two classic algorithms—Fast Dice Roller and Fast Loaded Dice Roller—demonstrating strong expressive power and practical applicability. This work establishes a novel paradigm for formal verification of probabilistic programs.
📝 Abstract
This paper develops a verification framework aimed at establishing the correctness of discrete sampling algorithms. We do so by considering probabilistic programs as distribution transformers. Inspired by recent work on distributional verification of Markov models, we introduce the notion of (inductive) distributional loop invariants for discrete probabilistic programs. These invariants are embedded in a Hoare-like verification framework that includes proof rules for total and partial correctness. To illustrate the applicability of our framework, we prove the correctness of two discrete sampling algorithms: the Fast Dice Roller and the Fast Loaded Dice Roller.