A binary-choice inductive-counting controller #
The controller scans vertex identifiers in increasing order. It guesses whether to include each identifier, certifies each included identifier by a padded walk, and checks the selected count against the previous round's count. Only a fixed number of natural-number registers and Boolean flags are stored. An edge or bad-vertex oracle is consulted only in an explicit query phase.
Main definitions #
Cslib.InductiveCounting.State: the finite phase and the registers.Cslib.InductiveCounting.query: the request made in a query phase.Cslib.InductiveCounting.advance: one binary-choice controller instruction.Cslib.InductiveCounting.replay: replay a finite sequence of choices.
References #
Instances For
Ten registers and two flags suffice, independently of the number of vertices. remaining
is the number of padded walk steps still to check; bits counts unguessed bits of guess.
- phase : Phase
Current instruction.
- round : ℕ
Current round.
- count : ℕ
Certified size of the current round.
- target : ℕ
Target currently being tested.
- nextCount : ℕ
Accumulated size of the next round.
- candidate : ℕ
Candidate currently being scanned.
- selected : ℕ
Number of selected candidates.
- remaining : ℕ
Number of walk steps left.
- current : ℕ
Current walk vertex.
- guess : ℕ
Partially guessed next vertex.
- bits : ℕ
Number of vertex bits left.
- hit : Bool
Has a selected candidate satisfied the scan's predicate?
- finalScan : Bool
Is this the last scan, which tests the bad-vertex predicate?
Instances For
Instances For
A state has halted when it is accepting or rejecting.
Instances For
Oracle calls occur only at these two instructions.
Instances For
The underlying instruction, before the uniform storage and termination checks. answer
is consulted only at edge and observe; choice only at candidate and guess.
Vertex identifiers are guessed from most significant to least significant bit.
Instances For
A uniform bound on each register. It includes the whole range of a width-bit guess,
vertex counts (which can equal N), and the width counter.
Instances For
The bounds checked at each transition, including transitions on dishonest guesses.
Instances For
Worst-case cost of checking one candidate, with slack for the loop instructions.
Instances For
Worst-case cost of one target scan, with slack for the loop instructions.
Instances For
Worst-case cost of one whole round, with slack for the loop instructions.
Instances For
A natural-number progress measure. In a legitimate state, each instruction decreases it. The runtime check also rejects malformed states rather than allowing them to cycle.
Instances For
Initial state; an out-of-range source is rejected.