In this paper, we propose a stochastic version of a general purpose functional programming language as a method of modeling stochastic processes. The language contains random choices, conditional statements, structured values, defined functions, and recursion. By imagining an experiment in which the program is “run” and the random choices made by sampling, we can interpret a program in this language as encoding a probability distribution over a (potentially infinite) set of objects. We provide an exact algorithm for computing conditional probabilities of the form Pr ¢¡£ ¥¤§¦©¨£ ¥¤¦¦ where ¤ is chosen randomly from this distribution. This algorithm terminates precisely when sampling ¤ and computing ¡£ ¥¤§¦ and £ ¥¤§¦ terminates in all possible stochastic executions (under lazy evaluation semantics, in which only values needed to compute the output of the program are evaluated). We demonstrate the applicability of the languageand the efficien...
Daphne Koller, David A. McAllester, Avi Pfeffer