One pass of the witness enumerator #
⚠️ Unreviewed by Bolton
An iteration takes the count v, tests the witness it denotes, and leaves the loop one count
further along. In order:
- blank the verdict slot, so the pass starts from a known output;
- emit
pair x wonto the first pair tape; - rewind the input copy, the witness, and that tape, which the emitter left mid-scan;
- copy the pair into virtual-input shape on the tape the matrix machine reads;
- run the matrix machine, which writes its verdict to the verdict tape;
- rewind the verdict tape, since the matrix machine left its head wherever it halted;
- publish that verdict into the slot;
- bump the tally the slot names and advance the counter;
- advance the witness in step with the counter;
- blank everything the pass dirtied.
Steps 8 and 10 are the counting machine's own — TM.tallyBumpTM and TM.wipeRewindTM — and step
9 is what makes the loop's resting bank depend on the count.
Main results #
PolyExists.copyPairTM— the copy into virtual-input shapePolyExists.bodyTM— one pass of the enumeratorPolyExists.enumBank— the tapes an iteration starts from, and its values at the named indicesPolyExists.blankSlot_hoareTime— the first stage's contract
Move the emitted pair onto the tape the matrix machine reads, in the shape it expects.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bank the loop rests in #
The bank satisfies the left-marker invariant on every tape, which every rewind, park and wipe downstream asks of the tapes it carries.
The body's first stage: blank the verdict slot. The loop returns to its start state with the previous check's verdict still in the slot; everything downstream — the emitter, the matrix machine, the wipe — needs the real output tape blank.
The tapes after the pair has been emitted and everything the emitter scanned rewound: the bank, with the pair now on its tape.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What the emitter leaves behind: the pair on its tape, both sources with their cells intact, every other tape untouched, and no head further out than the stage is long.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The emitting stage's contract.
The rewinding stage's contract. The emitter left three heads mid-scan; this puts them back at cell one, which pins every tape again.
The tapes after the pair has been moved into the shape the matrix machine reads: the emitter's target keeps its contents with its head left past them, and the matrix machine's input tape now holds the pair.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The copying stage's contract.
The layout and the placement agree. The tapes the copy stage leaves behind are exactly the ones the placed matrix machine expects to be entered with: its own scratch blank, the pair on the tape it reads, the verdict tape blank, and the enumerator's registers on either side.
The evaluating stage's contract, in the enumerator's own terms.
What the matrix machine leaves behind: its verdict on the verdict tape, the enumerator's own tapes untouched, and its block dirty but bounded.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The evaluating stage, with its verdict read as a Boolean.
Rewinding the verdict tape. The matrix machine halts wherever it likes; the bit it wrote is at cell one, so the head has to go back there before the pass can publish it.
Reading a cell back as a writable symbol turns it into 1 exactly when it was 1.
Publishing the verdict. The bit under the verdict tape's head is copied into the output slot, which is the only channel between a work tape and the real output.
What the tally bump leaves: the counter advanced, one tally bumped, and the slot blank again.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The tally bump. The slot the previous stage published names which tally to advance; the counter advances with it, and the slot is blanked so that the wipe can run.
Advancing the witness. The counter has just moved on, and TM.binaryBumpTM moves the
witness with it: PolyExists.dropTop_succ says the string the next count denotes is exactly the
zero-extending increment of this one.
The wipe, and the bridge back to the loop invariant. Blanking everything the pass dirtied turns the bank into the one the loop's state names at the next count.
Chaining the pass #
A phase boundary parks every tape it crosses.
A phase boundary is the identity on parked tapes.
The seam after the emitter. The emitter can leave a head on the marker; the boundary step moves it off, and everything the next stage needs survives.
The seam after the matrix machine. Same story: the machine may halt with a head on the marker, and the boundary moves it off.
A predicate about parked tapes survives a phase boundary, since the boundary does not move them.
One pass of the enumerator, contracted. From the loop's state at count v the pass tests
the witness that count denotes, advances the counter and the witness, bumps the tally the verdict
names, and leaves the loop's state at count v + 1.