Theorem W, option (A), stage A2: small values along a run of the core language #
The invariant that stage A2 carries through the core procedures.
VB K KH κ s: the values stored in coresare small: every field below2^K(the handle below2^KH), the parameters, the list entries, the path entries and the optional records below2^K. It is the value part ofMemW; the capacity part (sizes, list lengths,pw = H + 1) comes from an encoding (EncOK), which every run ofevalFkeeps (EncOK.of_ok, fromsim).VB.memWputs them together.- The write primitives keep
VBwhen the value written is small:VB.set(a field),VB.push,VB.lset(a list), and the path, preparation and job records (VB.pwr, …). Exp.vw: the width of an expression's value, asExp.wvofPeakBound.leanbut sharper on the patterns the core code uses formax, truncated subtraction, a 0/1 factor and halving, so thatmonus p 1,max c 1,ifz (θ < p) pand(a + b) / 2keep the width of their operands.Exp.vw_sound.
Nothing here is used by Theorems A and B.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The invariant #
Room in K for the parameters used as shift amounts and label widths.
A label of an even table is below
2^(β + 9)(at most 162 entries).A digit shifted to the top level,
2^(H·β).The walk's threshold
a ^ ht = 1 <<< (log₂ a · ht)(powS), for heightsht ≤ H.
Instances For
The values stored in a core are small (the value part of MemW), and the parameters
leave room in K.
Instances For
Core s has an encoding with capacities κ (in some slot of some machine state).
Equations
- OrderMaintenance.Impl.EncOK κ s = ∃ (p : ℕ) (m : OrderMaintenance.Machine.State), OrderMaintenance.Impl.Enc p κ s m
Instances For
Lists of small pairs #
The fields, lists, sizes and parameters do not see the path rows and the optional records.
A path write to a chunk that is not being prepared.
A fresh row of NILs for a chunk that is not being prepared.
A new preparation record.
New height, below and tag of the preparation record.
A level of the path being built.
The built path becomes the chunk's.
A new job.
A new program counter of the running job.
A sharper width for the values of expressions #
A comparison or connective: its value is 0 or 1.
Equations
- (OrderMaintenance.Impl.Exp.bin OrderMaintenance.Machine.BinOp.lt a b).isCmp = true
- (OrderMaintenance.Impl.Exp.bin OrderMaintenance.Machine.BinOp.le a b).isCmp = true
- (OrderMaintenance.Impl.Exp.bin OrderMaintenance.Machine.BinOp.eq a b).isCmp = true
- (OrderMaintenance.Impl.Exp.bin OrderMaintenance.Machine.BinOp.and a b).isCmp = true
- (OrderMaintenance.Impl.Exp.bin OrderMaintenance.Machine.BinOp.or a b).isCmp = true
- (OrderMaintenance.Impl.Exp.un OrderMaintenance.Machine.UnOp.not a).isCmp = true
- x✝.isCmp = false
Instances For
An expression worth 0 or 1: a comparison, 1 − c of a comparison, or the literal 0 or 1.
Equations
- One or more equations did not get rendered due to their size.
- (OrderMaintenance.Impl.Exp.lit 0).isBool = ((OrderMaintenance.Impl.Exp.lit 0).isCmp || true)
- (OrderMaintenance.Impl.Exp.lit 1).isBool = ((OrderMaintenance.Impl.Exp.lit 1).isCmp || true)
- e.isBool = (e.isCmp || false)
Instances For
The width of op a b from the widths of a and b (sharper than BinOp.wd on the shapes
above, on a 0/1 factor and on division by a literal ≥ 2).
Equations
- OrderMaintenance.Machine.BinOp.vw S OrderMaintenance.Machine.BinOp.add a b wa wb = if a.maxShape b = true then max wa wb else max wa wb + 1
- OrderMaintenance.Machine.BinOp.vw S OrderMaintenance.Machine.BinOp.mul a b wa wb = if a.isBool = true then wb else if b.isBool = true then wa else wa + wb
- OrderMaintenance.Machine.BinOp.vw S OrderMaintenance.Machine.BinOp.div a (OrderMaintenance.Impl.Exp.lit n) wa wb = if 2 ≤ n then wa - 1 else wa
- OrderMaintenance.Machine.BinOp.vw S OrderMaintenance.Machine.BinOp.div a b wa wb = wa
- OrderMaintenance.Machine.BinOp.vw S op a b wa wb = OrderMaintenance.Machine.BinOp.wd S op wa wb
Instances For
The width of an expression's value, as Exp.wv with the sharper BinOp.vw.
Equations
- One or more equations did not get rendered due to their size.
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.lit n) = n
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.var x_1) = Γ x_1
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.rd f i) = OrderMaintenance.Impl.Fld.wd K KH f
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.size t) = K
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.prm k) = K
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.un op a) = op.wd (OrderMaintenance.Impl.Exp.vw Γ K KH S a)
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.lrd k snd i j) = K
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.llen k i) = K
- OrderMaintenance.Impl.Exp.vw Γ K KH S (c.prd j) = K
- OrderMaintenance.Impl.Exp.vw Γ K KH S (OrderMaintenance.Impl.Exp.opt f) = K
Instances For
The value of an expression is below 2^vw.
The width of an expression's peak, as Exp.wp with the value widths of Exp.vw.
Equations
- One or more equations did not get rendered due to their size.
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.lit n) = n
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.var x_1) = Γ x_1
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.rd f i) = max (OrderMaintenance.Impl.Exp.wq Γ K KH S i) (OrderMaintenance.Impl.Fld.wd K KH f)
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.size t) = K
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.prm k) = K
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.lrd k snd i j) = max (max (OrderMaintenance.Impl.Exp.wq Γ K KH S i) (OrderMaintenance.Impl.Exp.wq Γ K KH S j)) K
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.llen k i) = max (OrderMaintenance.Impl.Exp.wq Γ K KH S i) K
- OrderMaintenance.Impl.Exp.wq Γ K KH S (c.prd j) = max (max (OrderMaintenance.Impl.Exp.wq Γ K KH S c) (OrderMaintenance.Impl.Exp.wq Γ K KH S j)) K
- OrderMaintenance.Impl.Exp.wq Γ K KH S (OrderMaintenance.Impl.Exp.opt f) = K
Instances For
The peak of an expression is below 2^wq.
Runs keep the parameters #
The outcome keeps the parameters of s.
Equations
- OrderMaintenance.Impl.Res.keepsP s (OrderMaintenance.Impl.Res.ok s' L c) = (s'.P = s.P)
- OrderMaintenance.Impl.Res.keepsP s (OrderMaintenance.Impl.Res.fail s' L c) = (s'.P = s.P)
- OrderMaintenance.Impl.Res.keepsP s OrderMaintenance.Impl.Res.bug = True