Dense public input with a sparse mutable overlay -- definitions #
The ordinary sparse snapshot eagerly materializes every nonzero public-input
register. That representation is convenient but occupies Theta(n log n)
cells before the RAM executes a step. This module separates the immutable input
bank from the mutable register overlay.
An overlay entry (address, tag) represents the actual value tag - 1.
Because every stored tag is positive, an absent address is distinguishable from
an explicit write of zero (tag = 1). Absent reads fall through to the dense
public-input ABI RAM.initRegs input.
Mutable tagged entries layered over the immutable public-input bank.
Instances For
Record an explicit mutable value. The positive tag preserves written zero.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.write overlay address value = Complexity.RAM.RegisterStore.write overlay address (value + 1)
Instances For
A valid overlay has unique addresses and positive tags.
Equations
Instances For
Register zero is materialized in every concrete overlay. This lets the dense-input lookup specialize its fallback path to positive input addresses.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.CoversZero overlay = (Complexity.RAM.RegisterStore.read overlay 0 ≠ 0)
Instances For
Full representation invariant for the mutable overlay.
Equations
Instances For
Decode the dense-input/overlay pair to a total RAM register file.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.decode input overlay = Complexity.RAM.RegisterStore.DenseOverlay.read input overlay
Instances For
A finite mutable overlay plus program counter. The immutable input remains on the Turing input tape and is not duplicated in this snapshot.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode one dense-overlay snapshot against its immutable public input.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.decode input snapshot = { pc := snapshot.pc, regs := Complexity.RAM.RegisterStore.DenseOverlay.decode input snapshot.overlay }
Instances For
The initial mutable overlay materializes only R₀ = input.length; all input
bits remain in the read-only dense bank. The stored positive tag is
input.length + 1.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.initial input = { pc := 0, overlay := Complexity.RAM.RegisterStore.DenseOverlay.write [] 0 input.length }
Instances For
Instruction selected by the current program counter.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.curInstr program snapshot = program[snapshot.pc]?.getD Complexity.RAM.Instr.halt
Instances For
Whether the selected instruction is halt.
Equations
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.Halted program snapshot = (Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.curInstr program snapshot = Complexity.RAM.Instr.halt)
Instances For
Equations
Execute one RAM instruction against the decoded input/overlay register file, recording the result as a positive tag.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.stepInstr input (Complexity.RAM.Instr.jmp target) x✝ = { pc := target, overlay := x✝.overlay }
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.stepInstr input Complexity.RAM.Instr.halt x✝ = x✝
Instances For
Fuel-bounded dense-overlay execution, stopping once halted.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RAM.RegisterStore.DenseOverlay.Snapshot.run program input 0 x✝ = x✝