Documentation

LeanPool.OrderMaintenance.Impl.Reservation

M6: the reservation loop at Level M #

reservation k: up to k rounds; a round resumes the running job, or, with no job, pops the fullest quiet chunk and starts its split, or stops when the queue is empty. The machine has no return, so a flag dn makes the remaining rounds empty, as in driveGroupFrom.

The body of Level F's reservation loop (as elaborated).

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Procedure performing one suspended reservation-job step.

    Equations
    Instances For

      Procedure starting a chunk split and its reservation job.

      Equations
      Instances For

        Spend one reservation iteration on the active job or the largest queued chunk.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def OrderMaintenance.Impl.ResAgree (κ : Caps) (t t' : Model.Core) (stop : Bool) (D : ℕ) :

          A Level M round that agrees with a Level F one (stop: Level F's round ended the loop).

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            A round's Level F outcome: stop (done) or go on (yield).

            Equations
            Instances For
              theorem OrderMaintenance.Impl.reservationS_agree (κ : Caps) (s : Model.Core) (L : Loc) {D : ℕ} (I : ℕ → Model.Core → Prop) (h0 : I 0 s) (hstep : ∀ (j : ℕ) (t : Model.Core), I j t → j < s.P.reservationBudget → ∃ (stop : Bool) (t' : Model.Core), EStateM.run (resF j (none, ())) t = EStateM.Result.ok (resOut stop) t' ∧ (stop = false → I (j + 1) t') ∧ ResAgree κ t t' stop D) :

              The three kinds of rounds #

              theorem OrderMaintenance.Impl.resAgree_empty {κ : Caps} {t : Model.Core} (hj : t.resJob = none) (h0 : t.pqHi = 0) :
              ResAgree κ t t true 40

              The program agrees with Level F's jobStep j from t (within D steps).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem OrderMaintenance.Impl.resF_job {t t1 : Model.Core} {i : ℕ} {j : Model.Job} {r : Option Model.Job} (hj : t.resJob = some j) (h : EStateM.run (Model.jobStep j) t = EStateM.Result.ok r t1) :
                EStateM.run (resF i (none, ())) t = EStateM.Result.ok (resOut false) { P := t1.P, E := t1.E, Gs := t1.Gs, C := t1.C, freeG := t1.freeG, count := t1.count, head := t1.head, tail := t1.tail, firstGroup := t1.firstGroup, firstChunk := t1.firstChunk, ready := t1.ready, prep := t1.prep, resJob := r, fallbacks := t1.fallbacks, pqHead := t1.pqHead, pqNext := t1.pqNext, pqPrev := t1.pqPrev, pqWhere := t1.pqWhere, nbNext := t1.nbNext, nbPrev := t1.nbPrev, pqHi := t1.pqHi, pqLo := t1.pqLo, nodes := t1.nodes, path := t1.path, cin := t1.cin, lpar := t1.lpar }
                theorem OrderMaintenance.Impl.resAgree_job {κ : Caps} {t t1 : Model.Core} {j : Model.Job} {r : Option Model.Job} {D : ℕ} (hj : t.resJob = some j) (hA : JobAgree κ t j D) (h : EStateM.run (Model.jobStep j) t = EStateM.Result.ok r t1) :
                ResAgree κ t { P := t1.P, E := t1.E, Gs := t1.Gs, C := t1.C, freeG := t1.freeG, count := t1.count, head := t1.head, tail := t1.tail, firstGroup := t1.firstGroup, firstChunk := t1.firstChunk, ready := t1.ready, prep := t1.prep, resJob := r, fallbacks := t1.fallbacks, pqHead := t1.pqHead, pqNext := t1.pqNext, pqPrev := t1.pqPrev, pqWhere := t1.pqWhere, nbNext := t1.nbNext, nbPrev := t1.nbPrev, pqHi := t1.pqHi, pqLo := t1.pqLo, nodes := t1.nodes, path := t1.path, cin := t1.cin, lpar := t1.lpar } false (D + 10)

                The program agrees with Level F's splitChunkStart c from t (within D steps).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem OrderMaintenance.Impl.resAgree_split {κ : Caps} {t t1 t2 : Model.Core} {c D : ℕ} (hj : t.resJob = none) (hq : PQCaps κ t) (h0 : t.pqHi ≠ 0) (hp : EStateM.run Model.pqPopMax t = EStateM.Result.ok c t1) (hA : SplitAgree κ t1 c D) (hs : EStateM.run (Model.splitChunkStart c) t1 = EStateM.Result.ok () t2) :
                  ResAgree κ t t2 false (D + 300)
                  theorem OrderMaintenance.Impl.splitAgree_ok {κ : Caps} {s : Model.Core} {x f1x i1 B : ℕ} (hx0 : x ≠ Model.NIL) (hxs : x < s.C.size) (hC : s.C.size + 2 ≤ κ.tbl Tbl.C) (hp : (s.C.getX x).prev ≠ Model.NIL → (s.C.getX x).prev < s.C.size) (hn : (s.C.getX x).next ≠ Model.NIL → (s.C.getX x).next < s.C.size) (hia : IAOK κ (Model.linkChunkPair (Proof.push2 s) x s.C.size (s.C.size + 1)) x s.C.size (s.C.size + 1) f1x i1 B) :
                  SplitAgree κ s x (150 + iaCost (Model.linkChunkPair (Proof.push2 s) x s.C.size (s.C.size + 1)) x B)