M5: the order invariant of the top structure (docs/PROOF.md §4.5.1) #
Shape s cl ord: the structural invariant, for a state whose running job (if any) has copied its
whole path. cl is the chunk list and ord h the order ≺_h of the nodes of height h
(ord 0 = cl), a ghost variable.
- the live tree: heights, live parents and children, ordered (
OT); - ghosts and targets;
- tables: entries,
inTables/cin, label order (O1), adjacency (W1), (Q), sides (S); - paths: (P), (W3), (O2), sizes; range pointers; tags.
@[reducible, inline]
Entries of height h: chunks for h = 0, else nodes.
Equations
- OrderMaintenance.Proof.Top.Ent ord h e = (e ∈ ord h)
Instances For
The part of the invariant that orders tags (Lemma T1).
Instances For
structure
OrderMaintenance.Proof.Top.Shape
(s : TS)
(cl : List ℕ)
(ord : ℕ → List ℕ)
extends OrderMaintenance.Proof.Top.ShapeT s cl ord :
Structural, nesting, membership, endpoint and path invariants of the top tree.
- OT (h : ℕ) : 1 ≤ h → h ≤ s.P.H → ∀ (u u' e e' : ℕ), liveN s u → liveN s u' → Before (ord h) u u' → Ent ord (h - 1) e → Ent ord (h - 1) e' → par s (h - 1) e = u → par s (h - 1) e' = u' → Before (ord (h - 1)) e e'
The live tree is ordered: the children of
u ≺ u'precede those ofu'. - ghost (v : ℕ) : ghostN s v → liveN s (nd s v).t1 ∧ liveN s (nd s v).t2 ∧ ht s (nd s v).t1 = ht s v ∧ ht s (nd s v).t2 = ht s v ∧ srcOf s (nd s v).t1 = v ∧ srcOf s (nd s v).t2 = v ∧ (nd s v).livePar = Model.NIL ∧ (nd s v).children = [] ∧ srcOf s v = Model.NIL ∧ ht s v < s.P.H ∧ (nd s (nd s v).t1).livePar = (nd s (nd s v).t2).livePar ∧ [(nd s v).t1, (nd s v).t2] <:+: (nd s (nd s (nd s v).t1).livePar).children ∧ [(nd s v).t1, v, (nd s v).t2] <:+: ord (ht s v)
- Sr (c : ℕ) : c ∈ cl → ∀ (j : ℕ), 1 ≤ j → j ≤ s.P.H → ghostN s (pp s c j) → pp s c (j - 1) ∈ order s (anc s c j)
(S): below a ghost, the entry is in the table of the chunk's live ancestor.