CoreDPPL: Towards a Sound Composition of Differentiation, ODE Solving, and Probabilistic Programming
Oscar Eriksson, Anders Ågren Thuné, Johannes Borgström, David Broman
TL;DR
CoreDPPL tackles safe composition of differentiation, ODE solving, and probabilistic programming by introducing a higher‑order core language with a static effect/coeffect type system and a dynamic semantics. It provides formal semantics, mechanized Agda proofs of type safety, and a practical implementation extended from CorePPL, complemented by three case studies (ODE sensitivities, Random ODEs, and Bayesian parameter estimation). The key contributions include distinguishing analytic versus PAP differentiation, tracking randomness, and ensuring that deterministically typed terms do not affect random state. The work demonstrates that complex models mixing ODEs, AD, and probabilistic inference can be safely composed and executed, with future directions toward DAEs and richer domain analyses.
Abstract
In recent years, there has been extensive research on how to extend general-purpose programming language semantics with domain-specific modeling constructs. Two areas of particular interest are (i) universal probabilistic programming where Bayesian probabilistic models are encoded as programs, and (ii) differentiable programming where differentiation operators are first class or differential equations are part of the language semantics. These kinds of languages and their language constructs are usually studied separately or composed in restrictive ways. In this paper, we study and formalize the combination of probabilistic programming constructs, first-class differentiation, and ordinary differential equations in a higher-order setting. We propose formal semantics for a core of such differentiable probabilistic programming language (DPPL), where the type system tracks random computations and rejects unsafe compositions during type checking. The semantics and its type system are formalized, mechanized, and proven sound in Agda with respect to abstract language constructs.
