Denotational Semantics for Output Distributions #
This file defines a typeclass for monads that can be canonically embedded in the SPMF monad.
We require this embedding respect the basic monad laws.
We also define a number of specific cases:
Pr[= x | mx]/probOutput mx xfor odds ofmxreturningxPr[p | mx]/probEvent mx pfor odds ofmx's result satisfyingpPr[e | x ← mx]wherexis free in the expressionePr{x ← mx}[e]wherexis free in the expressionePr[⊥ | mx]/probFailure mxfor odds ofmxresulting in failure
For the last case, we assume mx has an OptionT transformer to represent the failure.
In future it may be nice to generalize to any AlternativeMonad using an additional typeclass
(note that it can't extend the existing one as it outputs in an SPMF).
The monad m has a well-behaved embedding into the SPMF monad.
TODO: modify this to extend MonadHom to get some lemmas for free.
Instances
Probability that a computation mx returns the value x.
Equations
Instances For
Probability that a compuutation mx will fail to return a value.
Equations
Instances For
Probability that a computation returns a particular output.
Equations
Instances For
Probability that a computation returns a value satisfying a predicate.
Equations
Instances For
Probability that a computation fails to return a value.
Equations
Instances For
Probability that a computation returns a value satisfying a predicate.
Equations
Instances For
Probability that a computation returns a value satisfying a predicate.
Equations
Instances For
Add instance for SPMF just to give access to notation.