Generating Functions Meet Occupation Measures: Invariant Synthesis for Probabilistic Loops (Extended Version)

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Haase, Darion, Batz, Kevin, Gallus, Adrian, Kaminski, Benjamin Lucien, Katoen, Joost-Pieter, Klinkenberg, Lutz, Winkler, Tobias
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909995785781248
author Haase, Darion
Batz, Kevin
Gallus, Adrian
Kaminski, Benjamin Lucien
Katoen, Joost-Pieter
Klinkenberg, Lutz
Winkler, Tobias
author_facet Haase, Darion
Batz, Kevin
Gallus, Adrian
Kaminski, Benjamin Lucien
Katoen, Joost-Pieter
Klinkenberg, Lutz
Winkler, Tobias
contents A fundamental computational task in probabilistic programming is to infer a program's output (posterior) distribution from a given initial (prior) distribution. This problem is challenging, especially for expressive languages that feature loops or unbounded recursion. While most of the existing literature focuses on statistical approximation, in this paper we address the problem of mathematically exact inference. To achieve this for programs with loops, we rely on a relatively underexplored type of probabilistic loop invariant, which is linked to a loop's so-called occupation measure. The occupation measure associates program states with their expected number of visits, given the initial distribution. Based on this, we derive the notion of an occupation invariant. Such invariants are essentially dual to probabilistic martingales, the predominant technique for formal probabilistic loop analysis in the literature. A key feature of occupation invariants is that they can take the initial distribution into account and often yield a proof of positive almost sure termination as a by-product. Finally, we present an automatic, template-based invariant synthesis approach for occupation invariants by encoding them as generating functions. The approach is implemented and evaluated on a set of benchmarks.
format Preprint
id arxiv_https___arxiv_org_abs_2601_13991
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Generating Functions Meet Occupation Measures: Invariant Synthesis for Probabilistic Loops (Extended Version)
Haase, Darion
Batz, Kevin
Gallus, Adrian
Kaminski, Benjamin Lucien
Katoen, Joost-Pieter
Klinkenberg, Lutz
Winkler, Tobias
Programming Languages
A fundamental computational task in probabilistic programming is to infer a program's output (posterior) distribution from a given initial (prior) distribution. This problem is challenging, especially for expressive languages that feature loops or unbounded recursion. While most of the existing literature focuses on statistical approximation, in this paper we address the problem of mathematically exact inference. To achieve this for programs with loops, we rely on a relatively underexplored type of probabilistic loop invariant, which is linked to a loop's so-called occupation measure. The occupation measure associates program states with their expected number of visits, given the initial distribution. Based on this, we derive the notion of an occupation invariant. Such invariants are essentially dual to probabilistic martingales, the predominant technique for formal probabilistic loop analysis in the literature. A key feature of occupation invariants is that they can take the initial distribution into account and often yield a proof of positive almost sure termination as a by-product. Finally, we present an automatic, template-based invariant synthesis approach for occupation invariants by encoding them as generating functions. The approach is implemented and evaluated on a set of benchmarks.
title Generating Functions Meet Occupation Measures: Invariant Synthesis for Probabilistic Loops (Extended Version)
topic Programming Languages
url https://arxiv.org/abs/2601.13991