NLA-lib Explorer

NLAlib.Ops.Examples.runsW_split

Library · theorem

The exact counts of a split, carried by the logic: one conversion, one call at the size read and one at the rest.

NLAlib.Ops.Examples.runsW_split {K Op : Type} {J : Ops.Interp Op Ops.IdxTst K} {o : Op}
  {dec : K → ℝ} (hK : J.Satisfies Ops.Mode.total o (Ops.Examples.idleRel.spec Ops.AnyOperands))
  (hidx : Ops.IsToNat dec J) (W : Op → List ℕ → ℕ) {τ : Ops.Tape K} {k : ℕ} {x : ℕ × ℕ}
  {m : Ops.Mem K} {w : K} (hx : m.store.get x.1 x.2 = some w) (h0 : 0 ≤ dec w)
  (hle : ⌊dec w⌋₊ ≤ k) :
  Ops.ConditionalRunsW J W τ (Ops.Examples.split o) { idx := [k, x.2], buf := [x.1] } m
    (max (W o [⌊dec w⌋₊]) (W o [k - ⌊dec w⌋₊])) fun c m' ↦
    m' = m ∧
      c =
        Ops.Count.test Ops.IdxTst.toNat [] +
          (Ops.Count.one o [⌊dec w⌋₊] + Ops.Count.one o [k - ⌊dec w⌋₊])

Full source on GitHub

Import NLAlib.Ops.Examples.Split.