Parametric Single-Heap Word-RAM Soft Heap #
Single-heap Word-RAM soft-heap step toward #8624, after [Cha00], Theorem 1.1 and
Section 5.1, Lemmas 5.1–5.2 (NECI TR 99-097 preprint, pp. 2, 12–13), and [PR02],
Section 2.4, p. 19, Lemma 2.2 and Section 3.2, pp. 21–22, Figure 1 and Lemma 3.3. Supports insert,
extractMin, and collectCorrupted (without meld or arbitrary-handle delete) for arbitrary
corruption rank threshold r : ℕ and rankThresholdForEps ε = Nat.log 2 (Nat.ceil (12 / ε)) + 1
(0 < ε : ℚ), exported both as composable Cslib.DataStructure.Memory.Prog operations and as a
standalone flat deterministic width-blind Cslib.WordRAM.Program .standard r batch driver
(SoftHeap.Standard).
The dismantling-free binary-tree representation, defill
(targetSize r k = 2 ^ ((k - r + 1) / 2)), the 12 / 2 ^ r sizeCap recurrence,
rankThresholdForEps ε for arbitrary 0 < ε : ℚ (extending [Chazelle2000] Theorem 1.1's
0 < ε ≤ 1 / 2 and [PettieRamachandran2002] Lemma 2.2's 0 < ε < 1 / 2), and the +(r : ℚ)
baseline credit in itemPhi are this module's self-contained Word-RAM adaptation of
[Chazelle2000] toward [PettieRamachandran2002].
Cost model and scope #
- Composable
Memory.Progoperations:allocPool,defill,shInsert,shExtractMin, andshCollectCorruptedoperate on caller-supplied bump-allocated pools (SHHandlewithrankThreshold,maxItems,maxNodes), certifyingO(r + 1)(+ (240 * r + 520)) amortized cost per insert,O(1)(+ 250) amortized cost per extract-min independently ofr, and≤ 8 * Nfor corrupted-item collection alongside uniformRealizes .exact(work := 0) certificates. - Standalone
Program .standard rdriver:shBatchProghidesshFuelBoundand pool allocation internally and lowers viaexists_singleSoftHeap_batch_standard_programandexists_singleSoftHeap_batch_standard_program_epsto a single fixed width-blind rand-freeProgram .standard r(¬prog.ReadsWidth,prog.IsRandFree) executingNinsertions andMextract-mins fromState.init I.encodeunderFits w I.wordBoundinO(N * (r + 1) + M + 1)(O(N * (rankThresholdForEps ε + 1) + M + 1)) native instructions with at most12 * N / 2 ^ r(≤ ε * N) corrupted items at every step.
Main definitions #
Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.rankThresholdForEps,shFuelBound:ε-derived corruption rank threshold andshFuelBound r maxItems.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.targetSize,sizeCap,itemPhi: parametric soft-heap rank parameters and exact closed-form item potential.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.SHHandle,SHExtractResult,SHInv: handle, extraction result record, and full representation/amortized invariant.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.allocPool,defill,shInsert,shExtractMin,shCollectCorrupted: memory-oracle Soft Heap operations withRealizes .exactcertificates.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.SHOp,SHBatchInput,SHBatchResult,SHBatchExtract,SHBatchEntry,SHBatchStepRel,SHBatchTrace,shBatchProg: flat batch I/O types, single-step transition relation, trace witness, and self-containedMemory.Progdriver.
Main results #
Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.corrupt_sum_bound,rat_le_eps_mul_of_pow_mul_le,corrupt_sum_bound_eps,shInv_corrupted_le,shInv_corrupted_le_eps: self-contained12 / 2 ^ rcorruption bounds (2 ^ r * #corrupted ≤ 12 * N) and arbitrary rational0 < εspecialization.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.SHInv.origKey_le_ckey,SHBatchTrace.states_corrupted_bound,SHBatchTrace.states_corrupted_le_eps: every surviving entry satisfiesorigKey ≤ ckey, with per-step corruption bounds andckeymonotonicity inSHBatchStepRel.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.realizes_allocPool,realizes_defill,realizes_shInsert,realizes_shExtractMin,realizes_shCollectCorrupted,realizes_shBatchProg: uniformRealizes .exactnative compilation certificates.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.allocPool_spec,shInit_inv,defill_spec,shInsert_spec,shExtractMin_spec,shCollectCorrupted_spec,shBatchProg_spec: full correctness, permutation, key-monotonicity, pool framing, and amortizedmemoryCostspecs.Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.exists_singleSoftHeap_batch_standard_program,exists_singleSoftHeap_batch_standard_program_eps: single-heap batch stepProgram .standard rspecifications toward#8624.
References #
- B. Chazelle, The Soft Heap: An Approximate Priority Queue with Optimal Error Rate, Journal of the ACM 47(6), 2000, Theorem 1.1 and Section 5.1, Lemmas 5.1–5.2 (NECI TR 99-097 preprint, pp. 2, 12–13).
- S. Pettie and V. Ramachandran, An Optimal Minimum Spanning Tree Algorithm, Journal of the ACM 49(1), 2002, Section 2.4, p. 19, Lemma 2.2 and Section 3.2, pp. 21–22, Figure 1 and Lemma 3.3.