[Paper Review] Formal verification of higher-order probabilistic programs
This paper introduces PPV, a formal logic framework for verifying higher-order probabilistic programs with continuous distributions and conditioning. It uses quasi-Borel spaces (QBS) as a semantic foundation and embeds key probabilistic constructs—like expectation and distribution equality—directly into assertions, enabling sound verification of complex properties in statistics, inference, and machine learning.
Probabilistic programming provides a convenient lingua franca for writing succinct and rigorous descriptions of probabilistic models and inference tasks. Several probabilistic programming languages, including Anglican, Church or Hakaru, derive their expressiveness from a powerful combination of continuous distributions, conditioning, and higher-order functions. Although very important for practical applications, these combined features raise fundamental challenges for program semantics and verification. Several recent works offer promising answers to these challenges, but their primary focus is on semantical issues. In this paper, we take a step further and we develop a set of program logics, named PPV, for proving properties of programs written in an expressive probabilistic higher-order language with continuous distributions and operators for conditioning distributions by real-valued functions. Pleasingly, our program logics retain the comfortable reasoning style of informal proofs thanks to carefully selected axiomatizations of key results from probability theory. The versatility of our logics is illustrated through the formal verification of several intricate examples from statistics, probabilistic inference, and machine learning. We further show the expressiveness of our logics by giving sound embeddings of existing logics. In particular, we do this in a parametric way by showing how the semantics idea of (unary and relational) TT-lifting can be internalized in our logics. The soundness of PPV follows by interpreting programs and assertions in quasi-Borel spaces (QBS), a recently proposed variant of Borel spaces with a good structure for interpreting higher order probabilistic programs.
Motivation & Objective
- Address the challenge of formally verifying higher-order probabilistic programs that combine continuous distributions, conditioning, and first-class functions.
- Overcome limitations of prior logics that either restrict to discrete distributions or cannot express probabilistic properties like expectation or convergence directly in assertions.
- Develop a unified framework that supports both unary and relational verification of probabilistic programs with continuous measures.
- Enable practical verification of real-world examples from statistics, probabilistic inference, and machine learning using a proof system grounded in formal probability theory.
- Internalize advanced probabilistic constructions—such as $ op\top$-lifting and continuous $(f,\delta)$-lifting—within a sound logical framework.
Proposed method
- Define a monadic type for general (continuous) measures and integrate conditioning primitives into the language and logic.
- Use quasi-Borel spaces (QBS) as the semantic domain to model higher-order probabilistic programs, providing a Cartesian closed category that supports full higher-order functions.
- Design three interrelated logics within PPV: one for unary properties (e.g., expected value), one for relational properties (e.g., distributional equivalence), and one for reasoning about convergence and approximation.
- Axiomatize core results from probability theory (e.g., law of total expectation, convergence in distribution) as logical rules to support intuitive, informal-style reasoning.
- Provide parametric embeddings of existing logics (e.g., GRHOL, PrivInfer) via $ op\top$-lifting, showing PPV's expressiveness and extensibility.
- Establish soundness of PPV by interpreting programs and assertions in the QBS category, ensuring correctness of all proof rules.
Experimental results
Research questions
- RQ1How can we formally verify higher-order probabilistic programs that include continuous distributions and conditioning using a practical, modular logic?
- RQ2Can we embed key probabilistic reasoning principles—such as expectation, convergence, and coupling—directly into logical assertions?
- RQ3How can we support both unary and relational verification of probabilistic programs in a way that is both expressive and sound?
- RQ4What semantic foundation enables a Cartesian closed category for higher-order probabilistic computation, overcoming Aumann’s negative result?
- RQ5Can PPV subsume or embed existing verification frameworks for probabilistic programs, such as GRHOL or PrivInfer, in a principled way?
Key findings
- PPV enables direct reasoning about probabilistic expressions in assertions, such as the expected value of a random variable or convergence of a sequence of measures.
- The framework supports formal verification of complex examples from statistics and machine learning, including Bayesian inference and optimization tasks.
- The soundness of PPV is established via interpretation in quasi-Borel spaces (QBS), which provide a well-behaved categorical model for higher-order probabilistic programs.
- PPV can embed relational logics like GRHOL through $ op\top$-lifting, demonstrating its expressiveness and compatibility with existing approaches.
- The framework supports continuous distributions and conditioning, unlike prior systems such as PrivInfer or GRHOL, which are limited to discrete measures.
- PPV enables verification of properties such as equality of probability measures and convergence in distribution, which are not directly expressible in earlier relational logics.
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.