Concrete sparse-store arithmetic instruction kernel #
This layer joins the width-efficient arithmetic machines to encoded sparse update. The destination address and two looked-up operands are supplied on canonical work tapes; the arithmetic result is written directly to the update controller's replacement tape, so no value-sized bridge is hidden between the two phases.
The three arithmetic operations shared by RAM register instructions.
- add : BinaryInstrOp
- sub : BinaryInstrOp
- mul : BinaryInstrOp
Instances For
Eighteen pairwise-distinct tapes used by arithmetic followed by sparse
update. Slots 0..12 are the update controller, slots 13 and 14 are the
operands, and slots 15..17 are multiplication scratch.
Complete injective physical assignment.
- injective : Function.Injective self.idx
No two semantic roles alias.
Instances For
The thirteen-tape sparse-update view.
Instances For
First looked-up arithmetic operand.
Instances For
Second looked-up arithmetic operand.
Instances For
Multiplication's shifted-multiplicand scratch tape.
Instances For
Multiplication's first alternating scratch tape.
Instances For
Multiplication's second alternating scratch tape.
Instances For
Parent-slot inequality gives physical tape inequality.
Parent slots for a reusable lookup whose destination is lhs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reusable sparse lookup view targeting the first operand.
Equations
Instances For
Parent slots for a reusable lookup whose destination is rhs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reusable sparse lookup view targeting the second operand.
Equations
Instances For
Parent slots for a loaded indirect read. The first operand supplies the runtime address and the update replacement tape receives the loaded value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reusable loaded lookup view for indirect load.
Equations
- tapes.indirectLoadLookup = { idx := fun (i : Fin 14) => tapes.idx (Complexity.RAM.RegisterStore.Machine.BinaryInstructionTapes.indirectLoadLookupSlot i), injective := ⋯ }
Instances For
Multiplication-role parent slots. The accumulator deliberately aliases the
update replacement slot 10.
Equations
- Complexity.RAM.RegisterStore.Machine.BinaryInstructionTapes.mulSlot i = match ↑i with | 0 => 13 | 1 => 14 | 2 => 10 | 3 => 15 | 4 => 16 | x => 17
Instances For
Six-tape multiplication view, with its accumulator on update replacement.
Equations
Instances For
The addition/subtraction operands and result are pairwise distinct.
The same physical inequalities as a subtraction certificate.
The arithmetic/store ABI together with one disjoint canonical program- counter tape. Nineteen work tapes suffice for every RAM instruction.
- data : BinaryInstructionTapes n
The complete data-instruction assignment.
- pc : Fin n
Canonical binary program counter.
The program counter aliases no data-instruction role.
Instances For
Every data-instruction role is distinct from the program counter.
The first loaded operand is distinct from the program counter.
The program counter is distinct from the first loaded operand.
No tape owned by the first lookup aliases the program counter.
Pure result of the selected arithmetic operation.
Equations
- Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.add.eval x✝¹ x✝ = x✝¹ + x✝
- Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.sub.eval x✝¹ x✝ = x✝¹ - x✝
- Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.mul.eval x✝¹ x✝ = x✝¹ * x✝
Instances For
Concrete arithmetic phase selected in finite control.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.RAM.RegisterStore.Machine.binaryInstructionArithmeticTM tapes Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.mul = Complexity.TM.binaryShiftMulTM tapes.mul
Instances For
Uniform endpoint of the selected arithmetic phase.
- lhsValue : (finalWork tapes.lhs).HasBinaryNat lhs
First operand is restored canonically.
- rhsValue : (finalWork tapes.rhs).HasBinaryNat rhs
Second operand is restored canonically.
- result : (finalWork tapes.update.replacement).HasBinaryNat (op.eval lhs rhs)
The update replacement tape contains the selected result.
- shift : (finalWork tapes.shift).HasBinaryNat 0
Multiplication scratch is reset.
- tmp : (finalWork tapes.tmp).HasBinaryNat 0
First alternating scratch is reset.
- dbl : (finalWork tapes.dbl).HasBinaryNat 0
Second alternating scratch is reset.
Every work head is parked at the phase boundary.
- frame (i : Fin n) : i ≠ tapes.lhs → i ≠ tapes.rhs → i ≠ tapes.update.replacement → i ≠ tapes.shift → i ≠ tapes.tmp → i ≠ tapes.dbl → finalWork i = initialWork i
Tapes outside the six arithmetic roles are literally preserved.
Instances For
Uniform endpoint of arithmetic followed by encoded sparse update.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Arithmetic followed immediately by the fixed sparse update controller.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load two direct register operands, prepare the direct destination address, then run arithmetic and sparse update.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load an address register, perform the loaded indirect read into the update replacement tape, synthesize the direct destination, and update the store.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Synthesize an immediate value and direct destination, then update the sparse store.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Load the indirect destination and direct source, copy both into the update ABI, and update the sparse store.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace the canonical binary program counter by a fixed literal.
Equations
- Complexity.RAM.RegisterStore.Machine.setProgramCounterTM pc target = (Complexity.TM.resetBinaryWorkTM pc).seqTM (Complexity.TM.binaryAddConstTM pc target)
Instances For
Conditional-zero control instruction. The fixed sparse read is cleared after branching so the reusable lookup ABI is restored at the endpoint.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Unconditional jump control instruction.
Equations
- Complexity.RAM.RegisterStore.Machine.jumpInstructionTM tapes target = Complexity.RAM.RegisterStore.Machine.setProgramCounterTM tapes.pc target
Instances For
Halt is represented by a one-step exact no-op instruction kernel. The outer run controller detects halt before beginning another iteration.
Instances For
Canonical entry boundary for a control instruction.
- lookup : EntryLookupStaticReady tapes.data.lhsLookup store work
The fixed sparse-lookup ABI is ready.
- pc : (work tapes.pc).HasBinaryNat pcValue
The program counter contains the represented value.
Instances For
Semantic endpoint shared by the three control-only instruction forms.
- ready : ControlInstructionReady tapes store pcValue finalWork
The clean control ABI is restored with the new program counter.
- sourceCells : (finalWork tapes.data.update.entry.source).cells = (initialWork tapes.data.update.entry.source).cells
The encoded source cells are read-only.
- frame (i : Fin n) : i ≠ tapes.pc → (∀ (slot : Fin 14), i ≠ tapes.data.lhsLookup.idx slot) → finalWork i = initialWork i
Every tape outside the lookup ABI and PC assignment is preserved.
Instances For
Runtime for replacing a canonical program counter by a literal.
Equations
- Complexity.RAM.RegisterStore.Machine.setProgramCounterTime pcValue target = Complexity.TM.resetBinaryWorkTime 1 pcValue.bits.length + 1 + Complexity.TM.binaryAddConstTime target 0
Instances For
Runtime for conditional-zero control, including lookup and operand reset.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runtime for an unconditional jump.
Equations
- Complexity.RAM.RegisterStore.Machine.jumpInstructionTime pcValue target = Complexity.RAM.RegisterStore.Machine.setProgramCounterTime pcValue target
Instances For
Runtime for the exact halt no-op.
Instances For
Boundary after the two direct source-register lookups.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Boundary after the direct destination literal has been synthesized on the update query tape.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exact update-controller ABI established by the lookup and address-loading prefix of a direct arithmetic instruction.
- scanner : EntryScanReady tapes.update.entry (List.flatMap Entry.encode store) destination.bits work work
- lhs : (work tapes.lhs).HasBinaryNat (read store source₀)
- rhs : (work tapes.rhs).HasBinaryNat (read store source₁)
- replacement : (work tapes.update.replacement).HasBinaryNat 0
- shift : (work tapes.shift).HasBinaryNat 0
- tmp : (work tapes.tmp).HasBinaryNat 0
- dbl : (work tapes.dbl).HasBinaryNat 0
- remaining : (work tapes.update.remaining).HasBinaryNat (List.length store)
- found : (work tapes.update.found).HasBinaryNat 0
- resultCount : (work tapes.update.resultCount).HasBinaryNat (List.length store)
Instances For
Semantic endpoint of a complete direct arithmetic instruction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Semantic endpoint of a complete indirect load.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Semantic endpoint of one immediate assignment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Semantic endpoint of one indirect store.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Operation-specific arithmetic budget.
Equations
- Complexity.RAM.RegisterStore.Machine.binaryInstructionArithmeticTime Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.add lhs rhs = Complexity.TM.binaryRippleAddTime lhs rhs
- Complexity.RAM.RegisterStore.Machine.binaryInstructionArithmeticTime Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.sub lhs rhs = Complexity.TM.binaryRippleSubTime lhs rhs
- Complexity.RAM.RegisterStore.Machine.binaryInstructionArithmeticTime Complexity.RAM.RegisterStore.Machine.BinaryInstrOp.mul lhs rhs = Complexity.TM.binaryShiftMulTime lhs rhs
Instances For
Complete arithmetic-plus-update budget, including the composition seam.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete direct arithmetic-instruction budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete indirect-load instruction budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete immediate-assignment instruction budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete indirect-store instruction budget.
Equations
- One or more equations did not get rendered due to their size.