Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LogSpace.ConfigurationGraph.Basic

Compact configuration graph: local arithmetic #

The graph stores no input word. A vertex is a fixed tuple of natural registers packed in a radix B: the input position, control, output summary, and three registers per work tape. Logarithmic space uses the radix (n+2)^D (Turing.MultiTapeNTM.ConfigurationGraph.radix); larger space bounds use larger radices. An edge consults at most the input bit at queryIndex; the supplied symbol is ignored at the blank boundaries. The transition table is fixed independently of n.

Every edge checks both vertex bounds, the semantic tag ranges and successor-register overflow. The three output tags mean empty, exactly true, and permanently rejecting. In particular, an emission after either nonempty output tag gives the rejecting tag.

Main definitions #

References #

The fixed register names for a machine with k tapes.

Instances For
    Instances For
      noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.stateCode {State : Type} [Fintype State] (q : Option State) :

      A fixed finite control tag, including a distinct halting tag.

      Instances For

        Empty output is zero; the singleton true is one; everything else is rejecting.

        Instances For

          Update the acceptance summary on an optional emission.

          Instances For
            noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.registers {k : ℕ} {State : Type} [Fintype State] (v : FiniteCfg k Bool State) :

            The fixed tuple of input-free registers of a view.

            Instances For

              The radix (n+2)^D used in logarithmic space, with an exponent fixed with the source machine and its space constant.

              Instances For

                Number of vertices in the ambient graph of radix B, including invalid IDs.

                Instances For

                  The number of bits of a vertex of the graph of radix B: every vertex ID is below 2 ^ vertexWidth k B.

                  Instances For

                    Every vertex ID of the graph of radix B fits in vertexWidth k B bits.

                    All components fit below the radix.

                    Instances For
                      noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.vertexID {k : ℕ} {State : Type} [Fintype State] (B : ℕ) (v : FiniteCfg k Bool State) :

                      Packed input-free configuration ID.

                      Instances For

                        Read the registers of an arbitrary ID.

                        Instances For

                          The input bit to request, in the native zero-based word indexing. Boundary requests are ignored by inputSymbol; the right boundary may request the absent bit at n.

                          Instances For

                            Force blank at both boundaries; otherwise use the one externally supplied input symbol.

                            Instances For

                              Clamped movement of the input head, computed on its binary position.

                              Instances For
                                noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.nextRegisters {k : ℕ} {State : Type} [Fintype State] (n : ℕ) (r : Register k → ℕ) (a : Action k Bool State) :

                                Update the fixed register tuple by a fixed native action.

                                Instances For

                                  The finite tuple of fields of a native action.

                                  Instances For
                                    @[instance_reducible]

                                    Native actions form a finite type over finite control and a fixed tape count.

                                    Instances For
                                      @[reducible, inline]

                                      One entry in the machine's fixed finite transition table.

                                      Instances For
                                        noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.instructions {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) :
                                        List (Instruction k State)

                                        The finite table is selected once from the source transition relation. Its selection need not be uniform in the machine; no runtime input influences this table.

                                        Instances For
                                          theorem Turing.MultiTapeNTM.ConfigurationGraph.mem_instructions {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (t : Instruction k State) :
                                          t ∈ instructions ntm ↔ ntm.Tr t.1 t.2.1 t.2.2.1 t.2.2.2
                                          noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.valid {k : ℕ} {State : Type} [Fintype State] (B n u : ℕ) :

                                          Syntactic validity of an ID. All ternary stack naturals are canonical; only finite tags, input geometry, and the overall bound require guards.

                                          Instances For
                                            noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.matchesEntry {k : ℕ} {State : Type} [Fintype State] (n : ℕ) (r : Register k → ℕ) (symbol : Option Bool) (t : Instruction k State) :

                                            Check that a decoded source has the observations of a fixed table entry.

                                            Instances For
                                              noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.fitsB {k : ℕ} (B : ℕ) (r : Register k → ℕ) :

                                              Guard every successor component against radix overflow.

                                              Instances For
                                                noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.edgeWithSymbol {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B n u v : ℕ) (symbol : Option Bool) :

                                                One actual input read suffices for this edge predicate. The work is arithmetic on the short stored arguments and a fixed finite transition table.

                                                Instances For
                                                  noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.bad {k : ℕ} {State : Type} [Fintype State] (B n u : ℕ) :

                                                  Accepting halted vertices, the bad set for complement reachability.

                                                  Instances For
                                                    noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.overflow {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B n u : ℕ) (symbol : Option Bool) :

                                                    Vertices with a matching transition whose successor overflows the radix. These are the represented views from which the source leaves the graph of radix B.

                                                    Instances For
                                                      noncomputable def Turing.MultiTapeNTM.ConfigurationGraph.startID {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B : ℕ) :

                                                      The start vertex depends only on the radix, since initial storage is blank.

                                                      Instances For
                                                        def Turing.MultiTapeNTM.ConfigurationGraph.Edge {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B : ℕ) (w : List Bool) (u v : ℕ) :

                                                        The graph on an actual input; it reads no other bit than queryIndex.

                                                        Instances For
                                                          def Turing.MultiTapeNTM.ConfigurationGraph.Overflow {k : ℕ} {State : Type} [Fintype State] (ntm : MultiTapeNTM k Bool State) (B : ℕ) (w : List Bool) (u : ℕ) :

                                                          The overflow test on an actual input, reading the bit at queryIndex.

                                                          Instances For