[Paper Review] A New Proof Rule for Almost-Sure Termination
This paper introduces a novel proof rule for almost-sure termination (AST) in probabilistic programs with both probabilistic and demonic choice. It extends variant-based reasoning by introducing parametric decrease in real-valued super-martingales, where both the magnitude and probability of decrease are tunable, enabling termination proofs for programs—like the 1D symmetric random walk—beyond the reach of prior rules.
An important question for a probabilistic program is whether the probability mass of all its diverging runs is zero, that is that it terminates "almost surely". Proving that can be hard, and this paper presents a new method for doing so; it is expressed in a program logic, and so applies directly to source code. The programs may contain both probabilistic- and demonic choice, and the probabilistic choices may depend on the current state. As do other researchers, we use variant functions (a.k.a. "super-martingales") that are real-valued and probabilistically might decrease on each loop iteration; but our key innovation is that the amount as well as the probability of the decrease are parametric. We prove the soundness of the new rule, indicate where its applicability goes beyond existing rules, and explain its connection to classical results on denumerable (non-demonic) Markov chains.
Motivation & Objective
- To address the limitation of existing AST rules in proving almost-sure termination for probabilistic programs with diminishing but non-uniform decrease probabilities.
- To develop a proof rule applicable directly at the source-code level in a program logic, avoiding model-level reasoning.
- To extend the applicability of AST rules to programs with demonic non-determinism, such as those with mixed probabilistic and non-deterministic choices.
- To provide a mathematically grounded criterion for AST that connects to classical results on denumerable Markov chains.
- To offer a completeness-like guarantee for certain classes of programs, such as the 2D symmetric random walk, where a variant is provably guaranteed to exist.
Proposed method
- Introduce a new proof rule based on real-valued super-martingales (variant functions) that are allowed to decrease parametrically in both magnitude and probability across program iterations.
- Formalize the rule within the probabilistic guarded command language (pGCL), enabling direct reasoning over source code with probabilistic and demonic choices.
- Define a parametric decrease condition where the expected decrease in the variant is bounded below by a function of the current state, allowing non-uniform and diminishing probabilities of progress.
- Use recursive program constructs and fixed-point semantics to model while loops, ensuring the rule applies to nested and complex control structures.
- Leverage classical results from Markov chain theory—particularly on recurrence and transience in denumerable chains—to justify the soundness and completeness of the rule for specific program classes.
- Provide a syntactic transformation of while loops into recursive expressions to formally verify the correctness of the rule using standard program algebra techniques.
Experimental results
Research questions
- RQ1Can a proof rule be designed that proves almost-sure termination for probabilistic programs where the probability of decrease diminishes over time, such as the 1D symmetric random walk?
- RQ2Is it possible to extend variant-based reasoning to handle both probabilistic and demonic choices in a unified, source-level program logic?
- RQ3How can the decrease in a super-martingale be parameterized such that the rule remains sound while increasing applicability beyond existing approaches?
- RQ4What classical results from Markov chain theory can be leveraged to provide completeness guarantees for the new proof rule?
- RQ5Can the rule be applied to higher-dimensional random walks, such as the 2D symmetric random walk, and does it guarantee the existence of a suitable variant?
Key findings
- The proposed proof rule successfully proves almost-sure termination for the 1D symmetric random walk, a program that cannot be handled by standard or previously known AST rules.
- The rule is sound and applicable directly at the source-code level in pGCL, enabling verification without descending into probabilistic models.
- The rule's parametric treatment of both the magnitude and probability of decrease allows it to handle programs with diminishing progress likelihood, extending beyond prior approaches.
- The connection to classical Markov chain theory ensures that for the 2D symmetric random walk, a variant satisfying the rule's conditions is guaranteed to exist, even if not yet constructible in closed form.
- The rule is formally verified via recursive program algebra, with equality of while-loop constructs established through fixed-point semantics and alpha conversion.
- The method supports programs with mixed probabilistic and demonic choices, demonstrating broader applicability than rules restricted to purely probabilistic or purely non-deterministic constructs.
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.