Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.Setup

Computed counter metadata and native setup #

The actual logarithm and power routines determine the padding and every pointer. The internal register predicate records that execution's resulting words; it is not an algorithm argument or a supplied layout. Later native stages preserve these metadata registers.

Original scalar/pointer envelope for actual address, index, length and count arithmetic. The signed arithmetic magnitude envelope is accounted for separately.

Exactly the persistent counter metadata, excluding its mutable raw result.

Instances For

    The actual computed layout, protected original pointers and initialized constants.

    theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.CounterRegisters.congr {n p k scratch a b c : ℕ} {x y : WordRAM.Data 128} (h : CounterRegisters n p k scratch a b c x) (keep : ∀ (j : Fin 128), MetadataRegister j → y.regs j = x.regs j) :
    CounterRegisters n p k scratch a b c y

    Native stages that leave the persistent metadata unchanged retain its computed meaning.

    theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_setup {W n p scratch a b c : ℕ} (x : WordRAM.Data 128) (hp0 : 0 < p) (hn : x.regs Reg.side = n) (hp : x.regs Reg.modulus = p) (ha : x.regs Reg.inputAB = a) (hb : x.regs Reg.inputBC = b) (hc : x.regs Reg.inputAC = c) (hs : x.regs Reg.scratch = scratch) (hw : WordRAM.Fits W (layoutWordBound n p (Nat.clog 2 n) scratch + n + Nat.clog 2 n + 8)) :
    ∃ (y : WordRAM.Data 128), WordRAM.ExecWithin W setup x y (9 * Nat.clog 2 n + 31) ∧ CounterRegisters n p (Nat.clog 2 n) scratch a b c y ∧ y.mem = x.mem

    Execute the actual depth calculation and layout, with every argument, constant, power and pointer instruction charged. The input contains no padding-depth or layout certificate.