Documentation

CslibFrontier.DataStructure.PriorityQueue.FibonacciHeap.Native.Update

Native updates of the indexed Fibonacci heap #

The original linked record source is compiled through the existing realization rules. The lexicographic priority test is compiled directly by realize from its original named guard. The certificate retains its intrinsic source-history admissibility contract; the existing heap refinement supplies that contract for indexed-queue clients. These blocks do not constitute a complete native method family.

Main definitions #

Main results #

The original root-list insertion, retaining the certificate's intrinsic admissible-history contract. Capacity, base and handle are runtime words, and the local work is absorbed.

Compose the existing node writes, root-list insertion and size increment. Runtime words select data and addresses, while one emitter precedes all capacities, widths and memories.

theorem Cslib.DataStructure.PriorityQueue.FibonacciHeap.Native.realizes_setKey :
WordRAM.Realization.Realizes WordRAM.Basis.exact (fun (d : Fin 4 → ℕ) => DataStructure.link ((layout (d 0) (d 1)).methods 0) (setKey (d 2) (d 3))) (Function.Embedding.refl (Fin 4 → ℕ)) WordRAM.Realization.WordEncoding.encode (fun (w : ℕ) (d : Fin 4 → ℕ) (s : Memory.State) => WordRAM.Fits w (d 1 + (9 * d 0 + 5)) ∧ d 2 < d 0 ∧ 1 ≤ s.mem (d 1 + 9 * d 0 + 1)) fun (x : Fin 4 → ℕ) (x_1 : Memory.State) => 0

Store the runtime key and perform the original minimum-root priority comparison. The positive minimum pointer makes exact subtraction defined; heap correctness supplies this domain when decreasing a present key. This is a source block, not a complete decrease-key.

theorem Cslib.DataStructure.PriorityQueue.FibonacciHeap.Native.realizes_toRoot :
WordRAM.Realization.Realizes WordRAM.Basis.exact (fun (d : Fin 3 → ℕ) => DataStructure.link ((layout (d 0) (d 1)).methods 0) (toRoot (d 2))) (Function.Embedding.refl (Fin 3 → ℕ)) WordRAM.Realization.WordEncoding.encode (fun (w : ℕ) (d : Fin 3 → ℕ) (s : Memory.State) => WordRAM.Fits w (d 1 + (9 * d 0 + 5)) ∧ d 2 < d 0 ∧ 1 ≤ s.mem (d 1 + 9 * d 0 + 1) ∧ s.mem (d 1 + 9 * d 0 + 1) ≤ d 0 ∧ s.mem (d 1 + 4 * d 0 + (s.mem (d 1 + 9 * d 0 + 1) - 1)) < d 0 ∧ s.mem (d 1 + 6 * d 0 + d 2) ≤ s.mem (d 1 + 9 * d 0 + 3)) fun (x : Fin 3 → ℕ) (x_1 : Memory.State) => 0

Move the detached handle into the root list using its original memory source. The minimum and its right neighbour are actual handle words; the mark/count inequality makes exact subtraction defined. These are reached-state obligations for a cut, not a new heap model.

Arithmetic and root-list domains of the native cut. The intermediate state is the actual original unlink run. This records compilation side conditions, not a replacement for the forest invariant or for the certificate's intrinsic source-history admissibility premise.

The original cut is the composition of its two native source blocks. Its root-list and mark/count obligations concern the memory actually reached by unlinking. Transport from the existing forest invariants remains a separate proof obligation. No native loop nontruncation or complete decrease-key is asserted by this block certificate.