Probability Semantics for Polynomial Free Monads #
This module equips an arbitrary polynomial functor with per-operation
probability semantics and interprets its free monad in PMF. It also provides
the syntax-only support interpretation in SetM. The API is independent of
OracleSpec; oracle computations inherit it through their underlying
polynomial functor.
Per-operation probability distributions for a polynomial interface.
The distribution of directions available at an operation.
Instances
A finitely branching polynomial interface whose operation responses use the canonical uniform distribution.
Every direction type is finite.
Every direction type is inhabited.
- toPMF_eq_uniform (operation : P.A) : IsProbabilitySpec.toPMF operation = PMF.uniformOfFintype (P.B operation)
Each operation uses the canonical uniform distribution on directions.
Instances
Construct uniform probability semantics from finite, inhabited direction types. This is deliberately not an instance: probability semantics remain an explicit opt-in.
Instances For
Interpret a polynomial free program using its per-operation probability distributions.
Interpret support syntactically by allowing every direction at every operation. This does not require probability or finiteness assumptions.
The distribution semantics of a polynomial free program is its universal
fold into PMF.
The support semantics of a polynomial free program is its universal fold with every operation direction available.
A single operation evaluates to its configured direction distribution.
A single operation on a uniform polynomial interface evaluates to the canonical uniform distribution on its directions.
Every direction of a single operation belongs to its SetM-fold support.
This name distinguishes VCVio's denotational support from PolyFun's structural
MonadAttach.support_lift theorem.
Syntactic support and distribution support agree for a uniformly interpreted polynomial free monad.
For an oracle spec this is reached explicitly, not by synthesis:
OracleComp.instEvalDistCompatible supplies the IsUniformSpec premise through
OracleSpec.IsUniformSpec.toPFunctor, which is deliberately a definition rather than an
instance so that nothing unifies against the reducible head spec.toPFunctor. Keep it that
way — promoting that conversion would make this instance and the oracle-level one both
applicable to the same goal.