MindFormal v1.0.0One Mind

MindFormal.Tools.A705SupportPrograms.TuringDesk

25.7 part 4: any deterministic Turing machine with finite control and tape alphabets, its transition table encoded in one-hot bits and compiled into NOR, and the generic record interface that loads the control and scanned-symbol bits, stores each returned bit in its instruction's register, and at the end of a circuit copies the returned control and symbol bits and moves the head. The interface evaluates no gate; on the reference returned bits it holds, after s circuits, the machine's s-th configuration.

A head move.

Instances For

    The move written by a halt bit and a direction bit.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      structure MindFormal.A705SupportPrograms.Machine (Q : Type u_1) (Γ : Type u_2) :
      Type (max u_1 u_2)

      A deterministic Turing machine: finite control Q, finite tape alphabet Γ, and a total transition giving the next control, the written symbol and the move.

      Instances For
        structure MindFormal.A705SupportPrograms.Machine.Config (Q : Type u_1) (Γ : Type u_2) :
        Type (max u_1 u_2)

        A machine configuration: control, tape and head.

        • q : Q
        • tape : ℤ → Γ
        • head : ℤ
        Instances For
          def MindFormal.A705SupportPrograms.Machine.step {Q : Type u_1} {Γ : Type u_2} (M : Machine Q Γ) (c : Config Q Γ) :
          Config Q Γ

          One machine step.

          Equations
          Instances For
            noncomputable def MindFormal.A705SupportPrograms.code (α : Type u_3) [Fintype α] (a : α) :

            The one-hot code of a finite symbol.

            Equations
            Instances For
              noncomputable def MindFormal.A705SupportPrograms.uncode (α : Type u_3) [Fintype α] [Nonempty α] (v : Fin (Fintype.card α) → Bool) :
              α

              Reading a code back; an unused code reads as a fixed dummy symbol.

              Equations
              Instances For
                theorem MindFormal.A705SupportPrograms.uncode_code (α : Type u_3) [Fintype α] [Nonempty α] (a : α) :
                uncode α (code α a) = a

                The record's marks for dc control bits and ds bits per tape symbol.

                Instances For

                  Registers loaded from the record: control bits 0…dc-1, the scanned symbol's bits dc…dc+ds-1, and every other register clear (the constant zero dc+ds among them).

                  Equations
                  Instances For
                    def MindFormal.A705SupportPrograms.Sheet.finish {dc ds : ℕ} (p : Sheet dc ds) (R : ℕ → Bool) :
                    Sheet dc ds

                    The end of a transition circuit: copy the returned control and symbol bits from the output registers and move the head as the returned halt and direction bits say.

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

                      The interface's state: the record's marks, the instruction pointer and the registers.

                      Instances For
                        def MindFormal.A705SupportPrograms.Desk.start {dc ds : ℕ} (p : Sheet dc ds) :
                        Desk dc ds
                        Equations
                        Instances For
                          def MindFormal.A705SupportPrograms.Desk.store {dc ds : ℕ} (gs : List Gate) (w : Desk dc ds) (b : Bool) :
                          Desk dc ds

                          Store a returned bit in the current instruction's register and advance the pointer; after the circuit's last instruction finish the transition and reload.

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

                            The two operand bits the interface presents: the current instruction's registers.

                            Equations
                            Instances For

                              The interface: after a list of returned bits, the operands it presents.

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

                                The reference returned bits: each the NOR of the operands presented after the earlier ones.

                                Equations
                                Instances For
                                  def MindFormal.A705SupportPrograms.Desk.tick {dc ds : ℕ} (gs : List Gate) (w : Desk dc ds) :
                                  Desk dc ds

                                  One reference instruction: present, return the NOR, store.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem MindFormal.A705SupportPrograms.tick_prefix {dc ds : ℕ} (gs : List Gate) (p : Sheet dc ds) (g : ℕ) (hg : g < gs.length) :
                                    (Desk.tick gs)^[g] (Desk.start p) = { sheet := p, pos := g, regs := runGates p.load (List.take g gs) }

                                    Within a circuit: after g reference instructions the registers are the program prefix's.

                                    theorem MindFormal.A705SupportPrograms.tick_circuit {dc ds : ℕ} (gs : List Gate) (hL : 0 < gs.length) (p : Sheet dc ds) :

                                    A whole circuit: the transition is finished from the program's registers and reloaded.

                                    theorem MindFormal.A705SupportPrograms.tick_circuits {dc ds : ℕ} (gs : List Gate) (hL : 0 < gs.length) (p : Sheet dc ds) (s : ℕ) :
                                    (Desk.tick gs)^[s * gs.length] (Desk.start p) = Desk.start ((fun (p : Sheet dc ds) => p.finish (runGates p.load gs))^[s] p)
                                    noncomputable def MindFormal.A705SupportPrograms.Machine.circuit {Q : Type u_1} {Γ : Type u_2} [Fintype Q] [Fintype Γ] [Nonempty Q] [Nonempty Γ] (M : Machine Q Γ) (v : Fin (Fintype.card Q + Fintype.card Γ) → Bool) (j : Fin (Fintype.card Q + Fintype.card Γ + 2)) :

                                    The machine's transition table on its one-hot codes: inputs are the control code then the scanned symbol's code; outputs the next control's code, the written symbol's code, the halt bit and the direction bit. Unused codes read as dummy symbols.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      noncomputable def MindFormal.A705SupportPrograms.Machine.program {Q : Type u_1} {Γ : Type u_2} [Fintype Q] [Fintype Γ] [Nonempty Q] [Nonempty Γ] (M : Machine Q Γ) :

                                      The compiled NOR program of the machine's transition table.

                                      Equations
                                      Instances For
                                        noncomputable def MindFormal.A705SupportPrograms.Machine.sheet {Q : Type u_1} {Γ : Type u_2} [Fintype Q] [Fintype Γ] (c : Config Q Γ) :

                                        The record's marks for a configuration.

                                        Equations
                                        Instances For

                                          PAGE2's loose count for the machine's program.

                                          theorem MindFormal.A705SupportPrograms.Machine.finish_program {Q : Type u_1} {Γ : Type u_2} [Fintype Q] [Fintype Γ] [Nonempty Q] [Nonempty Γ] (M : Machine Q Γ) (c : Config Q Γ) :

                                          One circuit on the record of a configuration leaves the record of the next configuration.

                                          The interface on the reference bits: after s circuits (s · L returned bits) the record holds the machine's s-th configuration, freshly loaded.

                                          theorem MindFormal.A705SupportPrograms.Machine.visited_span {Q : Type u_1} {Γ : Type u_2} (M : Machine Q Γ) (c0 : Config Q Γ) (a b : ℤ) (ha : a ≤ c0.head) (hb : c0.head ≤ b) (N : ℕ) :
                                          ∃ (lo : ℤ) (hi : ℤ), lo ≤ a ∧ b ≤ hi ∧ (∀ s ≤ N, lo ≤ (M.step^[s] c0).head ∧ (M.step^[s] c0).head ≤ hi) ∧ hi - lo + 1 ≤ b - a + 1 + ↑N

                                          The visited tape span: the initially specified cells [a, b] (holding the head) and every head position through N steps lie in one interval of at most (b - a + 1) + N cells.