Documentation

CslibFrontier.DataStructure.PriorityQueue.FibonacciHeap.Allocation

Allocating an empty Fibonacci heap in already-zero memory #

The word RAM's input convention is zero beyond the input. Under Memory.ZeroAbove, the existing Fibonacci-heap layout therefore needs no clearing: one Memory.allocDirty query reserves its 9 n + 5 cells and establishes the existing framed refinement at the empty queue. Previously allocated cells are unchanged. This is an oracle-cost certificate; a native realization must additionally charge address arithmetic, argument preparation and control.

Main definitions #

Main results #

No new heap representation or execution interface is introduced. This specialized allocator uses the existing frame and source methods; an allocator that accepts arbitrary fresh contents must still establish the representation, for example by clearing its storage.

theorem Cslib.DataStructure.PriorityQueue.FibonacciHeap.framed_allocDirty {n w K : ℕ} (hn : WordRAM.Fits w n) (hK : WordRAM.Fits w K) {s : Memory.State} (hz : Memory.ZeroAbove s) :
(framed hn hK s.frontier).inv { mem := s.mem, frontier := s.frontier + (9 * n + 5) } ∧ (framed hn hK s.frontier).abs { mem := s.mem, frontier := s.frontier + (9 * n + 5) } = IndexedMinPQ.empty n

Reserving fresh storage without clearing it establishes the existing empty-heap frame when memory is already zero above the old frontier.

Allocate an empty indexed Fibonacci heap by reserving its already-zero storage. The precondition is explicit, and neither the returned base nor the cell count is a native timing claim. The existing memory methods and framed refinement are retained.