Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctSearch

Succinct Dictionary Bucket Search and Query in Memory.Prog via realize #

This module implements Phase 2 overflow search (resolveOvfStepProg, ovfStepProg, ovfLoopProg, searchOverflowProg), the combined two-phase bucket search (searchBucketProg), and the dictionary lookup body (queryBodyProg) in the Memory.Prog monad, certifying each via Realizes .exact and the realize tactic.

Main definitions #

Main results #

Section 1: Overflow Slot Resolution (resolveOvfStepProg) #

@[reducible, inline]

Dictionary parameters x.1.1 in a parameter-free step input ((dp, arg), state).

@[reducible, inline]

Base address base in a parameter-free overflow-resolver input ((dp, (base, b)), extra).

@[reducible, inline]

Bucket index b in a parameter-free overflow-resolver input ((dp, (base, b)), extra).

@[reducible, inline]

Base address d.1.1 in a bucket-prefixed input ((base, b), extra).

@[reducible, inline]

Bucket index d.1.2 in a bucket-prefixed input ((base, b), extra).

@[reducible, inline]

Logical slot index j in an overflow-step input (ctx, (j, p_cur)).

@[reducible, inline]

Current slab pointer p_cur in an overflow-step input (ctx, (j, p_cur)).

Parameter-free single-step overflow slot resolver (d = ((dp, (base, b)), (j, p_cur))), returning (slotOf n_max gm b j, p_next) where p_next advances along slabAbove at the end of each full slab (off = 0 and j + 1 < q_b * slabSize n_max).

Single-step overflow slot resolver (d = ((base, b), (j, p_cur))), returning (slotOf n_max gm b j, p_next) where p_next advances along slabAbove at the end of each full slab (off = 0 and j + 1 < q_b * slabSize n_max).

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.resolveOvfStepGenProg_mk (U V w n_max h_space : ℕ) (d1 d2 : ℕ × ℕ) :
resolveOvfStepGenProg ((mkDictParams U V w n_max h_space, d1), d2) = resolveOvfStepProg U V w n_max h_space (d1, d2)

Precondition for resolveOvfStepProg (d = ((base, b), (j, p_cur))).

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.resolveOvfStepGenPre_mk (U V w₀ n_max h_space w : ℕ) (d1 d2 : ℕ × ℕ) (s : Memory.State) :
ResolveOvfStepGenPre w ((mkDictParams U V w₀ n_max h_space, d1), d2) s ↔ ResolveOvfStepPre U V w₀ n_max h_space w (d1, d2) s
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.clientResult_resolveOvfStepProg {U V w n_max h_space : ℕ} {d : (ℕ × ℕ) × ℕ × ℕ} (s : Memory.State) (hb_pos : 0 < FeistelQuotient.bucketBits n_max) (hb : ovfBucketIdx d < FeistelQuotient.numBuckets n_max) (hj_bc : ovfResolveIdx d < bCount n_max (gmAt (ovfBucketBase d) U V w n_max h_space s.mem) (ovfBucketIdx d)) (hinv : SlotStoreInv n_max (gmAt (ovfBucketBase d) U V w n_max h_space s.mem)) (hp : ovfResolveIdx d < gmAt (ovfBucketBase d) U V w n_max h_space s.mem (gmQIdx (ovfBucketIdx d)) * SuccinctBucket.slabSize n_max → ovfResolveSlabPtr d = slabPtrOf n_max (gmAt (ovfBucketBase d) U V w n_max h_space s.mem) (ovfBucketIdx d) (ovfResolveIdx d / SuccinctBucket.slabSize n_max)) :
have gm := gmAt (ovfBucketBase d) U V w n_max h_space s.mem; have res := (Memory.spec 0).clientResult s (resolveOvfStepProg U V w n_max h_space d); res.1 = slotOf n_max gm (ovfBucketIdx d) (ovfResolveIdx d) ∧ (ovfResolveIdx d + 1 < gm (gmQIdx (ovfBucketIdx d)) * SuccinctBucket.slabSize n_max → res.2 = slabPtrOf n_max gm (ovfBucketIdx d) ((ovfResolveIdx d + 1) / SuccinctBucket.slabSize n_max))

Section 2: Phase 2 Overflow Search (ovfStepProg, ovfLoopProg, searchOverflowProg) #

@[reducible, inline]

Bucket location (base, b) in a query-prefixed input (((base, b), q_target), extra).

@[reducible, inline]

Base address base in a query-prefixed input (((base, b), q_target), extra).

@[reducible, inline]

Bucket index b in a query-prefixed input (((base, b), q_target), extra).

@[reducible, inline]

Target quotient q_target in a query-prefixed input (((base, b), q_target), extra).

@[reducible, inline]

Cursor (j, p_cur) in an overflow-search accumulator ((((j, p_cur), found), j_found), phys_found).

@[reducible, inline]

Current logical slot index j in an overflow-search accumulator.

@[reducible, inline]

Current slab pointer p_cur in an overflow-search accumulator.

@[reducible, inline]

Found flag found in an overflow-search accumulator.

@[reducible, inline]

Matched logical slot index j_found in an overflow-search accumulator.

@[reducible, inline]

Matched physical slot phys_found in an overflow-search accumulator.

@[reducible, inline]

Bucket location (base, b) in a parameter-free overflow-search step input ((dp, ((base, b), q_target)), acc).

@[reducible, inline]

Base address base in a parameter-free overflow-search step input ((dp, ((base, b), q_target)), acc).

@[reducible, inline]

Target quotient q_target in a parameter-free overflow-search step input ((dp, ((base, b), q_target)), acc).

Parameter-free step of Phase 2 overflow search (x = ((dp, ((base, b), q_target)), ((((j, p_cur), found), j_found), phys_found))).

One step of Phase 2 overflow search (x = (((base, b), q_target), ((((j, p_cur), found), j_found), phys_found))). Resolves (phys, p_next) ← resolveOvfStepProg and reads q_val at phys, recording the first matching slot (1, j, phys) when found = 0 ∧ q_val = q_target.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.ovfStepGenProg_mk (U V w n_max h_space : ℕ) (x1 : (ℕ × ℕ) × ℕ) (x2 : (((ℕ × ℕ) × ℕ) × ℕ) × ℕ) :
ovfStepGenProg ((mkDictParams U V w n_max h_space, x1), x2) = ovfStepProg U V w n_max h_space (x1, x2)

Precondition for ovfStepProg.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.ovfStepGenPre_mk (U V w₀ n_max h_space w : ℕ) (x1 : (ℕ × ℕ) × ℕ) (x2 : (((ℕ × ℕ) × ℕ) × ℕ) × ℕ) (s : Memory.State) :
OvfStepGenPre w ((mkDictParams U V w₀ n_max h_space, x1), x2) s ↔ OvfStepPre U V w₀ n_max h_space w (x1, x2) s
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.clientResult_ovfStepProg {U V w n_max h_space : ℕ} {x : ((ℕ × ℕ) × ℕ) × (((ℕ × ℕ) × ℕ) × ℕ) × ℕ} (s : Memory.State) (hb_pos : 0 < FeistelQuotient.bucketBits n_max) (hb : ovfQueryBucket x < FeistelQuotient.numBuckets n_max) (hj_bc : ovfAccSlotIdx x.2 < bCount n_max (gmAt (ovfQueryBase x) U V w n_max h_space s.mem) (ovfQueryBucket x)) (hinv : SlotStoreInv n_max (gmAt (ovfQueryBase x) U V w n_max h_space s.mem)) (hp : ovfAccSlotIdx x.2 < gmAt (ovfQueryBase x) U V w n_max h_space s.mem (gmQIdx (ovfQueryBucket x)) * SuccinctBucket.slabSize n_max → ovfAccSlabPtr x.2 = slabPtrOf n_max (gmAt (ovfQueryBase x) U V w n_max h_space s.mem) (ovfQueryBucket x) (ovfAccSlotIdx x.2 / SuccinctBucket.slabSize n_max)) :
have gm := gmAt (ovfQueryBase x) U V w n_max h_space s.mem; have pair := (Memory.spec 0).clientResult s (resolveOvfStepProg U V w n_max h_space (ovfQueryLoc x, ovfAccCursor x.2)); have phys := slotOf n_max gm (ovfQueryBucket x) (ovfAccSlotIdx x.2); have q_val := quotAt (ovfQueryBase x) U w n_max h_space s.mem phys; ((Memory.spec 0).clientResult s (ovfStepProg U V w n_max h_space x) = if ovfAccFound x.2 = 0 then if q_val = ovfQueryQuot x then ((((ovfAccSlotIdx x.2 + 1, pair.2), 1), ovfAccSlotIdx x.2), phys) else ((((ovfAccSlotIdx x.2 + 1, pair.2), 0), ovfAccMatchIdx x.2), ovfAccPhys x.2) else ((((ovfAccSlotIdx x.2 + 1, pair.2), ovfAccFound x.2), ovfAccMatchIdx x.2), ovfAccPhys x.2)) ∧ (ovfAccSlotIdx x.2 + 1 < gm (gmQIdx (ovfQueryBucket x)) * SuccinctBucket.slabSize n_max → pair.2 = slabPtrOf n_max gm (ovfQueryBucket x) ((ovfAccSlotIdx x.2 + 1) / SuccinctBucket.slabSize n_max))
@[reducible, inline]

Loop context d.1.1 in an overflow-loop input ((ctx, acc), fuel).

@[reducible, inline]

Initial accumulator d.1.2 in an overflow-loop input ((ctx, acc), fuel).

Parameter-free wrapper for iterate ovfStepGenProg matching Realizes.iterate₀.

Wrapper for iterate (ovfStepProg ...) matching Realizes.iterate₀.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.iterate_ovfStepGenProg_mk (U V w n_max h_space : ℕ) (ctx : (ℕ × ℕ) × ℕ) (m : ℕ) (acc : (((ℕ × ℕ) × ℕ) × ℕ) × ℕ) :
WordRAM.Realization.iterate ovfStepGenProg (mkDictParams U V w n_max h_space, ctx) m acc = WordRAM.Realization.iterate (ovfStepProg U V w n_max h_space) ctx m acc
@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.ovfLoopGenProg_mk (U V w n_max h_space : ℕ) (ctx : (ℕ × ℕ) × ℕ) (acc : (((ℕ × ℕ) × ℕ) × ℕ) × ℕ) (m : ℕ) :
ovfLoopGenProg (((mkDictParams U V w n_max h_space, ctx), acc), m) = ovfLoopProg U V w n_max h_space ((ctx, acc), m)
@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.iterationSafe_ovfStepGenProg_mk (U V w₀ n_max h_space w : ℕ) (ctx : (ℕ × ℕ) × ℕ) (m : ℕ) (acc : (((ℕ × ℕ) × ℕ) × ℕ) × ℕ) (s : Memory.State) :
WordRAM.Realization.iterationSafe ovfStepGenProg OvfStepGenPre w (mkDictParams U V w₀ n_max h_space, ctx) m acc s ↔ WordRAM.Realization.iterationSafe (ovfStepProg U V w₀ n_max h_space) (OvfStepPre U V w₀ n_max h_space) w ctx m acc s
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.iterate_ovfStepProg_spec {U V w₀ n_max h_space w base b q_target : ℕ} {s : Memory.State} (hb_pos : 0 < FeistelQuotient.bucketBits n_max) (henv : DictEnvGen w (mkDictParams U V w₀ n_max h_space) base) (hb : b < FeistelQuotient.numBuckets n_max) (hinv : SlotStoreInv n_max (gmAt base U V w₀ n_max h_space s.mem)) (m j p_cur found j_found phys_found : ℕ) :
j + m ≤ bCount n_max (gmAt base U V w₀ n_max h_space s.mem) b → (j < gmAt base U V w₀ n_max h_space s.mem (gmQIdx b) * SuccinctBucket.slabSize n_max → p_cur = slabPtrOf n_max (gmAt base U V w₀ n_max h_space s.mem) b (j / SuccinctBucket.slabSize n_max)) → have prog := WordRAM.Realization.iterate (ovfStepProg U V w₀ n_max h_space) ((base, b), q_target) m ((((j, p_cur), found), j_found), phys_found); (Memory.spec 0).clientState s prog = s ∧ WordRAM.Realization.memoryCost prog s ≤ 6 * m ∧ WordRAM.Realization.iterationSafe (ovfStepProg U V w₀ n_max h_space) (OvfStepPre U V w₀ n_max h_space) w ((base, b), q_target) m ((((j, p_cur), found), j_found), phys_found) s ∧ have res := (Memory.spec 0).clientResult s prog; if found = 0 then if ∃ (k : ℕ), j ≤ k ∧ k < j + m ∧ quotAt base U w₀ n_max h_space s.mem (slotOf n_max (gmAt base U V w₀ n_max h_space s.mem) b k) = q_target then ovfAccFound res = 1 ∧ j ≤ ovfAccMatchIdx res ∧ ovfAccMatchIdx res < j + m ∧ quotAt base U w₀ n_max h_space s.mem (slotOf n_max (gmAt base U V w₀ n_max h_space s.mem) b (ovfAccMatchIdx res)) = q_target ∧ res.2 = slotOf n_max (gmAt base U V w₀ n_max h_space s.mem) b (ovfAccMatchIdx res) else ovfAccFound res = 0 else ovfAccFound res = found ∧ ovfAccMatchIdx res = j_found ∧ res.2 = phys_found

Structural induction lemma for iterate (ovfStepProg ...) over m overflow slots j .. j + m - 1.

@[reducible, inline]

Base address d.2.1 in an overflow-init call (dp, (base, b)).

@[reducible, inline]

Bucket index d.2.2 in an overflow-init call (dp, (base, b)).

Parameter-free helper initializing (p_init, fuel) for Phase 2 overflow search (d = (dp, (base, b))).

Helper initializing (p_init, fuel) for Phase 2 overflow search (d = (base, b)).

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.initOvfSearchGenProg_mk (U V w n_max h_space : ℕ) (d : ℕ × ℕ) :
initOvfSearchGenProg (mkDictParams U V w n_max h_space, d) = initOvfSearchProg U V w n_max h_space d

In a bucket whose full slabs hold at least effBucketCap items, the last directory slot is in range of GlobalMeta, it stores the bucket's last directory slab, and that slab is below the slab-pool capacity. The slot index is stated unfolded, as the overflow search reads it.

theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.clientResult_initOvfSearchProg {U V w n_max h_space : ℕ} {d : ℕ × ℕ} (s : Memory.State) (hb_pos : 0 < FeistelQuotient.bucketBits n_max) (hb : d.2 < FeistelQuotient.numBuckets n_max) (hinv : SlotStoreInv n_max (gmAt d.1 U V w n_max h_space s.mem)) :
have gm := gmAt d.1 U V w n_max h_space s.mem; have res := (Memory.spec 0).clientResult s (initOvfSearchProg U V w n_max h_space d); res.2 = bCount n_max gm d.2 - SuccinctBucket.effBucketCap n_max ∧ (SuccinctBucket.effBucketCap n_max < bCount n_max gm d.2 → SuccinctBucket.effBucketCap n_max < gm (gmQIdx d.2) * SuccinctBucket.slabSize n_max → res.1 = slabPtrOf n_max gm d.2 (SuccinctBucket.effBucketCap n_max / SuccinctBucket.slabSize n_max))
@[reducible, inline]

Base address base in a parameter-free overflow-search call (dp, ((base, b), q_target)).

@[reducible, inline]

Bucket index b in a parameter-free overflow-search call (dp, ((base, b), q_target)).

@[reducible, inline]

Bucket location (base, b) in a parameter-free overflow-search call (dp, ((base, b), q_target)).

@[reducible, inline]

Found flag (1 if matched, 0 otherwise) in a search result ((found, j_found), phys).

@[reducible, inline]

Matched bucket-local slot index j_found in a search result ((found, j_found), phys).

Parameter-free Phase 2 overflow search searchOverflowGenProg: scans overflow slots j ∈ [effBucketCap n_max, bCount n_max gm b) in bucket b = ovfSearchBucket d for quotient q_target = d.2.2, returning ((found, j_found), phys_found).

Phase 2 overflow search searchOverflowProg: scans overflow slots j ∈ [effBucketCap n_max, bCount n_max gm b) in bucket b = d.1.2 for quotient q_target = d.2, returning ((found, j_found), phys_found).

@[simp]

Precondition for searchOverflowProg (d = ((base, b), q_target)).

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.searchOverflowGenPre_mk (U V w₀ n_max h_space w : ℕ) (d : (ℕ × ℕ) × ℕ) (s : Memory.State) :
SearchOverflowGenPre w (mkDictParams U V w₀ n_max h_space, d) s ↔ SearchOverflowPre U V w₀ n_max h_space w d s
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.searchOverflowProg_spec {U V w₀ n_max h_space w : ℕ} {d : (ℕ × ℕ) × ℕ} {s : Memory.State} (henv : DictEnvGen w (mkDictParams U V w₀ n_max h_space) (ovfBucketBase d)) (hb : ovfBucketIdx d < FeistelQuotient.numBuckets n_max) (hinv : SlotStoreInv n_max (gmAt (ovfBucketBase d) U V w₀ n_max h_space s.mem)) :
have gm := gmAt (ovfBucketBase d) U V w₀ n_max h_space s.mem; have prog := searchOverflowProg U V w₀ n_max h_space d; (Memory.spec 0).clientState s prog = s ∧ WordRAM.Realization.memoryCost prog s ≤ 8 + 6 * (bCount n_max gm (ovfBucketIdx d) - SuccinctBucket.effBucketCap n_max) ∧ (0 < FeistelQuotient.bucketBits n_max → have init := (Memory.spec 0).clientResult s (initOvfSearchProg U V w₀ n_max h_space d.1); WordRAM.Realization.iterationSafe (ovfStepProg U V w₀ n_max h_space) (OvfStepPre U V w₀ n_max h_space) w d init.2 ((((min n_max (SuccinctBucket.effBucketCap n_max), init.1), 0), 0), 0) s) ∧ have res := (Memory.spec 0).clientResult s prog; if ∃ (j : ℕ), SuccinctBucket.effBucketCap n_max ≤ j ∧ j < bCount n_max gm (ovfBucketIdx d) ∧ quotAt (ovfBucketBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfBucketIdx d) j) = d.2 then ovfSearchFound res = 1 ∧ SuccinctBucket.effBucketCap n_max ≤ ovfSearchIdx res ∧ ovfSearchIdx res < bCount n_max gm (ovfBucketIdx d) ∧ quotAt (ovfBucketBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfBucketIdx d) (ovfSearchIdx res)) = d.2 ∧ res.2 = slotOf n_max gm (ovfBucketIdx d) (ovfSearchIdx res) else ovfSearchFound res = 0

Section 3: Combined Two-Phase Bucket Search (searchBucketProg) and queryBodyProg #

@[reducible, inline]

Found flag (1 if matched) in a searchMicroChainProg result (((ptr, found), j_found), phys_found).

@[reducible, inline]

Matched logical slot index j_found in a searchMicroChainProg result.

@[reducible, inline]

Query prefix ((base, b), q_target) in a parameter-free bucket-search call (dp, (((base, b), q_target), m)).

Parameter-free two-phase bucket search searchBucketGenProg (d = (dp, (((base, b), q_target), m))): first searches the micro-bucket chain (b, m) via searchMicroChainGenProg; if not found, searches any overflow slots j ∈ [effBucketCap n_max, bCount n_max gm b) via searchOverflowGenProg. Returns ((found, j_found), phys_found).

Two-phase bucket search searchBucketProg (d = (((base, b), q_target), m)): first searches the micro-bucket chain (b, m) via searchMicroChainProg; if not found, searches any overflow slots j ∈ [effBucketCap n_max, bCount n_max gm b) via searchOverflowProg. Returns ((found, j_found), phys_found).

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.searchBucketGenProg_mk (U V w n_max h_space : ℕ) (d : ((ℕ × ℕ) × ℕ) × ℕ) :
searchBucketGenProg (mkDictParams U V w n_max h_space, d) = searchBucketProg U V w n_max h_space d
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.searchBucketProg_spec {U V w₀ n_max h_space w : ℕ} {d : ((ℕ × ℕ) × ℕ) × ℕ} {s : Memory.State} {L : List ℕ} (henv : DictEnvGen w (mkDictParams U V w₀ n_max h_space) (ovfQueryBase d)) (hb : ovfQueryBucket d < FeistelQuotient.numBuckets n_max) (hm : d.2 < SuccinctBucket.numMicroPerBucket n_max) (hinv : SlotStoreInv n_max (gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem)) (hchain : IsDLChain n_max (lmHead n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d) d.2) (lmPrev n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) (lmNext n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) L) (hc_lt : ∀ j ∈ L, j < bCount n_max (gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) :
have gm := gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem; have prog := searchBucketProg U V w₀ n_max h_space d; (Memory.spec 0).clientState s prog = s ∧ WordRAM.Realization.memoryCost prog s ≤ 10 + 8 * L.length + 6 * (bCount n_max gm (ovfQueryBucket d) - SuccinctBucket.effBucketCap n_max) ∧ have res := (Memory.spec 0).clientResult s prog; if (∃ j ∈ L, quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j) = ovfQueryQuot d) ∨ ∃ (j : ℕ), SuccinctBucket.effBucketCap n_max ≤ j ∧ j < bCount n_max gm (ovfQueryBucket d) ∧ quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j) = ovfQueryQuot d then ovfSearchFound res = 1 ∧ ovfSearchIdx res < bCount n_max gm (ovfQueryBucket d) ∧ (ovfSearchIdx res ∈ L ∨ SuccinctBucket.effBucketCap n_max ≤ ovfSearchIdx res) ∧ quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) (ovfSearchIdx res)) = ovfQueryQuot d ∧ res.2 = slotOf n_max gm (ovfQueryBucket d) (ovfSearchIdx res) else ovfSearchFound res = 0

Parameter-free dictionary lookup body queryBodyGenProg (d = (dp, (((base, b), q_target), m))): calls searchBucketGenProg and, if found (ovfSearchFound res = 1), reads and returns some v from Values at physical slot res.2, otherwise returns none.

Dictionary lookup body queryBodyProg (d = (((base, b), q_target), m)): calls searchBucketProg and, if found (ovfSearchFound res = 1), reads and returns some v from Values at physical slot res.2, otherwise returns none.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.queryBodyGenProg_mk (U V w n_max h_space : ℕ) (d : ((ℕ × ℕ) × ℕ) × ℕ) :
queryBodyGenProg (mkDictParams U V w n_max h_space, d) = queryBodyProg U V w n_max h_space d
theorem Cslib.DataStructure.Dictionary.WordRAM.Succinct.queryBodyProg_spec {U V w₀ n_max h_space w : ℕ} {d : ((ℕ × ℕ) × ℕ) × ℕ} {s : Memory.State} {L : List ℕ} (henv : DictEnvGen w (mkDictParams U V w₀ n_max h_space) (ovfQueryBase d)) (hb : ovfQueryBucket d < FeistelQuotient.numBuckets n_max) (hm : d.2 < SuccinctBucket.numMicroPerBucket n_max) (hinv : SlotStoreInv n_max (gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem)) (hchain : IsDLChain n_max (lmHead n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d) d.2) (lmPrev n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) (lmNext n_max (lmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) L) (hc_lt : ∀ j ∈ L, j < bCount n_max (gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem) (ovfQueryBucket d)) :
have gm := gmAt (ovfQueryBase d) U V w₀ n_max h_space s.mem; have prog := queryBodyProg U V w₀ n_max h_space d; (Memory.spec 0).clientState s prog = s ∧ WordRAM.Realization.memoryCost prog s ≤ 12 + 8 * L.length + 6 * (bCount n_max gm (ovfQueryBucket d) - SuccinctBucket.effBucketCap n_max) ∧ have res := (Memory.spec 0).clientResult s prog; if (∃ j ∈ L, quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j) = ovfQueryQuot d) ∨ ∃ (j : ℕ), SuccinctBucket.effBucketCap n_max ≤ j ∧ j < bCount n_max gm (ovfQueryBucket d) ∧ quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j) = ovfQueryQuot d then ∃ j < bCount n_max gm (ovfQueryBucket d), quotAt (ovfQueryBase d) U w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j) = ovfQueryQuot d ∧ res = some (valAt (ovfQueryBase d) U V w₀ n_max h_space s.mem (slotOf n_max gm (ovfQueryBucket d) j)) else res = none