RAM snapshot word-width decoder — definitions #
RAM.RegisterStore.Machine.wordWidthTM is the first concrete Turing-machine
phase of the reverse RAM simulation. It scans the unary-width prefix of one
self-delimiting snapshot word and increments a canonical binary counter once
per 1. The source head stops on the zero separator, ready for the payload
copy phase.
Scan the unary prefix on work tape sourceIdx and store its length in
canonical little-endian binary on work tape widthIdx. The two indices must
be distinct for the semantic theorem.
Equations
- Complexity.RAM.RegisterStore.Machine.wordWidthTM sourceIdx widthIdx = Complexity.TM.forWorkOnesTM sourceIdx (Complexity.TM.binarySuccTM widthIdx)
Instances For
Exact transition count for decoding a unary prefix of length width.
Equations
Instances For
Control states for copying one fixed-width payload bit.
- copy : PayloadBitPhase
- done : PayloadBitPhase
Instances For
PayloadBitPhase has exactly two states.
Equations
- One or more equations did not get rendered due to their size.
Copy the bit under sourceIdx to the append position on targetIdx,
advancing both heads once. The semantic theorem assumes distinct indices and
that the source reads a bit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pairwise distinct work tapes used by the bounded payload decoder.
Source and target tapes are distinct.
Source and loop-counter tapes are distinct.
Source and width-limit tapes are distinct.
Target and loop-counter tapes are distinct.
Target and width-limit tapes are distinct.
Counter and width-limit tapes are distinct.
Instances For
Copy exactly the number of payload bits recorded on widthIdx.
counterIdx is the canonical binary loop counter and targetIdx is an
appendable binary prefix.
Equations
- Complexity.RAM.RegisterStore.Machine.wordPayloadTM sourceIdx targetIdx counterIdx widthIdx = (Complexity.RAM.RegisterStore.Machine.payloadBitTM sourceIdx targetIdx).binaryForTM counterIdx widthIdx
Instances For
Exact transition count for a complete fixed-width payload copy.
Equations
- Complexity.RAM.RegisterStore.Machine.wordPayloadTime width = Complexity.TM.binaryForLoopTime (fun (x : ℕ) => 1) width 0 width
Instances For
Control states for consuming the zero separator between a word's unary width and fixed-width payload.
- skip : WordSeparatorPhase
- done : WordSeparatorPhase
Instances For
WordSeparatorPhase has exactly two states.
Equations
- One or more equations did not get rendered due to their size.
Consume exactly one zero separator on the selected source work tape.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode one complete self-delimiting word by scanning its unary width, consuming the separator, and copying exactly that many payload bits.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact transition count for complete word decoding, including both sequential-composition seams.
Equations
Instances For
Linear unary-marker decoder #
Pairwise-distinct source, target, and unary-marker tapes for the optimized word decoder.
Source and target tapes are distinct.
Source and marker tapes are distinct.
Target and marker tapes are distinct.
Instances For
Control phases of the optimized self-delimiting word decoder.
- mark : LinearWordPhase
Copy the unary width prefix to the marker tape.
- rewind : LinearWordPhase
Rewind the copied unary marker while parking the payload cursor.
- copy : LinearWordPhase
Consume one marker and copy one payload bit per transition.
- done : LinearWordPhase
Halt after the marker is exhausted.
Instances For
LinearWordPhase has exactly four states.
Equations
- One or more equations did not get rendered due to their size.
Decode one unary-width/fixed-payload word in a single linear pass.
The prefix pass copies one unary marker per width bit. After rewinding that
marker tape, the payload pass advances source, target, and marker together.
This removes the old payload loop's repeated full binary-counter comparison.
The marker tape starts as an empty appendable prefix and finishes containing
width ones with its head on the following blank.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact transition count of the optimized decoder on a well-formed width
width word.
Equations
- Complexity.RAM.RegisterStore.Machine.wordDecodeLinearTime width = 3 * width + 3