Theorem W, option (A), stage A2 spike: discharging the end-state bounds of insertAfter #
The last-write rule (PK.wr_fin, PKok.wr_fin_seq) takes Fin Q c s L: every normal run of c
ends in a state satisfying Q (some field is small there). This file checks that option (B)
provides these bounds in the form stage A2 needs, for the top-level tree.
- Where
Fincomes from. Option (B) bounds the end state of each step of the reservation: a job step (jobStep_wb, thestepofTopWB) and a split start (thestartofTopWB, thenwb_markState). Theorem A's agreement lemmas (jobAgree,splitAgree_top) give the Level F run ofjobStepS/splitChunkStartSending in exactly that state, andevalFis a function, soFin (WB K)holds for the whole step:fin_jobStep,fin_split. - From the step's end back to the write.
Fin.call(into a callee: its end state is the call's),PKok.seq_fin(the first statement may assume a bound of its own end state that follows fromQat the end of the rest, typically because the rest does not write the field), with the framesFBat.back(the rest writes nof) andFBat.backAt(the rest writesfonly at the index held by a local). The syntactic side conditions for every top-levelFinsite hold bydecide(section frames). - The write.
PK.wr_finAt:PK.wr_finfor one index.gst_pk,gstCall_pk: the guarded tag writeguardedSetTag(the tags of a sweep and of a split), its value of width up to2K + 2bounded by the end-state bound;gstCall_frame: the call writes the tag only at its first argument (for the split's first tag, which the second call does not overwrite). - Values bounded at the state before the step (no
Finneeded): the walk'sweight + 2and height (walk_lt, fromwalk_weightandShape.htN), sopowS(powS_pk) needs only the newPRoom.aH : log₂ a · H ≤ K. proom_wK:PRoom (wK P) Pfor the proof parameters (with the new field).
Nothing here is used by Theorems A and B.
A normal run gives Fin of its end state (evalF is a function).
Into a call: the callee's end state is the call's.
Sequencing with an end-state bound passed back: the first statement may assume Q' of its
own end state, where Q' follows from Q at the end of the rest (e.g. the rest does not write
the field, FBat.back).
A call whose callee may assume the call's end-state bound.
One index of a field #
Field f of t is small at index j.
Equations
- OrderMaintenance.Impl.FBat K KH κ f j t = (j < OrderMaintenance.Impl.Fld.cap κ f → OrderMaintenance.Impl.Fld.get t j f < 2 ^ OrderMaintenance.Impl.Fld.wd K KH f)
Instances For
The rest does not write f: the bound at its end is the bound at its start.
The rest writes f only at the index held by local x, and j is another one.
The last write to index j of f (PK.wr_fin for one index): its value is the end
state's.
The syntactic side conditions of the top-level Fin sites #
The rest of the step after each write that takes its bound from the step's end state.
The weights of a drain start's new nodes (chS at u = v1): the second chS writes the
weight only at u = v2, and neither the parent's children (stage7S), v's fields (stage8S)
nor the job record (pcSet) write weights.
The tag of a sweep (dsTagS): the rest of the move and of the job step write no tag.
The tags of a split: guardedSetTag writes only at its c; after the second tag nothing in
insertAround or markSplit writes a tag.
guardedSetTag with its end-state bound #
The locals of guardedSetTag: the tag t may be wide (2K + 2, the sweep's
ty - old + new).
Instances For
proveSafe with the locals of guardedSetTag.
Equations
- OrderMaintenance.Impl.tacticGsafe = Lean.ParserDescr.node `OrderMaintenance.Impl.tacticGsafe 1024 (Lean.ParserDescr.nonReservedSymbol "gsafe" false)
Instances For
The call guardedSetTag a b, its value of width at most 2K + 2, bounded by the end
state's tag at index a.
The frame of guardedSetTag a b: it writes the tag only at index a.
The composition, at the sweep (dsMutS = dsTagS;; rest): the rest writes no tag, so the
tag write may assume the bound that holds at the end of the move.
powS: the walk's threshold a ^ ht #
pw := 1 <<< (log₂ a · ht), given the height bound ht ≤ H of the walk node (walk_lt)
and log₂ a · H ≤ K (PRoom.aH).
The node fields of a core with WB are below 2^K.
The chunk fields of a core with WB are below 2^K.
The element insertion ends with small sizes (Fin of insertElem_pkok): Theorem A's
insertElem_agree gives the run, option (B)'s insertElem_wb its end state's bound.
A job step ends with small stored values (Fin (WB K) of jobStepS, at the locals of
jobP.call): Theorem A's jobAgree gives the run, option (B)'s jobStep_wb its end state's
bound. The hypotheses are those reservation_wb and reservationAgree_top hold at each round.
A split start ends with small stored values (the split branch of reservation_wb).
Fin (WB K) of splitChunkStartS (at the locals of splitP.call), from Theorem A's
splitAgree_top and split_wb.
The walk: bounds at the state before the step #
The walk node (wv of walkS: the job's node, or the leaf parent of y for a fresh walk):
its weight + 2 is below 2^K (option (B)'s walk_weight, the chunk count bounding the true
weight) and its height is at most H (Shape.htN), at the state before the step.
The new PRoom field at the candidate word size #
PRoom at wK = 64·L for the proof parameters, including log₂ a · H ≤ K (a = 8,
H = L/3 + 1: 3·(L/3 + 1) ≤ 64·L).