Bounded outer double-counting controller #
This is the outer step of Figures 2 and 3 in the March 31, 1999 version of [RA00], Section 2, pp. 6–7. Given adjacency and current-round membership callbacks, count qualifying predecessors of each vertex outside the round. Add a single tally contribution for a positive count and flag any count greater than one. Figure 2 counts once per qualifying predecessor, yielding the same tally whenever the tie flag is clear.
The controller returns the first bad round, or tests the target after stabilization.
In the list monad, each entry represents a successful replay, so the singleton equations in
runController_correct account for multiplicity even when branches return equal values.
Rejected replays contribute no list entries. The native LogSpace.DoubleCounting module
certifies the binary update. Callback and branch-preserving native composition are tracked in #6747.
See the checked caller in CslibFrontierTests.LayeredDigraph.
The registers accumulated by the outer vertex scan.
Accumulate a single vertex's contribution using its predecessor count.
One predecessor test: count only when both callbacks answer true. An arbitrary index type lets typed scans and binary scalar query controllers share this dispatch.
With correct callback replies, the bounded scans compute the exact next tally and flag exactly the failure of next-round uniqueness, provided the current round is unique.
A terminal verdict distinguishes a tied graph from a reachability answer.
- bad (radius : ℕ) : ControllerVerdict
The first round containing a shortest-walk tie.
- decided (reachable : Bool) : ControllerVerdict
Whether the target is reachable.
Instances For
Fuel-bounded round loop used by runController.
Run at most one update per vertex, starting with the source alone. The correctness theorem excludes fuel exhaustion when the callback contract holds.
Under the adjacency and unique membership-replay contracts, the controller returns the first nonunique round, or the reachability answer when all rounds are unique. Fuel suffices for either outcome.