Multiplying the block lengths of a pair — proof internals #
This module builds the one quadratic-output transducer needed by Cobham's
soundness direction: from pair A B it emits |A| · |B| copies of false,
which is exactly the length behaviour of Complexity.smash. The soundness proof
then applies unaryLength_mem_FP to turn this internal zero-filled ruler into
Cobham's all-one smash word.
The machine mulLenTM is self-contained (one work tape, eight control states):
- scan — parse the leading self-delimiting block two symbols at a time,
writing one unary mark on the work tape per payload bit, so the work tape
ends up holding
|A|in unary; - outer loop — for every remaining input symbol (i.e.
|B|times) run the emit pass, which walks the|A|marks writing onefalseper mark, and the rewind pass, which returns the work head to cell one.
Malformed input halts with empty output, matching unpair? = none.
Main results #
Complexity.Cobham.mulUnpair_mem_FP— the block-length product isFP
The function computed by the scanner #
The remaining output of the length-multiplication scanner when k payload
bits of the leading block have already been counted and w is the unread part
of the input: |A| · |B| copies of false for a well-formed remainder, and
nothing at all when the block framing is broken.
Equations
Instances For
Emit |A| · |B| copies of false from a pair pair A B; the empty string
on input that is not a valid pair encoding.
Equations
Instances For
The scanner #
Control states of mulLenTM.
- skip : MulPhase
Move every head off the left-end marker.
- scanA : MulPhase
Read the first symbol of a doubled payload bit.
- scanB0 : MulPhase
The first symbol of the pair was
0. - scanB1 : MulPhase
The first symbol of the pair was
1. - outer : MulPhase
Consume one symbol of the suffix, or halt at its end.
- emit : MulPhase
Walk the unary marks, emitting one
falseper mark. - rew : MulPhase
Rewind the work head to cell one.
- done : MulPhase
Halt.
Instances For
Equations
- One or more equations did not get rendered due to their size.
The length-multiplication scanner. Parses the leading self-delimiting
block into |A| unary marks on its work tape, then emits |A| zeros for each
of the |B| remaining input symbols. Computes mulUnpair.
Equations
- One or more equations did not get rendered due to their size.