M6: elements (Model/Core.lean: insertion, deletion, order) #
theorem
OrderMaintenance.Impl.linkElemS_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{x lab hh : ℕ}
(hx : L "x" = x)
(hg : L "g" = (σ.E.getX x).grp)
(hgl : L "glast" = (σ.Gs.getX (σ.E.getX x).grp).last)
(hnx : L "nx" = (σ.E.getX x).next)
(hlab : L "lab" = lab)
(hl : L "h" = hh)
(hxE : x < σ.E.size)
(hgG : (σ.E.getX x).grp < σ.Gs.size)
(hnE : (σ.E.getX x).next = 0 ∨ (σ.E.getX x).next < σ.E.size)
(hE : σ.E.size < κ.tbl Tbl.E)
(hG : σ.Gs.size ≤ κ.tbl Tbl.G)
:
The label of the new element, guarded.
Equations
- One or more equations did not get rendered due to their size.
Instances For
insertElem x h: a new element with handle h right after x.
Equations
- OrderMaintenance.Impl.insertElemP = { name := "insertElem", params := ["x", "h"], rets := ["y"], body := OrderMaintenance.Impl.insertElemPre;; OrderMaintenance.Impl.linkElemS }
Instances For
theorem
OrderMaintenance.Impl.insertElem_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{x hh : ℕ}
(hx : L "x" = x)
(hl : L "h" = hh)
(hxE : x < σ.E.size)
(hgG : (σ.E.getX x).grp < σ.Gs.size)
(hnE : (σ.E.getX x).next = 0 ∨ (σ.E.getX x).next < σ.E.size)
(hE : σ.E.size < κ.tbl Tbl.E)
(hG : σ.Gs.size ≤ κ.tbl Tbl.G)
{y : ℕ}
{σ' : Model.Core}
(h : EStateM.run (Model.insertElem x hh) σ = EStateM.Result.ok y σ')
:
Procedure marking an element dead without unlinking it.
Equations
- OrderMaintenance.Impl.markDeadP = { name := "markDead", params := ["x"], rets := [], body := OrderMaintenance.Impl.Stm.weF OrderMaintenance.Impl.EF.dead (OrderMaintenance.Impl.Exp.var "x") 1 }
Instances For
theorem
OrderMaintenance.Impl.markDead_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{x : ℕ}
(hx : L "x" = x)
(hxE : x < σ.E.size)
(_hE : σ.E.size ≤ κ.tbl Tbl.E)
{σ' : Model.Core}
(h : EStateM.run (Model.markDead x) σ = EStateM.Result.ok () σ')
:
The key of element e: its chunk's tag, its group's label, its own label.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Procedure comparing the lexicographic order labels of two element indices.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
OrderMaintenance.Impl.order_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{x y : ℕ}
(hx : L "x" = x)
(hy : L "y" = y)
(hxE : x < κ.tbl Tbl.E)
(hyE : y < κ.tbl Tbl.E)
(hxG : (σ.E.getX x).grp < κ.tbl Tbl.G)
(hyG : (σ.E.getX y).grp < κ.tbl Tbl.G)
(hxC : (σ.Gs.getX (σ.E.getX x).grp).chk < κ.tbl Tbl.C)
(hyC : (σ.Gs.getX (σ.E.getX y).grp).chk < κ.tbl Tbl.C)
{b : Bool}
{σ' : Model.Core}
(h : EStateM.run (Model.order x y) σ = EStateM.Result.ok b σ')
: