# Compositional Semantics for Probabilistic Programs with Exact Conditioning

arXiv: https://arxiv.org/abs/2101.11351 · HTML: https://mlsanity.com/paper/2101.11351/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Builds on 9 of its 41 references that are in the map.
- First posted on arXiv 27 Jan 2021.

## Builds on (most cited first, 9 of 9)

- [A synthetic approach to Markov kernels, conditional independence and theorems on sufficient statistics](https://mlsanity.com/paper/1908.07021/) (2019)
- [Disintegration and Bayesian Inversion via String Diagrams](https://mlsanity.com/paper/1709.00322/) (2017)
- [Representable Markov Categories and Comparison of Statistical Experiments in Categorical Probability](https://mlsanity.com/paper/2010.07416/) (2020)
- [Delayed Sampling and Automatic Rao-Blackwellization of Probabilistic Programs](https://mlsanity.com/paper/1708.07787/) (2017)
- [A Channel-Based Perspective on Conjugate Priors](https://mlsanity.com/paper/1707.00269/) (2017)
- [The Beta-Bernoulli process and algebraic effects](https://mlsanity.com/paper/1802.09598/) (2018)
- [On computability and disintegration](https://mlsanity.com/paper/1509.02992/) (2015)
- [From high-level inference algorithms to efficient code](https://mlsanity.com/paper/1805.06562/) (2018)
- [Universal Properties in Quantum Theory](https://mlsanity.com/paper/1901.10117/) (2019)

## Built on by (most cited first, 2 of 2)

- [Categorical Foundations of Explainable AI: A Unifying Theory](https://mlsanity.com/paper/2304.14094/) (2023)
- [Logic Explanation of AI Classifiers by Categorical Explaining Functors](https://mlsanity.com/paper/2503.16203/) (2025)

## Abstract (arXiv)

We define a probabilistic programming language for Gaussian random variables with a first-class exact conditioning construct. We give operational, denotational and equational semantics for this language, establishing convenient properties like exchangeability of conditions. Conditioning on equality of continuous random variables is nontrivial, as the exact observation may have probability zero; this is Borel's paradox. Using categorical formulations of conditional probability, we show that the good properties of our language are not particular to Gaussians, but can be derived from universal properties, thus generalizing to wider settings. We define the Cond construction, which internalizes conditioning as a morphism, providing general compositional semantics for probabilistic programming with exact conditioning.
