Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Migration.ParamsCompute.TargetCap

Overflow-Free Runtime targetCap Evaluator (computeTargetCapProg) #

Provides computeTargetCapProg, a parameter-free (¬ReadsWidth) Memory.Prog evaluator computing targetCap U n = if n = 0 then 0 else min (2 * n) U from word 0 (U - 1) of the root header in at most 1 memory operation without intermediate 2 * n word overflow, together with its RealizesBounded .exact certificate (realizesBounded_computeTargetCap) and functional specification (computeTargetCapProg_spec).

Main definitions #

Main results #

Evaluate targetCap U n = if n = 0 then 0 else min (2 * n) U from [hdrBase] (= U - 1) without intermediate 2 * n overflow (¬ReadsWidth).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.computeTargetCapProg_spec {w U V N_old n_hdr n_init_hdr hdrBase n : ℕ} {s : Memory.State} (hhdr : RootHeaderValid U V w N_old n_hdr n_init_hdr hdrBase s.mem) (hfr : hdrBase < s.frontier) (hnU : n ≤ U) (hfit1 : WordRAM.Fits w 1) :

Functional specification and ≤ 1-read cost bound for computeTargetCapProg.