M6: the priority queue in the core language (Model/PQ.lean) #
Capacities #
The queue's arrays are indexed by chunk (pqNext, pqPrev, pqWhere: capacity κ.arr .pqNext)
or by bucket (pqHead, nbNext, nbPrev: capacity κ.arr .pqHead), and hold chunks or
buckets. PQCaps says every stored value fits.
Capacity shared by the priority queue's chunk-indexed arrays.
Equations
Instances For
Capacity shared by the priority queue's bucket-indexed arrays.
Equations
Instances For
Compatible queue-array capacities covering every allocated chunk and bucket.
Instances For
Procedure linking a newly nonempty bucket after its predecessor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Procedure inserting a chunk at the head of a size bucket.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Procedure removing a chunk and unlinking its bucket when it becomes empty.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Insert c at bucket s. The downward scan for the predecessor bucket (Level F's slow path)
runs only if bucket s - 1 is above θ and empty; it is never needed (K2), and costs O(s).
Equations
- One or more equations did not get rendered due to their size.
Instances For
pqInsertScan when no scan is needed.
Procedure transferring a queued chunk after its size changes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
pqAdjust for a +1 change of size (the only one the algorithm makes).
Procedure queuing a chunk when its size exceeds the quiet threshold.
Equations
- One or more equations did not get rendered due to their size.
Instances For
pqEnterIfAbove for a chunk not above θ (every freshly quiet chunk: c_max ≤ θ).
Procedure removing and returning a chunk from the largest nonempty bucket.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Procedure reporting whether every priority-queue bucket is empty.
Equations
- One or more equations did not get rendered due to their size.