Documentation

LeanPool.OrderMaintenance.Impl.PeakCore2

Theorem W, option (A), stage A2: queue adjustment, filtering, chunk sizes, element insertion #

Nothing here is used by Theorems A and B.

theorem OrderMaintenance.Impl.Exp.ev_mul_inv {κ : Caps} {a b : Exp} {s : Model.Core} {L : Loc} {w : ℕ} (h : ev κ s L (bin Machine.BinOp.mul a b) = some w) :
∃ (x : ℕ) (y : ℕ), ev κ s L a = some x ∧ ev κ s L b = some y ∧ w = x * y
theorem OrderMaintenance.Impl.pqAdjust_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓK K) s L) :
PK K KH κ (ΓK K) W pqAdjustP.body s L

pqAdjust.

theorem OrderMaintenance.Impl.filter_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (k : LK) (hG : Gd K KH κ (ΓK K) s L) :
PK K KH κ (ΓK K) W (filterP k).body s L

filter: the write index stays at most the loop index.

Run a safe first statement of a sequence, passing on the end-state bound.

Equations
Instances For
    theorem OrderMaintenance.Impl.guard_ok {κ : Caps} {c : Exp} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ (Stm.ite c Stm.fail Stm.skip) s L = Res.ok s' L' n) :
    Exp.ev κ s L c = some 0 ∧ s = s' ∧ L = L'
    theorem OrderMaintenance.Impl.csP_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓK K) s L) (hsz : (s.C.getX (L "c")).size + 1 < 2 ^ K) :
    PK K KH κ (ΓK K) W csP.body s L

    A chunk's size plus one (below 2^K by hypothesis), then the queue adjustment.

    theorem OrderMaintenance.Impl.insertElemPre_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓH K KH) s L) :
    PK K KH κ (ΓH K KH) W insertElemPre s L

    The label of a new element, after its guard.

    theorem OrderMaintenance.Impl.linkElem_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hKH : KH ≤ W) (hG : Gd K KH κ (ΓH K KH) s L) (hF : Fin (fun (t : Model.Core) => FB K KH κ (Fld.g GF.size) t ∧ FB K KH κ (Fld.s SF.count) t) linkElemS s L) :
    PKok K KH κ (ΓH K KH) W linkElemS s L

    Linking a new element: the group size and the count plus one are the end state's.

    theorem OrderMaintenance.Impl.insertElem_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hKH : KH ≤ W) (hG : Gd K KH κ (ΓH K KH) s L) (hF : Fin (fun (t : Model.Core) => FB K KH κ (Fld.g GF.size) t ∧ FB K KH κ (Fld.s SF.count) t) insertElemP.body s L) :
    PKok K KH κ (ΓH K KH) W insertElemP.body s L