Ordered seed search over verified reachability controllers #
This is a composition step for #6747, not a native workspace or NL = UL theorem.
The designated source's controller is run first to obtain its answer. The other listed
sources are then checked in order. The list can enumerate original roots within a subdivided
graph, whose auxiliary vertices remain available as walk targets. A bad controller verdict
rejects this seed; a failed controller execution rejects the branch. Seeds are tried by
increasing binary value, using the existing bit-string numbering and a bounded counter.
In List, duplicate successful branches remain duplicate entries.
Applying the interface #
Supply a controller callback indexed by a bit seed and source. Its exact-outcome contract
returns a bad radius witnessing failure of round uniqueness, or a decided Boolean with
all-round uniqueness and the correct reachability answer. runController_correct and
runController_replay_correct provide this boundary. The designated source is always tested,
even if it is absent from the supplied source list. For graph-wide verification the list
must cover every intended original source; the algorithm does not infer that coverage.
The seed is numbered by BitString.equivFin, with coordinate zero least significant.
BitString.equivFin_symm_apply identifies access to a seed bit with Nat.testBit on its
counter, so a later native implementation need not retain an array of seed words.
The selected answer concerns the graph at the selected seed. Applying it to a fixed language
also uses the reachability-preservation theorem of the weighted transport.
The outer traversal keeps a cursor and a remaining count, each at most 2 ^ length, so each
register fits in length + 1 binary digits. The initial count 2 ^ length needs all of those
digits. Each tested cursor is strictly below 2 ^ length and fits in length digits. The checked
client verifies these bounds for the native binary encoding. The source list specifies the inner
traversal.
The actual replay callback in the checked client is proof-level enumeration.
Native loop/state bounds, binary choice lowering, callbacks and first-halting composition
remain in #6747. Validate this client with
scripts/build.sh CslibFrontierTests.IsolationSeedSearch --wfail --iofail.
For implicitly indexed source lists, runSeedSearchIndexed requests the source at each
position using a bounded cursor. It shares the seed loop and designated source handling with
runSeedSearch. The exact equality to the list specification holds before assuming any
controller contracts, so it covers rejection and repeated outcomes as well.
Main results #
runSeedSearchIndexed_eq: indexed and list traversal have identical monadic outcomes.runSeedSearchIndexed_clock: bounds the controller clock, including a rejecting call.runSeedSchedulerFrom: resume at a seed rank and, after a designated scan, an indexed cursor.testSeed_correct: the tested sources have one exact outcome under the controller contract.runSeedSearch_correct: a good seed exists, so search returns the least passing seed and its correct Boolean, with one successful branch in the list interpretation.
References #
- [Hoz26], Section 1.2, page 3, the seed-enumeration step. The proof here concerns monadic control flow under verified callback contracts, not the source's native theorem.
The first seed passing the requested source checks and its designated answer.
Binary value of the selected seed, with coordinate zero least significant.
- reachable : Bool
The controller's answer from the designated source.
Instances For
Test the designated source first, then the other listed sources in their given order.
none is a bad seed; controller failure is an effectful rejected branch.
Enumerate every bit seed by increasing binary value, stopping at the first seed whose designated and listed source controllers all pass. A successful negative answer also stops the search.
Run the seed and source counters with a callback on the binary seed number, the optional source position and retained designated answer, and the source ID. The absent position denotes the designated scan. The callback's effects preserve branch multiplicity.
Resume the same monadic seed search at a binary rank. With no retained answer, start with the designated scan. A pair of cursor and answer resumes the indexed roots for that seed, after which later seeds still start with their designated scan.
Starting at the designated scan of rank zero gives the original seed search.
A rank at or above the exclusive limit exhausts the seed search.
A designated scan's pure verdict advances the seed on a tie, or starts the indexed roots with the designated answer.
Once all indexed roots have passed, the retained designated answer is returned at the current seed.
An indexed step skips the designated source or consumes its own pure verdict. A tie advances to the next seed. A skip or decided verdict advances the cursor with the retained designated answer.
Search with sources supplied by their positions. The traversal keeps a cursor and remaining count, requesting each source only after the preceding checks have passed.
The indexed search is the specialization that reads the binary seed by its bits.
A scanner that depends only on the seed number and source ID gives the same computation as the indexed search with the corresponding bit-seed callback.
Indexed traversal gives the same ordered computation as enumerating the source list. In the list monad this preserves all outcomes and their multiplicities.
The indexed search spends at most one designated call and one call per source position for each candidate seed. A rejecting call still advances the measured state clock. This bounds the supplied callback cost in the rejecting state monad.
The indexed search spends at most one designated call and one call per source position for each candidate seed, including a rejecting call.
The all-source test has one monadic outcome under the controller's exact-outcome
contract. In List this is a singleton with its multiplicity, not merely a unique value.
Under exact controller outcomes and the existence of an all-source-good seed, the
ordered search has one outcome and selects the least binary seed that passes every source.
In List this asserts exactly one successful branch, including its multiplicity.