Understanding Semantics of Probabilistic Programs in Literature
20 likes | 121 Vues
Explore the approaches and practical issues surrounding probabilities, expectations, and implementations in probabilistic programs. Learn how Haskell implementation uses type classes for generalization and assertion of domain classes.
Understanding Semantics of Probabilistic Programs in Literature
E N D
Presentation Transcript
Semantics of Probabilistic Programs • Approaches discussed in literature • E1pE2 => E1 (with prob. p) => E2 (with prob. (1-p)) • Probability of a specific output is not explicit. • [E1pE2]s = (p)*[E1]s + (1-p)*[E2]s • [E]s is a measure function from events to probabilities. • Forward or Backward? • Practical Issues • Backward implementation is difficult. (inverses, representation of sets). • Need to be able to compute probabilities, expectations inside of the program.
Haskell Implementation • Using type classes to realize a general parameterized type (Prob a). • Has capability to generalize to product types (a b). • data (DomainClass a) => (Prob a) = … • (DomainClass a) is an assertion that ‘a’ must be an instance of DomainClass. • Still must provide ‘instance DomainClass T’ declaration, which defines functions to operate on values of type T. • Underlying representation • Dimensions: exact/interpolated countable/uncountable • Sample sets and functions considered.