MindFormal v1.0.0One Mind

MindFormal.Example.PageBankRouting

Algebra of the existing mark-copying router and a separate NOR specification.

def MindFormal.PageBank.copiedMarks {M n : ℕ} (P : Program M n) (c : Fin n → Fin 3) (k : ℕ) :
Fin M → Bool

The marks obtained by copying a prefix of received labels. This is a derived description of route, with no state or additional interface.

Equations
Instances For
    theorem MindFormal.PageBank.copiedMarks_zero {M n : ℕ} (P : Program M n) (c : Fin n → Fin 3) :
    theorem MindFormal.PageBank.copiedMarks_succ {M n : ℕ} (P : Program M n) (c : Fin n → Fin 3) (j : Fin n) :
    copiedMarks P c (↑j + 1) = Function.update (copiedMarks P c ↑j) (P.gates j).2.2 (c j == 2)
    theorem MindFormal.PageBank.mode_at {M n : ℕ} (P : Program M n) (l : Fin (n + 1) → Fin 3 ⊕ Unit) (c : Fin n → Fin 3) (j : Fin n) (header : Fin 3) (h0 : l 0 = Sum.inl header) (hprev : ∀ (k : Fin n), ↑k < ↑j → l k.succ = Sum.inl (c k)) (hnext : l j.succ = Sum.inr ()) :
    mode P l = some (some (j, copiedMarks P c (↑j) (P.gates j).1, copiedMarks P c (↑j) (P.gates j).2.1))

    After the header and j received gate acts, the strict-past router offers gate j with exactly its copied marks. Later labels are irrelevant.

    theorem MindFormal.PageBank.copiedMarks_congr {M n : ℕ} (P : Program M n) (c d : Fin n → Fin 3) (k : ℕ) (he : ∀ (j : Fin n), ↑j < k → c j = d j) :

    Changing received labels after the copied prefix cannot affect its marks.

    def MindFormal.PageBank.idealMarks {M n : ℕ} (P : Program M n) :
    ℕ → Fin M → Bool

    Ideal NOR evaluation is only a specification; the world reads route.

    Equations
    Instances For
      theorem MindFormal.PageBank.copiedMarks_eq_of_bits {M n : ℕ} (P : Program M n) (c : Fin n → Fin 3) {k : ℕ} (hk : k ≤ n) (hc : ∀ (j : Fin n), ↑j < k → (c j == 2) = !(idealMarks P (↑j) (P.gates j).1 || idealMarks P (↑j) (P.gates j).2.1)) :

      Decoding the ideal next bit at each prefix determines every copied mark. This is the mark-readout induction used by the original exact-bank result.

      theorem MindFormal.PageBank.copiedMarks_eq_ideal {M n : ℕ} (P : Program M n) (c : Fin n → Fin 3) {k : ℕ} (hk : k ≤ n) (hc : ∀ (j : Fin n), ↑j < k → correct (copiedMarks P c (↑j) (P.gates j).1) (copiedMarks P c (↑j) (P.gates j).2.1) (c j)) :

      A prefix of correctly decoded native labels gives exactly the ideal NOR marks. Neither this specification nor NOR is used by the world's router.