M6: the tables of the top structure (roomNextTo, tableInsert) #
theorem
OrderMaintenance.Impl.run_modN
(t : ℕ)
(f : Model.Node → Model.Node)
(σ : Model.Core)
:
EStateM.run (Model.modN t f) σ = EStateM.Result.ok ()
{ P := σ.P, E := σ.E, Gs := σ.Gs, C := σ.C, freeG := σ.freeG, count := σ.count, head := σ.head, tail := σ.tail,
firstGroup := σ.firstGroup, firstChunk := σ.firstChunk, ready := σ.ready, prep := σ.prep, resJob := σ.resJob,
fallbacks := σ.fallbacks, pqHead := σ.pqHead, pqNext := σ.pqNext, pqPrev := σ.pqPrev, pqWhere := σ.pqWhere,
nbNext := σ.nbNext, nbPrev := σ.nbPrev, pqHi := σ.pqHi, pqLo := σ.pqLo, nodes := σ.nodes.modify t f,
path := σ.path, cin := σ.cin, lpar := σ.lpar }
theorem
OrderMaintenance.Impl.put_table_side
(σ : Model.Core)
(t : ℕ)
(tbl : List (ℕ × ℕ))
(sd : List (ℕ × Model.Side))
:
LK.put (LK.put σ t tbl LK.table) t (encS sd) LK.side = { P := σ.P, E := σ.E, Gs := σ.Gs, C := σ.C, freeG := σ.freeG, count := σ.count, head := σ.head, tail := σ.tail,
firstGroup := σ.firstGroup, firstChunk := σ.firstChunk, ready := σ.ready, prep := σ.prep, resJob := σ.resJob,
fallbacks := σ.fallbacks, pqHead := σ.pqHead, pqNext := σ.pqNext, pqPrev := σ.pqPrev, pqWhere := σ.pqWhere,
nbNext := σ.nbNext, nbPrev := σ.nbPrev, pqHi := σ.pqHi, pqLo := σ.pqLo,
nodes :=
σ.nodes.modify t fun (n : Model.Node) =>
{ height := n.height, livePar := n.livePar, children := n.children, weight := n.weight, table := tbl,
inTables := n.inTables, first := n.first, last := n.last, draining := n.draining, t1 := n.t1, t2 := n.t2,
side := sd, overflowOf := n.overflowOf, alive := n.alive },
path := σ.path, cin := σ.cin, lpar := σ.lpar }
theorem
OrderMaintenance.Impl.put_table
(σ : Model.Core)
(t : ℕ)
(tbl : List (ℕ × ℕ))
:
LK.put σ t tbl LK.table = { P := σ.P, E := σ.E, Gs := σ.Gs, C := σ.C, freeG := σ.freeG, count := σ.count, head := σ.head, tail := σ.tail,
firstGroup := σ.firstGroup, firstChunk := σ.firstChunk, ready := σ.ready, prep := σ.prep, resJob := σ.resJob,
fallbacks := σ.fallbacks, pqHead := σ.pqHead, pqNext := σ.pqNext, pqPrev := σ.pqPrev, pqWhere := σ.pqWhere,
nbNext := σ.nbNext, nbPrev := σ.nbPrev, pqHi := σ.pqHi, pqLo := σ.pqLo,
nodes :=
σ.nodes.modify t fun (n : Model.Node) =>
{ height := n.height, livePar := n.livePar, children := n.children, weight := n.weight, table := tbl,
inTables := n.inTables, first := n.first, last := n.last, draining := n.draining, t1 := n.t1, t2 := n.t2,
side := (σ.nodes.getX t).side, overflowOf := n.overflowOf, alive := n.alive },
path := σ.path, cin := σ.cin, lpar := σ.lpar }
tableInsert t e w before lab (bf = 1 for before).
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
OrderMaintenance.Impl.tableInsertP_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{t e w lab : ℕ}
{before : Bool}
(ht : L "t" = t)
(he : L "e" = e)
(hw : L "w" = w)
(hbf : L "bf" = b2n before)
(hl : L "lab" = lab)
(htr : t < κ.lrec LK.table)
(hts : t < κ.lrec LK.side)
(htN : t < κ.tbl Tbl.N)
(hcapT : (σ.nodes.getX t).table.length + 1 ≤ κ.lcap LK.table)
(hcapS : (σ.nodes.getX t).side.length + 1 ≤ κ.lcap LK.side)
{σ' : Model.Core}
(h : EStateM.run (Model.tableInsert t e w before lab) σ = EStateM.Result.ok () σ')
:
tableInsertP runs tableInsert.
The bounds around position r of table t.
Equations
- One or more equations did not get rendered due to their size.
Instances For
roomNextTo t e before (bf = 1 for before): a free label next to e in table t.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bounds roomNextTo takes: one above the lower neighbour's label, and the upper one.
Equations
Instances For
The upper label boundary next to an insertion, using 2^β beyond the final entry.
Equations
Instances For
theorem
OrderMaintenance.Impl.roomNextTo_inv
{σ σ' : Model.Core}
{t e lab : ℕ}
{before : Bool}
(h : EStateM.run (Model.roomNextTo t e before) σ = EStateM.Result.ok lab σ')
:
theorem
OrderMaintenance.Impl.roomP_agree
(κ : Caps)
(σ : Model.Core)
(L : Loc)
{t e : ℕ}
{before : Bool}
(ht : L "t" = t)
(he : L "e" = e)
(hbf : L "bf" = b2n before)
(htr : t < κ.lrec LK.table)
{lab : ℕ}
{σ' : Model.Core}
(h : EStateM.run (Model.roomNextTo t e before) σ = EStateM.Result.ok lab σ')
:
roomP runs roomNextTo.