English

Weighted Automata for Exact Inference in Discrete Probabilistic Programs

Formal Languages and Automata Theory 2025-11-26 v2 Programming Languages

Abstract

In probabilistic programming, the inference problem asks to determine a program's posterior distribution conditioned on its "observe" instructions. Inference is challenging, especially when exact rather than approximate results are required. Inspired by recent work on probability generating functions (PGFs), we propose encoding distributions on Nk\mathbb{N}^k as weighted automata over a commutative alphabet with kk symbols. Based on this, we map the semantics of various imperative programming statements to automata-theoretic constructions. For a rich class of programs, this results in an effective translation from prior to posterior distribution, both encoded as automata. We prove that our approach is sound with respect to a standard operational program semantics.

Keywords

Cite

@article{arxiv.2509.15074,
  title  = {Weighted Automata for Exact Inference in Discrete Probabilistic Programs},
  author = {Dominik Geißler and Tobias Winkler},
  journal= {arXiv preprint arXiv:2509.15074},
  year   = {2025}
}
R2 v1 2026-07-01T05:44:09.645Z