The enumerator's loop #
⚠️ Unreviewed by Bolton
The pass of PolyExists.bodyTM and the counting loop's own test are the two obligations of
NTM.tallyLoop_hoareTime_of_hoare_indexed. The test is the same machine the path-counting
machine of PP ⊆ PSPACE uses — TM.tallyTestTM compares the counter with the horizon and
publishes the answer, and its contract is generic in the bank — so only the body has to be
matched to the loop's state.
That matching is an identity: the loop's state at index v names the counter v and the two
tallies of PolyExists.enumP below, over the bank PolyExists.enumRest at v + 1, which is
exactly PolyExists.enumBank.
Main results #
PolyExists.enumP— the predicate the loop tallies: does the witness this count denotes work?PolyExists.enumBody_hoareTime— the pass, as the loop rule's body obligationPolyExists.enumTest_hoareTime— the test, as the loop rule's test obligationPolyExists.enumLoop_hoareTime— the two composed: the loop's contract
The predicate the enumerator's loop tallies: whether the witness a count denotes puts the
pair in the matrix language. The count is shifted by one — the witness at count v is the one
v + 1 denotes — which is what makes every witness of the admitted lengths appear.
Equations
- Complexity.PolyExists.enumP L' x v = decide (Complexity.pair x (Complexity.dropTop (v + 1)) ∈ L')
Instances For
The pass, as the loop rule's body obligation. The loop's state at index v is the bank
the pass starts from, and the state the pass leaves is the loop's state at v + 1.
The test, as the loop rule's test obligation. The counting machine's own test serves the enumerator unchanged: its contract is generic in the bank, and the enumerator's bank meets it.
The test's running time at one index.
Equations
Instances For
The enumerator's loop. Every count below the horizon is tested, the tallies come out as
the two counts of PolyExists.enumP, and the loop's state ends at the horizon.