Computed native CountPrime depth #
The actual runtime original side is copied into the existing native ceiling-logarithm routine. Four constants, the call, and copying its result into the counter metadata are charged. No depth/logarithm certificate or precomputed padding parameter is supplied.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_logarithm {w : ℕ} (x : WordRAM.Data 128) (hw : WordRAM.Fits w (x.regs Reg.side + Nat.clog 2 (x.regs Reg.side) + 8)) :
∃ (y : WordRAM.Data 128),
WordRAM.ExecWithin w logarithm x y (5 * Nat.clog 2 (x.regs Reg.side) + 11) ∧ y.regs Reg.depth = Nat.clog 2 (x.regs Reg.side) ∧ y.regs Reg.zero = 0 ∧ y.regs Reg.one = 1 ∧ y.regs Reg.two = 2 ∧ y.regs Reg.four = 4 ∧ y.mem = x.mem ∧ ∀ (i : Fin 128),
4 ≤ ↑i → i ≠ Reg.depth → i ≠ Reg.zero → i ≠ Reg.one → i ≠ Reg.two → i ≠ Reg.four → y.regs i = x.regs i
Compute the real ceiling binary logarithm and establish the four native constants. All original counter argument registers and memory are preserved.