The sources of the dependency graph restricted to the still-unemitted set: items whose
dependencies all lie outside remaining (already emitted, or never in the graph).
Equations
- CordialMiners.topoSources deps remaining = {x ∈ remaining | deps x ∩ remaining = ∅}
Instances For
A source is one of the unemitted items.
A source has no dependency left in the unemitted set.
One round of Kahn's algorithm, driven by a fuel counter. With fuel left and a source available, emit the least source and recurse on the rest; otherwise stop.
Equations
- One or more equations did not get rendered due to their size.
- CordialMiners.topoAux deps 0 x✝ = []
Instances For
The concrete ordering: run the topological sort with fuel equal to the vertex count.
Equations
- CordialMiners.topoSort V deps = CordialMiners.topoAux deps V.card V
Instances For
A list is topologically sorted for deps when no item's dependency appears after it: for every
way of splitting the list at an item y, none of y's dependencies sit in the tail.
Equations
Instances For
Every emitted item was in the working set it was drawn from.
The output has no duplicates: each emitted item is erased from the working set, so it can never be picked again.
The output respects dependencies: an item is emitted only when all its remaining dependencies are gone, so no dependency of an item ever appears after it.
TAU-04 realized concretely: the ordering is a pure function, so equal inputs give equal outputs.
Output-validity: every hash in the ordered output came from the input vertex set.
The ordered output has no duplicate positions.
The ordered output is topologically sorted: no dependency is ever placed after the item that depends on it. This is the causal-consistency guarantee of the deterministic ordering.
Under a strict rank (every dependency has smaller rank, so the graph is acyclic) a nonempty working set always has a source: the element of least rank, whose dependencies all rank below it and so cannot still be in the working set.
Completeness under a strict rank: with fuel at least the working-set size, every item is emitted. Acyclicity gives a source at every nonempty round, so the fuel is never exhausted early.
TAU completeness: every input vertex appears in the ordered output (under acyclicity). Together with topoSort_subset and topoSort_nodup, the output lists exactly the input vertices, once each.