For the problem of computing the output distribution of a discrete probabilistic pro- grams, we show that intermediate representations based on knowledge compilation and binary decision diagrams arise naturally from denotational semantics considerations. More specifically, we show that they correspond to a model of call-by-name programming defined using a Reader monad. This is based on the idea is that sampling corresponds to generating a named random variable and later reading from it. By pairing our Reader monad with another monad for allocating new names, we construct a denotational model of probabilistic programming that explains these representa- tions. Although call-by-name and call-by-value give different results in general, for Reader monads they are equivalent. From this observation we derive a correctness theorem for knowledge compilation with respect to the standard (call- by-value) semantics of probabilistic programming.
Simon Castellan University of Rennes; Inria; CNRS; IRISA, Tom Hirschowitz Univ. Grenoble Alpes, Univ. Savoie Mont Blanc, CNRS, LAMA, 73000 Chambéry, Hugo Paquet Inria, École Normale Supérieure