English

Contextual Equivalence for a Probabilistic Language with Continuous Random Variables and Recursion

Programming Languages 2018-07-10 v1

Abstract

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 = e1e_1 in let y = e2e_2 in e0e_0) is equivalent to (let y = e2e_2 in let x = e1e_1 in e0e_0) (provided xx does not occur free in e2e_2 and yy does not occur free in e1e_1) despite the fact that e1e_1 and e2e_2 may have sampling and scoring effects.

Keywords

Cite

@article{arxiv.1807.02809,
  title  = {Contextual Equivalence for a Probabilistic Language with Continuous Random Variables and Recursion},
  author = {Mitchell Wand and Ryan Culpepper and Theophilos Giannakopoulos and Andrew Cobb},
  journal= {arXiv preprint arXiv:1807.02809},
  year   = {2018}
}

Comments

Extended version of ICFP 2018 paper

R2 v1 2026-06-23T02:53:59.998Z