Finite-branching ornament on interaction specs #
Interaction.Spec.Fintype spec is the recursive typeclass-level ornament
asserting that every move space appearing in spec : Spec.{0} carries
Fintype and Nonempty instances.
This is the tree-shaped analog of OracleSpec.Fintype extends PFunctor.Fintype:
OracleSpec has one layer of positions (a single polynomial functor), so a
single PFunctor.Fintype witness suffices. Spec is a tree of nodes, so the
ornament recurses into every subtree.
A Spec.Fintype spec instance is the data needed to derive a canonical
uniform sampler Spec.Sampler.uniform : Sampler ProbComp spec built by
uniform selection at each node (see VCVio.Interaction.UC.Runtime).
Recursive finite-branching ornament on an interaction spec.
The .done case holds vacuously. At a .node X rest the ornament
bundles Fintype and Nonempty witnesses for the move space X
together with a per-branch ornament on every continuation rest x.
Typeclass synthesis builds these up structurally from concrete spec
trees via the companion instances below, the same way
OracleSpec.Fintype synthesizes from PFunctor.Fintype.
- done : Spec.done.Fintype
- node {X : Type} (hFin : Fintype X) (hNon : Nonempty X) {rest : X → Spec} (hRec : (x : X) → (rest x).Fintype) : (Spec.node X rest).Fintype
Instances
Canonical Spec.Fintype instance for the terminal spec.
Canonical Spec.Fintype instance for a node: synthesizes from
Fintype X, Nonempty X, and a per-branch ornament.