Signatures and models (docs/roleflow.tex, sec:sig) #
Sorts carry a measurable space and a σ-finite measure each (Sorts). Contexts are flat lists
of sorts, and a value of a context Γ is a dependent tuple Val Γ, measured by the product
vol Γ. Values are accessed by position through Val.get, which takes the sort as an
argument with a proof Γ[i]? = some a, so no caller ever casts between sorts.
A signature (Sig) has operations Op as bs with bs ≠ [], and declares for some of them
one semi-inverse (SemiInv): the first cs arguments are consumed and solved from the
results and the remaining arguments ps. A model (Model) interprets operations by
measurable maps and gives each operation a log-weight; for operations with a semi-inverse it
must satisfy the left law and the leaf (change of variables at each parameter). ModelInv
adds the right law. leaf_dag derives the leaf of a semi-inverse with the derived log-weight
dagWeight; it needs only the left law.
Sorts, each with a measurable space and a σ-finite reference measure.
- X : S → Type
The space of a sort.
- meas (s : S) : MeasurableSpace (X s)
- μ (s : S) : MeasureTheory.Measure (X s)
The reference measure of a sort.
- sigmaFinite (s : S) : MeasureTheory.SigmaFinite (μ s)
Instances
Signatures #
Arguments #
The positions |Γ|, …, |Γ| + |Δ| - 1 of Γ ++ Δ have the sorts Δ.
Values of contexts #
A value of the context Γ: one value per position.
Equations
- RoleFlow.Val Γ = ((i : Fin Γ.length) → RoleFlow.X (Γ.get i))
Instances For
The product measure on a context.
Equations
- RoleFlow.vol Γ = MeasureTheory.Measure.pi fun (i : Fin Γ.length) => RoleFlow.μ (Γ.get i)
Instances For
Picking #
Picking from two values that agree at the picked positions.
Measurability #
cons of measurable maps, in the form fun_prop uses.
Products over contexts #
Models #
Derived log-weights of semi-inverses #
The derived log-weight of a semi-inverse G of F, on G's argument tuple (b, p):
-ℓ_F(G(b, p), p).
Equations
- RoleFlow.dagWeight G ℓ split w = -ℓ (RoleFlow.Val.cast split ((G w).append w.right))
Instances For
The leaf of a semi-inverse, with the derived log-weight, by Inv. Only the left law of the forward operation is used.