Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.TMConfig.Defs

Bounded Turing-machine configurations in RAM registers #

This file fixes the register representation used by the Turing-machine to RAM simulation. Register zero stores the finite-state code, the next n + 2 registers store the input/work/output head positions, and the remaining registers store a dense bounded window of every named tape.

Blank symbols use code zero. Consequently registers outside the representation and blank cells inside it agree with the RAM's finite-support convention.

@[reducible, inline]

A field in a bounded configuration: state, a named tape head, or a named tape cell. Named tapes use input/work/output indices 0, 1..n, n+1.

Equations
Instances For

    Number of registers occupied by a configuration with cells 0..bound.

    Equations
    Instances For
      noncomputable def Complexity.RAM.TMConfig.fieldEquiv (n bound : ) :
      Field n bound Fin (registerCount n bound)

      Explicit contiguous ordering of all fields in the bounded representation.

      Equations
      Instances For

        The field holding the Turing-machine state.

        Equations
        Instances For
          def Complexity.RAM.TMConfig.headField {n bound : } (tape : Fin (n + 2)) :
          Field n bound

          The field holding one named tape's head position.

          Equations
          Instances For
            def Complexity.RAM.TMConfig.cellField {n bound : } (tape : Fin (n + 2)) (position : Fin (bound + 1)) :
            Field n bound

            The field holding one cell of one named tape.

            Equations
            Instances For
              noncomputable def Complexity.RAM.TMConfig.fieldReg {n bound : } (field : Field n bound) :

              Concrete register address of a bounded-configuration field.

              Equations
              Instances For
                noncomputable def Complexity.RAM.TMConfig.stateCode {n : } (tm : TM n) (state : tm.Q) :

                Canonical numeric code of a finite Turing-machine state.

                Equations
                Instances For
                  noncomputable def Complexity.RAM.TMConfig.stateDecode {n : } (tm : TM n) (code : ) :
                  tm.Q

                  Decode a valid state code, using the start state as the default for an invalid RAM word.

                  Equations
                  Instances For
                    def Complexity.RAM.TMConfig.tapeAt {n : } {Q : Type} (cfg : Complexity.Cfg n Q) (tape : Fin (n + 2)) :

                    Select a named tape by its input/work/output index.

                    Equations
                    Instances For

                      A tape is contained in the encoded window when every later cell is blank.

                      Equations
                      Instances For
                        def Complexity.RAM.TMConfig.Bounded {n : } {Q : Type} (cfg : Complexity.Cfg n Q) (bound : ) :

                        Every named tape in a configuration is contained in the encoded window.

                        Equations
                        Instances For
                          def Complexity.RAM.TMConfig.HeadsBounded {n : } {Q : Type} (cfg : Complexity.Cfg n Q) (bound : ) :

                          Every named head lies inside the encoded cell window.

                          Equations
                          Instances For
                            def Complexity.RAM.TMConfig.WithinWindow {n : } {Q : Type} (cfg : Complexity.Cfg n Q) (bound : ) :

                            A configuration can be stepped inside a bounded representation when both its nonblank cells and every named head lie in the represented window.

                            Equations
                            Instances For
                              noncomputable def Complexity.RAM.TMConfig.fieldValue {n : } (tm : TM n) (bound : ) (cfg : Complexity.Cfg n tm.Q) :
                              Field n bound

                              Natural-number value stored for one representation field.

                              Equations
                              Instances For
                                noncomputable def Complexity.RAM.TMConfig.encodeRegs {n : } (tm : TM n) (bound : ) (cfg : Complexity.Cfg n tm.Q) :

                                Register store containing a bounded Turing-machine configuration.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Complexity.RAM.TMConfig.Represents {n : } (tm : TM n) (bound : ) (cfg : Complexity.Cfg n tm.Q) (regs : ) :

                                  A RAM store represents a bounded TM configuration when every state/head/cell field has its prescribed value. Scratch registers outside this interface are deliberately unconstrained, allowing successive simulation blocks to compose.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    noncomputable def Complexity.RAM.TMConfig.encode {n : } (tm : TM n) (bound : ) (cfg : Complexity.Cfg n tm.Q) :

                                    RAM configuration positioned at the beginning of a simulation block.

                                    Equations
                                    Instances For
                                      noncomputable def Complexity.RAM.TMConfig.decodeTape {n : } (bound : ) (regs : ) (tape : Fin (n + 2)) :

                                      Decode one tape from its head register and bounded cell block.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        noncomputable def Complexity.RAM.TMConfig.decode {n : } (tm : TM n) (bound : ) (regs : ) :

                                        Decode a bounded register layout into a Turing-machine configuration.

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