MindFormal v1.0.0One Mind

MindFormal.Tools.A695LogicPaper.CumulativeSelection

def MindFormal.A695LogicPaper.IntegerProgram.cumulativeChoice {m : ℕ} :
(Fin (m + 1) → ℕ) → (Fin (m + 1) → ℕ) → ℕ → ℕ → ℕ
Equations
Instances For
    theorem MindFormal.A695LogicPaper.IntegerProgram.cumulativeChoice_select {m : ℕ} (counts labels : Fin (m + 1) → ℕ) (acc k : ℕ) :
    cumulativeChoice counts labels acc (acc + k + 1) = labels (SecurityProgram.selectCount counts k)
    def MindFormal.A695LogicPaper.IntegerProgram.cumulative {m : ℕ} :
    (Fin (m + 1) → ℕ) → (Fin (m + 1) → ℕ) → ℕ → ℕ → Builder ℕ
    Equations
    Instances For
      theorem MindFormal.A695LogicPaper.IntegerProgram.cumulative_safe {m : ℕ} (counts labels : Fin (m + 1) → ℕ) (acc threshold : ℕ) :
      Safe (cumulative counts labels acc threshold)
      theorem MindFormal.A695LogicPaper.IntegerProgram.cumulative_spec {m : ℕ} (counts labels : Fin (m + 1) → ℕ) (acc threshold fresh : ℕ) (v : Values) (hc : ∀ (i : Fin (m + 1)), counts i < fresh) (hl : ∀ (i : Fin (m + 1)), labels i < fresh) (hp : acc < fresh) (ht : threshold < fresh) :
      (cumulative counts labels acc threshold fresh).commands.length = 3 * m ∧ (cumulative counts labels acc threshold fresh).result < (cumulative counts labels acc threshold fresh).next ∧ evaluate (cumulative counts labels acc threshold fresh).commands v (cumulative counts labels acc threshold fresh).result = cumulativeChoice (fun (i : Fin (m + 1)) => v (counts i)) (fun (i : Fin (m + 1)) => v (labels i)) (v acc) (v threshold)

      Prefix sums, comparisons and the selected label are actual arithmetic commands. Every row is visited even when its cumulative test succeeds.