Standalone Word-RAM Indexed Binary Min-Heap #
This file proves the full SubroutineDS and PQPackage specifications for the standalone
word-RAM indexed binary min-heap (Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.pqCode) over
Basis.exact, and projects it via Basis.Simulates.exactStandard to standalone .standard-basis
DynamicProgram, DynamicCertificate, Stateful.Bound, and adaptive-client theorems.
The heap uses space n = 3 * n + 1 words at any base address base with Fits w (base + space n)
and Fits w K_max:
initFreshruns inO(1)(11instructions);initClearruns inO(n)(12 * n + 21instructions, derived generically viaSubroutineDS);isEmptyandgetKeyrun inO(1)worst-case instructions;insert,decreaseKey, andextractMinrun inO(log n + 1)worst-case instructions with zero potential (potential = 0).
Main definitions #
Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.Rep: concrete representation invariant.Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.subroutineDS: exact-basisSubroutineDScertificate.Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.pkg:PQPackage .exact rBinbundle for black-box algorithm callers such asdijkstra_of_pq_spec.Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.dynamicProgram,Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.certificate: standalone.standard-basis machine realization.
Main results #
Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.instruction_bound: worst-case per-operationStateful.BoundoverBasis.standard.Cslib.Algorithms.WordRAM.PriorityQueue.BinaryHeap.run_client_bound: worst-case total instruction bound for any adaptiveStateful.Clientprogram.
References #
Concrete representation invariant of the standalone binary heap at base on n handles.
- bounded : WordRAM.Data.Bounded w x
All registers and memory cells fit in
w-bit words. Persistent base-address register
baseReg = base.Persistent handle-count register
nReg = n.Persistent heap-array base
hb = base + n.Persistent position-array base
pb = base + 2 * n + 1.Structural and lexicographic binary-heap invariant on
x.mem.Abstract state
smatchesstateOfMem n base x.mem.
Instances For
Worst-case instruction bound for isEmpty.
Instances For
Worst-case instruction bound for getKey.
Instances For
Worst-case instruction bound for insert.
Instances For
Worst-case instruction bound for decreaseKey.
Instances For
Worst-case instruction bound for extractMin.
Instances For
Per-operation worst-case instruction charge (excluding standalone trailing halt).
Instances For
Exact-basis SubroutineDS certificate for the standalone binary min-heap.
Instances For
Packaged PQPackage .exact rBin for plug-and-play subroutine callers (dijkstra_of_pq_spec).
Instances For
Standalone .standard-Basis Word-RAM Realization and Worst-Case Bounds #
Standalone .standard-basis DynamicProgram serving IndexedMinPQ.spec n K_max.
Instances For
Standalone .standard-basis DynamicCertificate for the binary min-heap.
Instances For
Standalone worst-case per-operation bound for the word-RAM binary min-heap over
Basis.standard (charge n o + 1 instructions including the trailing halt).
Standalone adaptive-client bound for the word-RAM binary min-heap over Basis.standard.