Theorem W, stage B1: the priority queue #
Every value the queue writes is a chunk index or a bucket (a chunk size) passed as an argument,
0, or a value read from the queue's arrays (class R). So each operation keeps WB K once its
arguments are below 2^K.
theorem
OrderMaintenance.Proof.Word.ht_pqLinkAfter
{K : ℕ}
{P0 : Model.Params}
{s p : ℕ}
(hs : s < 2 ^ K)
(hp : p < 2 ^ K)
:
HT K P0 (Model.pqLinkAfter s p) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqAdd
{K : ℕ}
{P0 : Model.Params}
{c s p : ℕ}
(hc : c < 2 ^ K)
(hs : s < 2 ^ K)
(hp : p < 2 ^ K)
:
HT K P0 (Model.pqAdd c s p) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqDel
{K : ℕ}
{P0 : Model.Params}
(c : ℕ)
:
HT K P0 (Model.pqDel c) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqInsertScan
{K : ℕ}
{P0 : Model.Params}
{c s : ℕ}
(hc : c < 2 ^ K)
(hs : s < 2 ^ K)
:
HT K P0 (Model.pqInsertScan c s) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqAdjust
{K : ℕ}
{P0 : Model.Params}
{c old new : ℕ}
(hc : c < 2 ^ K)
(ho : old < 2 ^ K)
(hn : new < 2 ^ K)
:
HT K P0 (Model.pqAdjust c old new) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqEnterIfAbove
{K : ℕ}
{P0 : Model.Params}
{c : ℕ}
(hc : c < 2 ^ K)
:
HT K P0 (Model.pqEnterIfAbove c) fun (x : Unit) => True
theorem
OrderMaintenance.Proof.Word.ht_pqPopMax
{K : ℕ}
{P0 : Model.Params}
:
HT K P0 Model.pqPopMax fun (x : ℕ) => x < 2 ^ K