Word-RAM Memory.Prog Operations and Certificates for Soft Heaps #
Low-level memory layout (+0..+2 stride-3 item slots and +0..+11 stride-12 node slots),
SHHandle, Memory.Prog implementations of pool allocation, iterative defill,
lazy binomial-style
insertion (shInsert), minimum extraction (shExtractMin), and corrupted-item harvesting
(shCollectCorrupted), together with uniform Realizes .exact (work := 0) compilation
certificates.
Main definitions #
Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.SHHandle: 6-word handle for bump-allocated item and node pools plus rank threshold (WordEncoding.ofEquiv SHHandle.equiv).Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.SHExtractResult: named 9-word return record forshExtractMin(WordEncoding.ofEquiv SHExtractResult.equiv).Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.allocPool,defill,shInsert,shExtractMin,shCollectCorrupted: memory-oracle operations and safety domains.
Main results #
Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.realizes_allocPool,realizes_defill,realizes_shInsert,realizes_shExtractMin,realizes_shCollectCorrupted: uniformRealizes .exactnative code certificates.
Soft-heap pool handle storing bump pool bases, root-list head, allocated counts, and
corruption rank threshold rankThreshold.
- itemBase : ℕ
Base address of the stride-3 item pool.
- nodeBase : ℕ
Base address of the stride-12 node pool.
- firstRoot : ℕ
1-based index of the minimum-rank root in the doubly-linked root list (
0= empty). - itemCount : ℕ
Number of allocated item slots (
1..itemCount). - nodeCount : ℕ
Number of allocated node slots (
1..nodeCount). - rankThreshold : ℕ
Corruption rank threshold
r(items at rank≤ rstay uncorrupted).
Instances For
Allocate dirty Soft Heap item and node pools of capacities maxItems and maxNodes.
allocPool admits a uniform Realizes .exact compilation certificate (work := 0).
Refill node rootIdx (d = ![itemBase, nodeBase, rootIdx, fuel]) along its smallest-ckey
child chain up to targetSize, clearing rootIdx.parent := 0 before ascending back to 0.
Native safety domain for defill d (d = ![itemBase, nodeBase, rootIdx, fuel]).
defill is uniformly realized on defillSafe.
shInsert admits a uniform Realizes .exact compilation certificate (work := 0).
Result returned by shExtractMin: updated handle, found flag (1 iff non-empty),
extracted item payload val, and extracted corrupted key key.
- handle : SHHandle
Updated soft-heap handle after extraction.
- found : ℕ
1if an item was extracted,0if the heap was empty. - val : ℕ
Payload value of the extracted item (
0if empty). - key : ℕ
Corrupted key of the extracted item (
0if empty).
Instances For
Canonical 9-word tuple equivalence for SHExtractResult.
Extract a minimum-key item from soft heap d.1 (d = (h, fuel)).
Native safety domain for shExtractMin.
shExtractMin admits a uniform Realizes .exact compilation certificate (work := 0).
Scan nodes allocated since nodeStart ((nodeStart, h.nodeCount]), appending corrupted
payload values val (origKey < ckey) to outBase[outCount..] and returning the new outCount
(d = (h, nodeStart, outBase, outCount, fuel)).
Native safety domain for shCollectCorrupted.
shCollectCorrupted admits a uniform Realizes .exact compilation certificate
(work := 0).