Documentation

CslibFrontier.DataStructure.PriorityQueue.BinaryHeap.Native.Backend

A native backend for the existing memory heap #

The five operation certificates share one register bank and exchange factor, chosen before the heap's dimension, key bound, runtime layout, width or contents. The existing memory refinement provides correctness and admissibility; extraction observes its encoded natural handle through the original checked entry constructor. This preserves the complete source state and history.

Main definitions #

Main results #

Calling-convention argument installation is external to these body-only contracts. Raw native argument delivery, initialization and complete-client clocks require their separate proofs.

The five fixed original-source certificates, independent of every runtime heap parameter.

Constructor selection, runtime arguments and typed observation for the indexed-PQ methods.

Each method preserves its exact source run and meets the native certificate entry domain.

The original source bounds, keeping the read-only operations constant.

The generic execution implementation; argument installation remains a calling convention.

Every actual operation body has the source's constant or logarithmic bound, multiplied by one factor fixed before all runtime heap parameters. This excludes argument installation/halt.

The same operation bounds after adding fixed initialization certificates to the bank. Only the selected method body is charged; extra tags do not install or execute arguments.

theorem Cslib.DataStructure.PriorityQueue.BinaryHeap.Native.modifies {w n K : ℕ} (L : Memory.Layout n) (hL : L.Valid w K) {s : (indexedMinPQSpec n K).State} {x y : WordRAM.Data (WordRAM.Realization.Backend.registers certificates)} {o : IndexedMinPQ.Op n} {a : o.Result} {steps : ℕ} (hr : (implementation L hL).rep s x) (hv : IndexedMinPQ.valid K s o) (he : (backend n K L).exec w x o a y steps) :

Every operation preserves all cells outside the existing heap layout, including inaccessible cells. The proof is the shared BackendFrame theorem specialized to a zero-room heap.