Documentation

LeanPool.OrderMaintenance.Impl.PeakFrame

Theorem W, option (A), stage A2: what a run leaves alone #

Syntactic frames for the core language: a statement that never writes field f (Stm.wf) ends with every value of f unchanged (evalF_frame_fld), and one that never assigns local x (Stm.asg) ends with x unchanged (evalF_frame_loc). With the inversion lemmas for ;; and if, they let a peak proof follow the values that a risky store needs through the safe parts of a procedure.

Nothing here is used by Theorems A and B.

Fields #

theorem OrderMaintenance.Impl.Res.keepsF_addCost {κ : Caps} {f : Fld} {s : Model.Core} {r : Res} (c : ℕ) (h : keepsF κ f s r) :
keepsF κ f s (addCost c r)
theorem OrderMaintenance.Impl.Res.keepsF_bind {κ : Caps} {f : Fld} {s : Model.Core} {r : Res} {g : Model.Core → Loc → Res} (h : keepsF κ f s r) (hg : ∀ (s1 : Model.Core) (L1 : Loc), keepsF κ f s1 (g s1 L1)) :
keepsF κ f s (r.bind g)
theorem OrderMaintenance.Impl.runForF_keepsF {κ : Caps} {f : Fld} (b : Stm) (x : Machine.Reg) (hb : ∀ (s : Model.Core) (L : Loc), Res.keepsF κ f s (evalF κ b s L)) (n k : ℕ) (s : Model.Core) (L : Loc) :
Res.keepsF κ f s (runForF (evalF κ b) x k n s L)
theorem OrderMaintenance.Impl.LK.set_fld {κ : Caps} {s s' : Model.Core} {i : ℕ} {l : List (ℕ × ℕ)} {k : LK} (h : set κ s i l k = some s') (f : Fld) (j : ℕ) :
j < Fld.cap κ f → Fld.get s' j f = Fld.get s j f
theorem OrderMaintenance.Impl.evalF_keepsF {κ : Caps} (f : Fld) (c : Stm) (s : Model.Core) (L : Loc) :
Stm.wf f c = false → Res.keepsF κ f s (evalF κ c s L)
theorem OrderMaintenance.Impl.evalF_frame_fld {κ : Caps} {c : Stm} {f : Fld} (hf : Stm.wf f c = false) {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ c s L = Res.ok s' L' n) {j : ℕ} (hj : j < Fld.cap κ f) :
Fld.get s' j f = Fld.get s j f

A run that never writes f keeps it.

Locals #

theorem OrderMaintenance.Impl.Res.keepsL_addCost {x : Machine.Reg} {L : Loc} {r : Res} (c : ℕ) (h : keepsL x L r) :
keepsL x L (addCost c r)
theorem OrderMaintenance.Impl.Res.keepsL_bind {x : Machine.Reg} {L : Loc} {r : Res} {g : Model.Core → Loc → Res} (h : keepsL x L r) (hg : ∀ (s1 : Model.Core) (L1 : Loc), keepsL x L1 (g s1 L1)) :
keepsL x L (r.bind g)
theorem OrderMaintenance.Impl.runForF_keepsL {κ : Caps} {x y : Machine.Reg} (hxy : y ≠ x) (b : Stm) (hb : ∀ (s : Model.Core) (L : Loc), Res.keepsL x L (evalF κ b s L)) (n k : ℕ) (s : Model.Core) (L : Loc) :
Res.keepsL x L (runForF (evalF κ b) y k n s L)
theorem OrderMaintenance.Impl.setLocs_not_mem {L : Loc} {x : Machine.Reg} {ds : List Machine.Reg} {vs : List ℕ} :
x ∉ ds → Machine.State.setLocs L ds vs x = L x
theorem OrderMaintenance.Impl.evalF_keepsL {κ : Caps} (x : Machine.Reg) (c : Stm) (s : Model.Core) (L : Loc) :
Stm.asg x c = false → Res.keepsL x L (evalF κ c s L)
theorem OrderMaintenance.Impl.evalF_frame_loc {κ : Caps} {c : Stm} {x : Machine.Reg} (hx : Stm.asg x c = false) {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ c s L = Res.ok s' L' n) :
L' x = L x

A run that never assigns x keeps it.

Inverting a run #

theorem OrderMaintenance.Impl.evalF_seq_inv {κ : Caps} {c d : Stm} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ (c;; d) s L = Res.ok s' L' n) :
∃ (s1 : Model.Core) (L1 : Loc) (n1 : ℕ) (n2 : ℕ), evalF κ c s L = Res.ok s1 L1 n1 ∧ evalF κ d s1 L1 = Res.ok s' L' n2
theorem OrderMaintenance.Impl.evalF_ite_inv {κ : Caps} {c : Exp} {t f : Stm} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ (Stm.ite c t f) s L = Res.ok s' L' n) :
∃ (v : ℕ), Exp.ev κ s L c = some v ∧ ∃ (m : ℕ), (if v ≠ 0 then evalF κ t s L else evalF κ f s L) = Res.ok s' L' m

A field written at one index only #

The outcome keeps x and every value of f away from index L x.

Equations
Instances For
    theorem OrderMaintenance.Impl.Res.keepsFAt_addCost {κ : Caps} {f : Fld} {x : Machine.Reg} {s : Model.Core} {L : Loc} {r : Res} (c : ℕ) (h : keepsFAt κ f x s L r) :
    keepsFAt κ f x s L (addCost c r)
    theorem OrderMaintenance.Impl.Res.keepsFAt_bind {κ : Caps} {f : Fld} {x : Machine.Reg} {s : Model.Core} {L : Loc} {r : Res} {g : Model.Core → Loc → Res} (h : keepsFAt κ f x s L r) (hg : ∀ (s1 : Model.Core) (L1 : Loc), L1 x = L x → keepsFAt κ f x s1 L1 (g s1 L1)) :
    keepsFAt κ f x s L (r.bind g)
    theorem OrderMaintenance.Impl.runForF_keepsFAt {κ : Caps} {f : Fld} {x y : Machine.Reg} (hxy : y ≠ x) (b : Stm) (hb : ∀ (s : Model.Core) (L : Loc), Res.keepsFAt κ f x s L (evalF κ b s L)) (n k : ℕ) (s : Model.Core) (L : Loc) :
    Res.keepsFAt κ f x s L (runForF (evalF κ b) y k n s L)
    theorem OrderMaintenance.Impl.evalF_keepsFAt {κ : Caps} (f : Fld) (x : Machine.Reg) (c : Stm) (s : Model.Core) (L : Loc) :
    Stm.wfAt f x c = true → Stm.asg x c = false → Res.keepsFAt κ f x s L (evalF κ c s L)
    theorem OrderMaintenance.Impl.evalF_frame_fldAt {κ : Caps} {c : Stm} {f : Fld} {x : Machine.Reg} (hw : Stm.wfAt f x c = true) (hx : Stm.asg x c = false) {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ c s L = Res.ok s' L' n) {j : ℕ} (hj : j < Fld.cap κ f) (hne : j ≠ L x) :
    Fld.get s' j f = Fld.get s j f

    A run that writes f only at the index held by x keeps every other value of f.