[Paper Review] A Domain-Theoretic Approach to Statistical Programming Languages
This paper presents a simple, domain-theoretic semantics for statistical programming languages using minimal valuations over a dcpo of exact real numbers, enabling a commutative monad that supports continuous distributions, soft constraints, and full recursion. The key contribution is proving that all real-valued measures, including non-compact and non-continuous ones, can be modeled via minimal valuations on the domain of exact reals, ensuring correctness of program transformations like reordering independent random draws.
We give a domain-theoretic semantics to a statistical programming language, using the plain old category of dcpos, in contrast to some more sophisticated recent proposals. Remarkably, our monad of minimal valuations is commutative, which allows for program transformations that permute the order of independent random draws, as one would expect. A similar property is not known for Jones and Plotkin' s monad of continuous valuations. Instead of working with true real numbers, we work with exact real arithmetic, providing a bridge towards possible implementations. (Implementations by themselves are not addressed here.) Rather remarkably, we show that restricting ourselves to minimal valuations does not restrict us much: all measures on the real line can be modeled by minimal valuations on the domain $\mathbf{I}\mathbb{R}_\bot$ of exact real arithmetic. We give three operational semantics for our language, and we show that they are all adequate with respect to the denotational semantics. We also explore quite a few examples in order to demonstrate that our semantics computes exactly as one would expect, and in order to debunk the myth that a semantics based on continuous maps would not be expressive enough to encode measures with non-compact support using only measures with compact support, or to encode measures via non-continuous density functions, for instance. Our examples also include some useful, non-trivial cases of distributions on higher-order objects.
Motivation & Objective
- To develop a simple, purely domain-theoretic denotational semantics for statistical programming languages that avoids complex category-theoretic constructs like quasi-Borel spaces.
- To demonstrate that minimal valuations on the domain of exact real arithmetic can model all Borel measures on the real line, including those with non-compact support and non-continuous densities.
- To establish a commutative monad of minimal valuations over the category of dcpos, enabling correct program transformations such as reordering independent random draws.
- To bridge the gap between denotational semantics and implementable exact real arithmetic by using interval-based representations of real numbers.
- To show that operational semantics based on evaluation, reduction, and continuation-passing style are all adequate with respect to the denotational semantics.
Proposed method
- Using the dcpo $\mathbf{I}\mathbb{R}_{\bot}$ of interval approximations to represent exact real numbers, ensuring compatibility with domain-theoretic semantics.
- Defining a monad of minimal valuations on $\mathbf{Dcpo}$, which are shown to be commutative, enabling Fubini-Tonelli-style reasoning and correct reordering of independent random draws.
- Modeling continuous distributions and soft constraints (via $\mathtt{score}$) using minimal valuations, which are unbounded and support integration over non-compact sets.
- Constructing three operational semantics—evaluation-based, reduction-based, and continuation-passing style—each proven adequate with respect to the denotational semantics under appropriate assumptions.
- Leveraging the $K$-completion construction of Jia and Mislove and point-continuous valuations to ensure the monad is commutative and well-behaved on dcpos.
- Demonstrating expressivity by modeling higher-order distributions and non-trivial measures, including those with non-continuous density functions.
Experimental results
Research questions
- RQ1Can a purely domain-theoretic semantics based on minimal valuations model all Borel measures on $\mathbb{R}$, including those with non-compact support?
- RQ2Is the monad of minimal valuations on $\mathbf{Dcpo}$ commutative, enabling correct reordering of independent random draws in programs?
- RQ3Can exact real arithmetic be naturally integrated into a domain-theoretic semantics for statistical programming, and does it support full recursion and continuous distributions?
- RQ4Do multiple operational semantics—evaluation, reduction, and continuation-passing—agree with the denotational semantics under standard assumptions?
- RQ5Can non-continuous density functions and complex higher-order distributions be semantically captured using minimal valuations?
Key findings
- All Borel measures on $\mathbb{R}$, including Lebesgue measure and those with non-compact support, can be represented as minimal valuations on $\mathbf{I}\mathbb{R}_{\bot}$, despite minimal valuations being a proper subclass of continuous valuations.
- The monad of minimal valuations on $\mathbf{Dcpo}$ is commutative, which ensures that program transformations permuting independent random draws are correct and preserve semantics.
- The three operational semantics—evaluation-based, reduction-based, and continuation-passing style—are all sound and adequate with respect to the denotational semantics under natural assumptions on constants.
- The use of exact real arithmetic via interval approximations in $\mathbf{I}\mathbb{R}_{\bot}$ provides a natural bridge to implementation, while preserving full expressivity for continuous distributions and soft constraints.
- The semantics successfully models non-trivial higher-order distributions and measures with non-continuous density functions, countering the myth that continuous maps in domain theory lack expressive power.
- The construction of minimal valuations via $K$-completion and point-continuity ensures the monad is commutative, resolving a key challenge in earlier domain-theoretic approaches to probabilistic programming.
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.