Documentation

LeanPool.OrderMaintenance.Proof.Word.PeakJob

Theorem W, option (A), stage A2: the peak of a sweep step (drainStep) and of the funding loop #

The locals of a job step are at width K except pw (a^ht ≤ 2^K) at K + 1 (ΓJ); those of drainStep at K except old, new at 2K + 1 and tg at 2K + 2 (ΓT).

Nothing here is used by Theorems A and B.

@[reducible, inline]

The locals of a job step: the walk's threshold pw at width K + 1, every other at K.

Equations
Instances For
    @[reducible, inline]

    The locals of drainStep: the tag fields old, new at width 2K + 1, the new tag tg at 2K + 2, every other at K.

    Equations
    Instances For
      @[reducible, inline]

      The locals of a drain start after its cut: the sums t, ws at width K + 9, every other (including b, reassigned to a child) at K.

      Equations
      Instances For
        @[reducible, inline]

        The locals of a split start: the new tags ty, tz (a label plus a digit) at width K + 1, every other at K.

        Equations
        Instances For

          proveSafe with the locals of this file.

          Equations
          Instances For

            Helpers #

            theorem OrderMaintenance.Impl.FB.back {K KH : ℕ} {κ : Caps} {s s' : Model.Core} {L L' : Loc} {n : ℕ} {c : Stm} {f : Fld} (hf : Stm.wf f c = false) (h : evalF κ c s L = Res.ok s' L' n) (hb : FB K KH κ f s') :
            FB K KH κ f s

            A statement that does not write f passes the bound of f back to its start.

            theorem OrderMaintenance.Impl.Fin.mono {κ : Caps} {s : Model.Core} {L : Loc} {Q Q' : Model.Core → Prop} {c : Stm} (h : Fin Q c s L) (hQ : ∀ (t : Model.Core), Q t → Q' t) :
            Fin Q' c s L
            theorem OrderMaintenance.Impl.FB.at' {K KH : ℕ} {κ : Caps} {f : Fld} {t : Model.Core} (j : ℕ) (h : FB K KH κ f t) :
            FBat K KH κ f j t
            theorem OrderMaintenance.Impl.Gd.of_loc {K KH : ℕ} {κ : Caps} {Γ : Machine.Reg → ℕ} {s : Model.Core} {L : Loc} (hG : Gd K KH κ Γ s L) {Γ' : Machine.Reg → ℕ} (h : ∀ (x : Machine.Reg), L x < 2 ^ Γ' x) :
            Gd K KH κ Γ' s L
            theorem OrderMaintenance.Impl.PKok.seq_fb {K KH W : ℕ} {κ : Caps} {Γ : Machine.Reg → ℕ} {s : Model.Core} {L : Loc} {Γ' : Machine.Reg → ℕ} {c d : Stm} {f : Fld} (hF : Fin (FB K KH κ f) (c;; d) s L) (hd0 : Stm.wf f d = false) (hc : Fin (FB K KH κ f) c s L → PKok K KH κ Γ' W c s L) (hd : ∀ (s1 : Model.Core) (L1 : Loc) (n1 : ℕ), evalF κ c s L = Res.ok s1 L1 n1 → Gd K KH κ Γ' s1 L1 → Fin (FB K KH κ f) d s1 L1 → PKok K KH κ Γ W d s1 L1) :
            PKok K KH κ Γ W (c;; d) s L

            A sequence whose rest does not write f: the first statement may assume the bound of f at its own end.

            theorem OrderMaintenance.Impl.PK.pcSetV {K KH W : ℕ} {κ : Caps} {Γ : Machine.Reg → ℕ} {s : Model.Core} {L : Loc} {t a b c d : Exp} {vs : List ℕ} (hG : Gd K KH κ Γ s L) (hv : evList κ s L [t, a, b, c, d] = some vs) (hpk : pkList κ s L [t, a, b, c, d] < 2 ^ W) (hvs : ∀ v ∈ vs, v < 2 ^ K) :
            PK K KH κ Γ W (Stm.pcSet t a b c d) s L

            pcSet with known values below 2^K.

            theorem OrderMaintenance.Impl.PK.callV {K KH W : ℕ} {κ : Caps} {Γ : Machine.Reg → ℕ} {s : Model.Core} {L : Loc} {q : Proc} {args : List Exp} {ds : List Machine.Reg} {vs : List ℕ} {Γc Γe : Machine.Reg → ℕ} (hG : Gd K KH κ Γ s L) (ha : evList κ s L args = some vs) (hpa : pkList κ s L args < 2 ^ W) (hvs : ∀ v ∈ vs, v < 2 ^ K) (hps : ∀ (x : Machine.Reg), K ≤ Γe x) (hb : Gd K KH κ Γe s (Machine.State.setLocs (fun (x : Machine.Reg) => 0) q.params vs) → PK 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) :
            PK K KH κ Γ W (q.call args ds) s L

            A call whose arguments have known values below 2^K.

            theorem OrderMaintenance.Impl.PKok.callF {K KH W : ℕ} {κ : Caps} {Γ : Machine.Reg → ℕ} {s : Model.Core} {L : Loc} {Γc Γe : Machine.Reg → ℕ} {q : Proc} {args : List Exp} {ds : List Machine.Reg} {Q : Model.Core → Prop} (hC : CapsW K κ) (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) (hF : Fin Q (q.call args ds) s L) (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) → Fin Q q.body 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) whose callee may assume the call's end-state bound.

            theorem OrderMaintenance.Impl.Exp.ev_rdv {κ : Caps} {s : Model.Core} {L : Loc} {f : Fld} {x : Machine.Reg} {w : ℕ} (h : ev κ s L (rd f (var x)) = some w) :
            L x < Fld.cap κ f ∧ w = Fld.get s (L x) f

            The value of a read of a field at the index held by a local.

            drainStep #

            theorem OrderMaintenance.Impl.shDigit_pk {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) {Γ : Machine.Reg → ℕ} {d : Stm} {x : Machine.Reg} {a : Exp} (hG : Gd K KH κ Γ s L) (hna : a.noShl = true) (hwa : Exp.wq Γ K KH K (Exp.bin Machine.BinOp.shl 1 (a * Exp.prm PF.beta)) ≤ W) (hh : ∀ (h' : ℕ), Exp.ev κ s L a = some h' → h' < s.P.H) (hx : K ≤ Γ x) (hd : ∀ (h' : ℕ), Exp.ev κ s L a = some h' → Gd K KH κ Γ s (Machine.State.upd L x (2 ^ (h' * s.P.beta))) → PK K KH κ Γ W d s (Machine.State.upd L x (2 ^ (h' * s.P.beta)))) :
            PK K KH κ Γ W (x ::= Exp.bin Machine.BinOp.shl 1 (a * Exp.prm PF.beta);; d) s L

            e := 1 <<< (h' · β) for a height h' < H: below 2^K.

            theorem OrderMaintenance.Impl.dsLab_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 κ (ΓT K) s L) :
            PK K KH κ (ΓT K) W dsLabS s L

            The labels and tag fields of a sweep step.

            theorem OrderMaintenance.Impl.dsTag_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓT K) s L) (hF : Fin (FBat K KH κ (Fld.c CF.tag) (L "y")) dsTagS s L) :
            PKok K KH κ (ΓT K) W dsTagS s L

            The tag of a sweep step, bounded by the end state's tag at the moved chunk y.

            theorem OrderMaintenance.Impl.dsMove_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓT K) s L) (hF : Fin (FB K KH κ (Fld.c CF.tag)) dsMoveS s L) :
            PKok K KH κ (ΓT K) W dsMoveS s L

            A sweep move (dsMoveS), its tag bounded by the end state.

            theorem OrderMaintenance.Impl.dsP_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓT K) s L) (hL : ∀ (x : Machine.Reg), L x < 2 ^ K) (hF : Fin (FB K KH κ (Fld.c CF.tag)) dsP.body s L) :
            PKok K KH κ (ΓT K) W dsP.body s L

            drainStep, its tag bounded by the end state.

            theorem OrderMaintenance.Impl.fund_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) (hG : Gd K KH κ (ΓJ K) s L) (hF : Fin (FB K KH κ (Fld.c CF.tag)) fundS s L) :
            PKok K KH κ (ΓJ K) W fundS s L

            The funding loop's step (fundS, locals of a job step), the sweep's tag bounded by the end state.