Abstract

We extend a call-by-need variant of PCF with a binary probabilistic fair choice operator, which makes a lazy and typed variant of probabilistic functional programming. We define a contextual equivalence that respects the expected convergence of expressions and prove a corresponding context lemma. This enables us to show correctness of several program transformations with respect to contextual equivalence. Distribution-equivalence of expressions of numeric type is introduced. While the notion of contextual equivalence stems from program semantics, the notion of distribution equivalence is a direct description of the stochastic model. Our main result is that both notions are compatible: We show that for closed expressions of numeric type contextual equivalence and distribution-equivalence coincide. This provides a strong and often operationally feasible criterion for contextual equivalence of expressions and programs.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call