Documentation

MIPRE.TM.Interp.Machine

The interpreter machine #

U is the multi-input Turing machine interpreting the programs of Instr.lean: a state is a program, a position in it and the phase of the instruction there (Ctl), and one step executes one phase of the current instruction (execInstr), producing head moves, writes, an optional output symbol and the next control: the same instruction in another phase, the next instruction, a jump to the start of another program, or a halt.

The instructions' semantics, phase by phase, is documented on execInstr; their specifications as reachability triples are in Routines.lean.

The control of the machine: a program, a position, a phase.

Instances For
    def MIPRE.TM.Interp.instDecidableEqCtl.decEq (x✝ x✝¹ : Ctl) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      What an instruction phase does to the control.

      Instances For

        The actions of one step: input head moves, work-tape writes and moves, the output, and the next control.

        Instances For

          No moves, no writes, no output.

          Equations
          Instances For
            def MIPRE.TM.Interp.Act.mw (a : Act) (t : WT) (m : SignType) :

            Move the head of work tape t.

            Equations
            Instances For
              def MIPRE.TM.Interp.Act.ww (a : Act) (t : WT) (s : Option Sym) :

              Write s (none the blank) on work tape t.

              Equations
              Instances For
                def MIPRE.TM.Interp.Act.mi (a : Act) (j : IT) (m : SignType) :

                Move the head of input tape j.

                Equations
                Instances For

                  Emit s.

                  Equations
                  Instances For
                    def MIPRE.TM.Interp.execInstr (ins : Instr) (ph : Phase) (as : IT → Option Sym) (bs : WT → Option Sym) :

                    The semantics of an instruction phase, given the symbols under the input heads as and the work heads bs.

                    Equations
                    Instances For

                      The instruction at a position of a program (halt past the end).

                      Equations
                      Instances For

                        The interpreter machine.

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