Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.Layout

Actual native CountPrime workspace calculation #

The existing native power routine computes the padded side from the computed depth. Ordinary arithmetic instructions then calculate every matrix/residue/spread/workspace pointer. The register assertions below describe the actual resulting state; no layout object is supplied to the program. All intermediate fits follow from one original-parameter numerical envelope. This module performs no allocation, clearing or memory copy.

Original-parameter physical envelope for real layout arithmetic and power evaluation.

The actual metadata words computed by the native layout routine. This internal postcondition contains no execution, time or multiplication contract.

Registers actually written by layout, including the complete low power bank.

Instances For
    theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_layout {w n p k scratch : ℕ} (x : WordRAM.Data 128) (hp : 0 < p) (hn : x.regs Reg.side = n) (hpr : x.regs Reg.modulus = p) (hk : x.regs Reg.depth = k) (hs : x.regs Reg.scratch = scratch) (h2 : x.regs Reg.two = 2) (hw : WordRAM.Fits w (layoutWordBound n p k scratch)) :
    ∃ (y : WordRAM.Data 128), WordRAM.ExecWithin w layout x y (4 * k + 20) ∧ LayoutRegisters n p k scratch y ∧ y.mem = x.mem ∧ ∀ (i : Fin 128), ¬LayoutLocal i → y.regs i = x.regs i

    Compute every layout word through actual power/arithmetic instructions. All memory and original argument registers survive; every intermediate fit follows from original n,p,k,scratch.