Documentation

LeanPool.OrderMaintenance.Impl.PeakChunk

Theorem W, option (A), stage A2: the peak of a chunk split step #

The labels of the moved unit (labLS, labRS: the guarded afterS, the centre label), and the sizes (msS): the chunk sizes it writes are the ones the step ends with, so their bound comes from the stored-value bound of the step's end state (VB, from option (B)), and so does the moved size mv (at most the receiving chunk's new size).

Nothing here is used by Theorems A and B.

def OrderMaintenance.Impl.FB (K KH : ℕ) (κ : Caps) (f : Fld) (s : Model.Core) :

The values of field f are small.

Equations
Instances For
    def OrderMaintenance.Impl.Fin {κ : Caps} (Q : Model.Core → Prop) (c : Stm) (s : Model.Core) (L : Loc) :

    The end state of every normal run of c from (s, L) satisfies Q (in use: some fields of it are small, FB).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem OrderMaintenance.Impl.Fin.seq_right {κ : Caps} {s s1 : Model.Core} {L L1 : Loc} {Q : Model.Core → Prop} {c d : Stm} {n1 : ℕ} (h : Fin Q (c;; d) s L) (h1 : evalF κ c s L = Res.ok s1 L1 n1) :
      Fin Q d s1 L1
      theorem OrderMaintenance.Impl.Fin.seq_assign {κ : Caps} {s : Model.Core} {L : Loc} {Q : Model.Core → Prop} {c : Stm} {x : Machine.Reg} {e : Exp} {v : ℕ} (h : Fin Q (c;; x ::= e) s L) (he : ∀ (s' : Model.Core) (L' : Loc), Exp.ev κ s' L' e = some v) :
      Fin Q c s L
      theorem OrderMaintenance.Impl.Fin.ite_t {κ : Caps} {s : Model.Core} {L : Loc} {Q : Model.Core → Prop} {c : Exp} {t f : Stm} {v : ℕ} (h : Fin Q (Stm.ite c t f) s L) (hv : Exp.ev κ s L c = some v) (h0 : v ≠ 0) :
      Fin Q t s L
      theorem OrderMaintenance.Impl.Fin.ite_f {κ : Caps} {s : Model.Core} {L : Loc} {Q : Model.Core → Prop} {c : Exp} {t f : Stm} (h : Fin Q (Stm.ite c t f) s L) (hv : Exp.ev κ s L c = some 0) :
      Fin Q f s L
      theorem OrderMaintenance.Impl.Fld.set_cap {κ : Caps} {s : Model.Core} {f : Fld} {j v : ℕ} {s' : Model.Core} (h : set κ s j v f = some s') (hE : EncOK κ s) :
      j < cap κ f
      theorem OrderMaintenance.Impl.PKok.safe_seq_fin {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} {Γ : Machine.Reg → ℕ} {Q : Model.Core → Prop} {c d : Stm} (hC : CapsW K κ) (hK : 3 ≤ K) (hW : K ≤ W) (hS : Stm.Safe K KH Γ W c) (hG : Gd K KH κ Γ s L) (hF : Fin Q (c;; d) s L) (hd : ∀ (s1 : Model.Core) (L1 : Loc) (n1 : ℕ), evalF κ c s L = Res.ok s1 L1 n1 → Gd K KH κ Γ s1 L1 → Fin Q d s1 L1 → PKok K KH κ Γ W d s1 L1) :
      PKok K KH κ Γ W (c;; d) s L

      A safe first statement, the end-state bound passed on.

      theorem OrderMaintenance.Impl.PKok.wr_fin_seq {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} {Γ : Machine.Reg → ℕ} {Q : Model.Core → Prop} (hC : CapsW K κ) {f : Fld} {i e : Exp} {d : Stm} (hG : Gd K KH κ Γ s L) (hi : Exp.OK Γ K KH W i) (he : Exp.OK Γ K KH W e) (hd : Stm.wf f d = false) (hQ : ∀ (t : Model.Core), Q t → FB K KH κ f t) (hF : Fin Q (Stm.wr f i e;; d) s L) (hD : ∀ (s1 : Model.Core), Gd K KH κ Γ s1 L → Fin Q d s1 L → PKok K KH κ Γ W d s1 L) :
      PKok K KH κ Γ W (Stm.wr f i e;; d) s L

      A write that the rest never overwrites (d does not write field f): its value is the end state's.

      theorem OrderMaintenance.Impl.aAfter_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {e : Exp} {rest : Stm} (hG : Gd K KH κ (ΓV K) s L) (hB : L "B" ≤ K) (he : Exp.OK (ΓV K) K KH W e) (hew : Exp.vw (ΓV K) K KH K e ≤ K) (hr : ∀ (s' : Model.Core) (L' : Loc), Gd K KH κ (ΓV K) s' L' → L' "B" = L "B" → PK K KH κ (ΓV K) W rest s' L') :
      PK K KH κ (ΓV K) W ("a" ::= e;; afterS;; rest) s L

      a := e, afterS, then the rest (with B unchanged).

      theorem OrderMaintenance.Impl.labLS_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 κ (ΓV K) s L) :
      PK K KH κ (ΓV K) W labLS s L
      theorem OrderMaintenance.Impl.labRS_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 κ (ΓV K) s L) :
      PK K KH κ (ΓV K) W labRS s L
      theorem OrderMaintenance.Impl.Exp.ev_add_inv {κ : Caps} {a b : Exp} {s : Model.Core} {L : Loc} {w : ℕ} (h : ev κ s L (bin Machine.BinOp.add a b) = some w) :
      ∃ (x : ℕ) (y : ℕ), ev κ s L a = some x ∧ ev κ s L b = some y ∧ w = x + y
      theorem OrderMaintenance.Impl.PKok.ite_ok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) {Γ : Machine.Reg → ℕ} {c : Exp} {t f : Stm} (hG : Gd K KH κ Γ s L) (hc : Exp.OK Γ K KH W c) (ht : ∀ (v : ℕ), Exp.ev κ s L c = some v → v ≠ 0 → PKok K KH κ Γ W t s L) (hf : Exp.ev κ s L c = some 0 → PKok K KH κ Γ W f s L) :
      PKok K KH κ Γ W (Stm.ite c t f) s L
      theorem OrderMaintenance.Impl.PKok.callS {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) {Γ Γc Γe : Machine.Reg → ℕ} {q : Proc} {args : List Exp} {ds : List Machine.Reg} (hG : Gd K KH κ Γ s L) (ha : ∀ e ∈ args, Exp.OK Γ K KH W e ∧ Exp.vw Γ K KH K e ≤ K) (hps : ∀ (x : Machine.Reg), K ≤ Γe x) (hb : ∀ (vs : List ℕ), evList κ s L args = some vs → Gd K KH κ Γe s (Machine.State.setLocs (fun (x : Machine.Reg) => 0) q.params vs) → PKok K KH κ Γc W q.body s (Machine.State.setLocs (fun (x : Machine.Reg) => 0) q.params vs)) (hr : ∀ r ∈ q.rets, Γc r ≤ K) (hd : ∀ d ∈ ds, K ≤ Γ d) :
      PKok K KH κ Γ W (q.call args ds) s L

      A call (normal runs), arguments of width K.

      theorem OrderMaintenance.Impl.PK.wr_fin {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) {Γ : Machine.Reg → ℕ} {Q : Model.Core → Prop} {f : Fld} {i e : Exp} (hG : Gd K KH κ Γ s L) (hi : Exp.OK Γ K KH W i) (he : Exp.OK Γ K KH W e) (hQ : ∀ (t : Model.Core), Q t → FB K KH κ f t) (hF : Fin Q (Stm.wr f i e) s L) :
      PK K KH κ Γ W (Stm.wr f i e) s L

      A write whose end state has small stored values (Fin): its value needs no bound.

      theorem OrderMaintenance.Impl.msMv_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 κ (ΓM K) s L) :
      PK K KH κ (ΓM K) W msMv s L
      theorem OrderMaintenance.Impl.msS_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 κ (ΓM K) s L) (hF : Fin (FB K KH κ (Fld.c CF.size)) msS s L) :
      PK K KH κ (ΓM K) W msS s L

      The sizes of a chunk move: the receiving chunk's size is the one the step ends with.

      theorem OrderMaintenance.Impl.cssL_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 κ (ΓV K) s L) :
      PK K KH κ (ΓV K) W cssL s L
      theorem OrderMaintenance.Impl.cssR_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 κ (ΓV K) s L) :
      PK K KH κ (ΓV K) W cssR s L
      theorem OrderMaintenance.Impl.cssMove_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 κ (ΓV K) s L) (hF : Fin (FB K KH κ (Fld.c CF.size)) cssMove s L) :
      PK K KH κ (ΓM K) W cssMove s L
      theorem OrderMaintenance.Impl.chunkSplitStep_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) (hF : Fin (FB K KH κ (Fld.c CF.size)) chunkSplitStepS s L) :
      PK K KH κ (ΓM K) W chunkSplitStepS s L

      A chunk split step, given that its end state has small stored values.

      theorem OrderMaintenance.Impl.fin_of_eq {κ : Caps} {s : Model.Core} {L : Loc} {Q : Model.Core → Prop} {c : Stm} {t' : Model.Core} {L' : Loc} {n : ℕ} (he : evalF κ c s L = Res.ok t' L' n) (hV : Q t') :
      Fin Q c s L
      theorem OrderMaintenance.Impl.driveChunkFrom_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {p : ℕ} (I : ℕ → Model.Core → Prop) (h0 : I 0 s) (hstep : ∀ (j : ℕ) (t : Model.Core), I j t → j < s.P.chunkBudget → ∃ (b : Bool) (t' : Model.Core) (L' : Loc) (n : ℕ), evalF κ chunkSplitStepS t (Machine.State.setLocs (fun (x : Machine.Reg) => 0) ["x"] [p]) = Res.ok t' L' n ∧ L' "ok" = b2n b ∧ (b = true → I (j + 1) t') ∧ FB K KH κ (Fld.c CF.size) t') (hG : Gd K KH κ (ΓK K) s L) (hg : L "x" = p) :
      PKok K KH κ (ΓK K) W driveChunkFromS s L

      The drive of a splitting chunk, along a Level F invariant, given the stored-value bound of each step's end state.

      theorem OrderMaintenance.Impl.moveElem_d {κ : Caps} {s : Model.Core} {L0 L1 : Loc} {S1 : Model.Core} {n : ℕ} (h : evalF κ moveElemS s L0 = Res.ok S1 L1 n) :
      (L1 "d" = Fld.get s (L0 "g") (Fld.g GF.l) ∨ L1 "d" = Fld.get s (L0 "g") (Fld.g GF.r)) ∧ ∀ j < κ.tbl Tbl.G, (S1.Gs.getX j).size = (s.Gs.getX j).size

      What a move leaves: the receiving group d is a sibling of g, and no size changes.

      theorem OrderMaintenance.Impl.groupSplitStep_pk' {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {p : ℕ} (hG : Gd K KH κ (ΓK K) s L) (hg : L "g" = p) (hsz : ∀ (j : ℕ), j = (s.Gs.getX p).l ∨ j = (s.Gs.getX p).r → (s.Gs.getX j).size + 1 < 2 ^ K) :
      PK K KH κ (ΓV K) W groupSplitStepS s L

      A group split step, given the size bound of the two siblings of the splitting group.

      theorem OrderMaintenance.Impl.driveGroupFrom_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {p : ℕ} (I : ℕ → Model.Core → Prop) (h0 : I 0 s) (hstep : ∀ (j : ℕ) (t : Model.Core), I j t → j < s.P.groupBudget → ∃ (b : Bool) (t' : Model.Core) (L' : Loc) (n : ℕ), evalF κ groupSplitStepS t (Machine.State.setLocs (fun (x : Machine.Reg) => 0) ["g"] [p]) = Res.ok t' L' n ∧ L' "ok" = b2n b ∧ (b = true → I (j + 1) t') ∧ ∀ (j : ℕ), j = (t.Gs.getX p).l ∨ j = (t.Gs.getX p).r → (t.Gs.getX j).size + 1 < 2 ^ K) (hG : Gd K KH κ (ΓK K) s L) (hg : L "g" = p) :
      PKok K KH κ (ΓK K) W driveGroupFromS s L

      The drive of a splitting group, along a Level F invariant, given the size bound of the groups that receive the moved elements.