Documentation

LeanPool.OrderMaintenance.Impl.PeakW

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.

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.

    Instances For
      structure OrderMaintenance.Impl.VB (K KH : ℕ) (κ : Caps) (s : Model.Core) :

      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
        Instances For
          theorem OrderMaintenance.Impl.VB.memW {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) (hE : EncOK κ s) (hC : CapsW K κ) :
          MemW K KH κ s
          theorem OrderMaintenance.Impl.EncOK.of_ok {κ : Caps} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (hE : EncOK κ s) {c : Stm} (h : evalF κ c s L = Res.ok s' L' n) :
          EncOK κ s'
          theorem OrderMaintenance.Impl.EncOK.of_fail {κ : Caps} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (hE : EncOK κ s) {c : Stm} (h : evalF κ c s L = Res.fail s' L' n) :
          EncOK κ s'
          theorem OrderMaintenance.Impl.EncOK.llen {κ : Caps} {s : Model.Core} (hE : EncOK κ s) (k : LK) {i : ℕ} (hi : i < κ.lrec k) :
          (LK.view s i k).length ≤ κ.lcap k
          theorem OrderMaintenance.Impl.EncOK.sle {κ : Caps} {s : Model.Core} (hE : EncOK κ s) (t : Tbl) :
          Tbl.size s t ≤ κ.tbl t
          theorem OrderMaintenance.Impl.EncOK.pwH {κ : Caps} {s : Model.Core} (hE : EncOK κ s) :
          κ.pw = s.P.H + 1
          theorem OrderMaintenance.Impl.EncOK.prepC {κ : Caps} {s : Model.Core} (hE : EncOK κ s) {pr : Model.Prep} (hp : s.prep = some pr) :

          Lists of small pairs #

          Every entry of l is a pair of values below 2^K.

          Equations
          Instances For
            theorem OrderMaintenance.Impl.getD_mem' {α : Type} {l : List α} {j : ℕ} {d : α} (hj : j < l.length) :
            l.getD j d ∈ l
            theorem OrderMaintenance.Impl.VB.lb {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) (k : LK) {i : ℕ} (hi : i < κ.lrec k) :
            LB K (LK.view s i k)
            theorem OrderMaintenance.Impl.LB.getD {K : ℕ} {l : List (ℕ × ℕ)} (h : LB K l) {j : ℕ} (hj : j < l.length) :
            (l.getD j (0, 0)).1 < 2 ^ K ∧ (l.getD j (0, 0)).2 < 2 ^ K
            theorem OrderMaintenance.Impl.LB.set {K : ℕ} {l : List (ℕ × ℕ)} (h : LB K l) {j : ℕ} {q : ℕ × ℕ} (hq : q.1 < 2 ^ K ∧ q.2 < 2 ^ K) :
            LB K (l.set j q)
            theorem OrderMaintenance.Impl.LB.append {K : ℕ} {l : List (ℕ × ℕ)} (h : LB K l) {q : ℕ × ℕ} (hq : q.1 < 2 ^ K ∧ q.2 < 2 ^ K) :
            LB K (l ++ [q])
            theorem OrderMaintenance.Impl.LB.dropLast {K : ℕ} {l : List (ℕ × ℕ)} (h : LB K l) :

            Writes keep VB #

            theorem OrderMaintenance.Impl.VB.set {K KH : ℕ} {κ : Caps} {s s' : Model.Core} (hV : VB K KH κ s) {f : Fld} {i v : ℕ} (h : Fld.set κ s i v f = some s') (hv : v < 2 ^ Fld.wd K KH f) :
            VB K KH κ s'
            theorem OrderMaintenance.Impl.VB.push {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) (t : Tbl) :
            VB K KH κ (Tbl.push s t)
            theorem OrderMaintenance.Impl.VB.lset {K KH : ℕ} {κ : Caps} {s s' : Model.Core} (hV : VB K KH κ s) {k : LK} {x : ℕ} {l : List (ℕ × ℕ)} (h : LK.set κ s x l k = some s') (hl : LB K l) :
            VB K KH κ s'
            theorem OrderMaintenance.Impl.fld_path {s : Model.Core} (f : Fld) (j : ℕ) (p : Array (Array ℕ)) :
            Fld.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := p, cin := s.cin, lpar := s.lpar } j f = Fld.get s j f

            The fields, lists, sizes and parameters do not see the path rows and the optional records.

            theorem OrderMaintenance.Impl.fld_prep {s : Model.Core} (f : Fld) (j : ℕ) (p : Option Model.Prep) :
            Fld.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := p, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } j f = Fld.get s j f
            theorem OrderMaintenance.Impl.fld_job {s : Model.Core} (f : Fld) (j : ℕ) (p : Option Model.Job) :
            Fld.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := p, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } j f = Fld.get s j f
            theorem OrderMaintenance.Impl.fld_pp {s : Model.Core} (f : Fld) (j : ℕ) (a : Array (Array ℕ)) (p : Option Model.Prep) :
            Fld.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := p, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := a, cin := s.cin, lpar := s.lpar } j f = Fld.get s j f
            theorem OrderMaintenance.Impl.view_path {s : Model.Core} (k : LK) (i : ℕ) (p : Array (Array ℕ)) :
            LK.view { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := p, cin := s.cin, lpar := s.lpar } i k = LK.view s i k
            theorem OrderMaintenance.Impl.view_prep {s : Model.Core} (k : LK) (i : ℕ) (p : Option Model.Prep) :
            LK.view { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := p, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } i k = LK.view s i k
            theorem OrderMaintenance.Impl.view_job {s : Model.Core} (k : LK) (i : ℕ) (p : Option Model.Job) :
            LK.view { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := p, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } i k = LK.view s i k
            theorem OrderMaintenance.Impl.view_pp {s : Model.Core} (k : LK) (i : ℕ) (a : Array (Array ℕ)) (p : Option Model.Prep) :
            LK.view { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := p, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := a, cin := s.cin, lpar := s.lpar } i k = LK.view s i k
            theorem OrderMaintenance.Impl.opt_path {s : Model.Core} (o : OF) (p : Array (Array ℕ)) :
            OF.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := p, cin := s.cin, lpar := s.lpar } o = OF.get s o
            theorem OrderMaintenance.Impl.opt_job_prep {s : Model.Core} (o : OF) (p : Option Model.Job) (h : o = OF.prepOn ∨ o = OF.prepChunk ∨ o = OF.prepH ∨ o = OF.prepBelow ∨ o = OF.prepTag) :
            OF.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := p, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } o = OF.get s o
            theorem OrderMaintenance.Impl.opt_prep_job {s : Model.Core} (o : OF) (p : Option Model.Prep) (h : ¬(o = OF.prepOn ∨ o = OF.prepChunk ∨ o = OF.prepH ∨ o = OF.prepBelow ∨ o = OF.prepTag)) :
            OF.get { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := p, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } o = OF.get s o
            theorem OrderMaintenance.Impl.rowOf_job {s : Model.Core} (p : Option Model.Job) (c : ℕ) :
            rowOf { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := p, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar } c = rowOf s c
            theorem OrderMaintenance.Impl.b2n_lt' {K : ℕ} (hK : 1 ≤ K) (b : Bool) :
            b2n b < 2 ^ K
            theorem OrderMaintenance.Impl.lt_pow_of_le {n K : ℕ} (h : n ≤ 4) (hK : 3 ≤ K) :
            n < 2 ^ K
            theorem OrderMaintenance.Impl.VB.pwr {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {x y v : ℕ} (hx : notPrep s x) (hv : v < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path.setX x ((s.path.getX x).setX y v), cin := s.cin, lpar := s.lpar }

            A path write to a chunk that is not being prepared.

            theorem OrderMaintenance.Impl.VB.rowReset {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {x n : ℕ} (_hx : notPrep s x) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path.setX x (Array.replicate n Model.NIL), cin := s.cin, lpar := s.lpar }

            A fresh row of NILs for a chunk that is not being prepared.

            theorem OrderMaintenance.Impl.VB.prepInit {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) (hK : 3 ≤ K) {x y n : ℕ} (hp : s.prep = none) (hx : x < 2 ^ K) (hy : y < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := some { chunk := x, below := y, path := Array.replicate n Model.NIL }, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }

            A new preparation record.

            theorem OrderMaintenance.Impl.VB.prepSet {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {pr : Model.Prep} (hp : s.prep = some pr) {a b c : ℕ} (ha : a < 2 ^ K) (hb : b < 2 ^ K) (hc : c < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := some { chunk := pr.chunk, h := a, below := b, tag := c, path := pr.path }, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }

            New height, below and tag of the preparation record.

            theorem OrderMaintenance.Impl.VB.prepPath {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {pr : Model.Prep} (hp : s.prep = some pr) {y v : ℕ} (hv : v < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := some { chunk := pr.chunk, h := pr.h, below := pr.below, tag := pr.tag, path := pr.path.setX y v }, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }

            A level of the path being built.

            theorem OrderMaintenance.Impl.VB.prepCommit {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {pr : Model.Prep} (hp : s.prep = some pr) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, resJob := s.resJob, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path.setX pr.chunk pr.path, cin := s.cin, lpar := s.lpar }

            The built path becomes the chunk's.

            theorem OrderMaintenance.Impl.VB.jobSet {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) (hK : 1 ≤ K) {x y z t a b c d : ℕ} {pc : Model.JobPc} (hpc : pcDec t a b c d = some pc) (hx : x < 2 ^ K) (hy : y < 2 ^ K) (hz : z < 2 ^ K) (ht : t < 2 ^ K) (ha : a < 2 ^ K) (hb : b < 2 ^ K) (hc : c < 2 ^ K) (hd : d < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := some { x := x, y := y, z := z, pc := pc }, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }

            A new job.

            theorem OrderMaintenance.Impl.VB.jobClear {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }
            theorem OrderMaintenance.Impl.VB.pcSet {K KH : ℕ} {κ : Caps} {s : Model.Core} (hV : VB K KH κ s) {jb : Model.Job} (hj : s.resJob = some jb) {t a b c d : ℕ} {pc : Model.JobPc} (hpc : pcDec t a b c d = some pc) (ht : t < 2 ^ K) (ha : a < 2 ^ K) (hb : b < 2 ^ K) (hc : c < 2 ^ K) (hd : d < 2 ^ K) :
            VB K KH κ { P := s.P, E := s.E, Gs := s.Gs, C := s.C, freeG := s.freeG, count := s.count, head := s.head, tail := s.tail, firstGroup := s.firstGroup, firstChunk := s.firstChunk, ready := s.ready, prep := s.prep, resJob := some { x := jb.x, y := jb.y, z := jb.z, pc := pc }, fallbacks := s.fallbacks, pqHead := s.pqHead, pqNext := s.pqNext, pqPrev := s.pqPrev, pqWhere := s.pqWhere, nbNext := s.nbNext, nbPrev := s.nbPrev, pqHi := s.pqHi, pqLo := s.pqLo, nodes := s.nodes, path := s.path, cin := s.cin, lpar := s.lpar }

            A new program counter of the running job.

            A sharper width for the values of expressions #

            An expression worth 0 or 1: a comparison, 1 − c of a comparison, or the literal 0 or 1.

            Equations
            Instances For

              a + b is c·X + (1 − c)·Y for a comparison c (the shape of Exp.max): one summand is 0.

              Equations
              • One or more equations did not get rendered due to their size.
              • x✝¹.maxShape x✝ = false
              Instances For
                def OrderMaintenance.Machine.BinOp.vw (S : ℕ) (op : BinOp) (a b : Impl.Exp) (wa wb : ℕ) :

                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
                Instances For
                  theorem OrderMaintenance.Machine.BinOp.vw_add (S : ℕ) (a b : Impl.Exp) (wa wb : ℕ) :
                  vw S add a b wa wb = if a.maxShape b = true then max wa wb else max wa wb + 1
                  theorem OrderMaintenance.Machine.BinOp.vw_mul (S : ℕ) (a b : Impl.Exp) (wa wb : ℕ) :
                  vw S mul a b wa wb = if a.isBool = true then wb else if b.isBool = true then wa else wa + wb
                  theorem OrderMaintenance.Machine.BinOp.vw_div_lit (S : ℕ) (a : Impl.Exp) (n wa wb : ℕ) :
                  vw S div a (Impl.Exp.lit n) wa wb = if 2 ≤ n then wa - 1 else wa
                  theorem OrderMaintenance.Impl.Exp.isCmp_le {κ : Caps} {s : Model.Core} {L : Loc} {c : Exp} (h : c.isCmp = true) {v : ℕ} (hv : ev κ s L c = some v) :
                  v ≤ 1
                  theorem OrderMaintenance.Impl.Exp.isBool_le {κ : Caps} {s : Model.Core} {L : Loc} {c : Exp} (h : c.isBool = true) {v : ℕ} (hv : ev κ s L c = some v) :
                  v ≤ 1
                  theorem OrderMaintenance.Impl.lt_two_of_lt_pow {x w : ℕ} (hx : x < 2 ^ w) (hw : w ≤ 1) :
                  x ≤ 1
                  theorem OrderMaintenance.Impl.Exp.vw_sound {K KH : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} {Γ : Machine.Reg → ℕ} (hM : MemW K KH κ s) (hC : CapsW K κ) (hΓ : ∀ (x : Machine.Reg), L x < 2 ^ Γ x) {S : ℕ} (e : Exp) {v : ℕ} :
                  ShOK κ s L S e → ev κ s L e = some v → v < 2 ^ vw Γ K KH S e

                  The value of an expression is below 2^vw.

                  theorem OrderMaintenance.Impl.Exp.wq_sound {K KH : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} {Γ : Machine.Reg → ℕ} (hM : MemW K KH κ s) (hC : CapsW K κ) (hΓ : ∀ (x : Machine.Reg), L x < 2 ^ Γ x) {S : ℕ} (e : Exp) {v : ℕ} :
                  ShOK κ s L S e → ev κ s L e = some v → pk κ s L e < 2 ^ wq Γ K KH S e

                  The peak of an expression is below 2^wq.

                  theorem OrderMaintenance.Impl.pkList_lt' {K KH : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} {Γ : Machine.Reg → ℕ} (hM : MemW K KH κ s) (hC : CapsW K κ) (hΓ : ∀ (x : Machine.Reg), L x < 2 ^ Γ x) {S W : ℕ} {es : List Exp} {vs : List ℕ} :
                  (∀ e ∈ es, Exp.ShOK κ s L S e ∧ Exp.wq Γ K KH S e ≤ W) → evList κ s L es = some vs → pkList κ s L es < 2 ^ W

                  Runs keep the parameters #

                  theorem OrderMaintenance.Impl.Res.keepsP_bind {s : Model.Core} {r : Res} {g : Model.Core → Loc → Res} (h : keepsP s r) (hg : ∀ (s1 : Model.Core) (L1 : Loc), keepsP s1 (g s1 L1)) :
                  keepsP s (r.bind g)
                  theorem OrderMaintenance.Impl.LK.set_P {κ : Caps} {s s' : Model.Core} {i : ℕ} {l : List (ℕ × ℕ)} {k : LK} (h : set κ s i l k = some s') :
                  s'.P = s.P
                  theorem OrderMaintenance.Impl.runForF_keepsP {κ : Caps} (b : Stm) (x : Machine.Reg) (hb : ∀ (s : Model.Core) (L : Loc), Res.keepsP s (evalF κ b s L)) (n k : ℕ) (s : Model.Core) (L : Loc) :
                  Res.keepsP s (runForF (evalF κ b) x k n s L)
                  theorem OrderMaintenance.Impl.evalF_keepsP {κ : Caps} (c : Stm) (s : Model.Core) (L : Loc) :
                  Res.keepsP s (evalF κ c s L)
                  theorem OrderMaintenance.Impl.evalF_P {κ : Caps} {c : Stm} {s s' : Model.Core} {L L' : Loc} {n : ℕ} (h : evalF κ c s L = Res.ok s' L' n) :
                  s'.P = s.P

                  A run keeps the parameters.