Forward search over equations #
An equation binds ← reads remembers its line and whether it is the swapped solved form of an
add. Starting from a known set K₀, the search fires
every equation whose reads are known and whose results are unknown, sweep after sweep, until
nothing fires (fwdKnown). The search is exact for a list A of recipes (fwdKnown_exact):
if every variable has at most one recipe, every equation of E is a recipe or has a back edge
to one, and every result of A is derivable from K₀, then the fired equations are exactly
A. Nothing here depends on the signature; the front end (Front, FrontComplete) supplies
the equations of the lines and the swapped solved form of add.
Fire q if its reads are known and its results unknown.
Equations
Instances For
One sweep: fire, in order, every equation that can.
Equations
- RoleFlow.Search.sweep E K F = List.foldl RoleFlow.Search.fireStep (K, F) E
Instances For
Sweep until nothing fires: the known set and the fired equations. Every equation binds
something, so each fires at most once and E.length + 1 sweeps suffice.
Equations
- One or more equations did not get rendered due to their size.
- RoleFlow.Search.fwdKnown E 0 x✝¹ x✝ = (x✝¹, x✝)
Instances For
q can fire at K: its results are unknown and its reads known.
Instances For
The known set is closed under A: a known variable's recipe reads only known variables.
Instances For
Nothing in E can fire.
Equations
- RoleFlow.Search.Terminal E K = ∀ q ∈ E, ¬RoleFlow.Search.CanFire K q
Instances For
The invariant of the search: the known set K is closed, the fired equations F are
distinct recipes, and a variable is known iff it is a start variable or a result of F.
Instances For
A sweep keeps the invariant, never loses fired equations, and if it fires nothing, nothing could fire.
At a fixpoint the known set is closed under firing A forwards.
The search fires exactly A, given that every result of A lies in every set that
contains K₀ and is closed under A.