Contextual equivalence for a probabilistic language with continuous random variables and recursion

We present a complete reasoning principle for contextual equivalence in an untyped probabilistic language. The language includes continuous (real-valued) random variables, conditionals, and scoring. It also includes recursion, since the standard call-by-value fixpoint combinator is expressible. We demonstrate the usability of our characterization by proving several equivalence schemas, including familiar facts from lambda calculus as well as results specific to probabilistic programming. In particular, we use it to prove that reordering the random draws in a probabilistic program preserves contextual equivalence. This allows us to show, for example, that (let x = e1 in let y = e2 in e0) =ctx (let y = e2 in let x = e1 in e0) (provided x does not occur free in e2 and y does not occur free in e1) despite the fact that e1 and e2 may have sampling and scoring effects.

[1]  Yura N. Perov,et al.  Venture: a higher-order probabilistic programming platform with programmable inference , 2014, ArXiv.

[2]  Frank D. Wood,et al.  A New Approach to Probabilistic Programming Inference , 2014, AISTATS.

[3]  Mitchell Wand,et al.  Set constraints for destructive array update optimization , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[4]  Thomas Ehrhard,et al.  Probabilistic coherence spaces are fully abstract for probabilistic PCF , 2014, POPL.

[5]  Gert Smolka,et al.  Autosubst: Reasoning with de Bruijn Terms and Parallel Substitutions , 2015, ITP.

[6]  Carolyn L. Talcott,et al.  1 Equivalence in Functional Languages with E ectsIan , 2007 .

[7]  Lars Birkedal,et al.  Step-Indexed Logical Relations for Probability , 2015, FoSSaCS.

[8]  Sam Staton,et al.  Commutative Semantics for Probabilistic Programming , 2017, ESOP.

[9]  Chung-chieh Shan,et al.  Embedded Probabilistic Programming , 2009, DSL.

[10]  Ugo Dal Lago,et al.  On Probabilistic Applicative Bisimulation and Call-by-Value λ-Calculi , 2014, ESOP.

[11]  Davide Sangiorgi,et al.  Environmental bisimulations for probabilistic higher-order languages , 2016, POPL.

[12]  Amal Ahmed,et al.  Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types , 2006, ESOP.

[13]  Andrew M. Pitts Step-Indexed Biorthogonality: a Tutorial Example , 2010, Modelling, Controlling and Reasoning About State.

[14]  Jacques Carette,et al.  Probabilistic Inference by Program Transformation in Hakaru (System Description) , 2016, FLOPS.

[15]  Joshua B. Tenenbaum,et al.  Church: a language for generative models , 2008, UAI.

[16]  Amr Sabry,et al.  Reasoning about programs in continuation-passing style , 1992, LFP '92.

[17]  Ohad Kammar,et al.  Semantics for probabilistic programming: higher-order functions, continuous distributions, and soft constraints , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[18]  Guillaume Melquiond,et al.  Coquelicot: A User-Friendly Library of Real Analysis for Coq , 2015, Math. Comput. Sci..

[19]  Frank D. Wood,et al.  A Compilation Target for Probabilistic Programming Languages , 2014, ICML.

[20]  Ryan Culpepper,et al.  Contextual Equivalence for Probabilistic Programs with Continuous Random Variables and Scoring , 2017, ESOP.

[21]  J. Gregory Morrisett,et al.  An Application of Computable Distributions to the Semantics of Probabilistic Programming Languages , 2016, ESOP.

[22]  Ugo Dal Lago,et al.  A lambda-calculus foundation for universal probabilistic programming , 2015, ICFP.

[23]  Matthias Felleisen,et al.  Semantics Engineering with PLT Redex , 2009 .