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

生成讲解博客的中文版本

生成AI智能校验的中文版本