Deterministic Multi-Tape Turing Machines #
A deterministic Turing machine is a nondeterministic machine whose transition relation has exactly
one action for every combination of state and symbols read. From the transition relation it derives
a transition function tr and a function step which maps each configuration to its unique
successor configuration (a halted configuration maps to itself).
The design choices for configurations and actions are documented in
Cslib.Computability.Machines.Turing.MultiTape.Configuration.
Important Declarations #
We define a number of structures and concepts related to multi-tape Turing machine computation:
MultiTapeNTM.IsDeterministic: the transition relation relates every state and tuple of read symbols to exactly one actionMultiTapeTM: the TM itselftr,ofTr: the derived transition function and construction from a functionstep,runFrom: the successor configuration and iteration of this functionMultiTapeNTM.RunPath.ofDeterministic,MultiTapeNTM.ComputationPath.ofDeterministic: paths of a given length from an arbitrary or initial configurationspace: the space of the path of the firsttsteps from a configurationComputes: the machine halts with the given output on an inputComputesInTimeAndSpace: the machine produces an output within the shared resource boundsComputesFunInTimeAndSpace: function computation with the shared time and space boundsComputableInTimeAndSpace: such a machine exists with binary alphabet and finitely many states.ComputableInTimeAndSpaceOfLength: the specialization to bounds on encoded input length.DecidableInTimeAndSpace: a proof that a TM decides a language within a certain time and space bound.
Every state and tuple of read symbols is related to exactly one action by ntm's transition
relation.
Instances For
A multi-tape Turing machine with k work tapes over the alphabet of Option Symbol (where none
is the blank tape symbol). Note that it is not required that Symbol or State are finite
to keep the definition more general. The restriction will be introduced once we start talking about
computability by Turing machines in general.
- q₀ : State
- deterministic : self.IsDeterministic
Every state and tuple of read symbols is related to exactly one action by the transition relation.
Instances For
The unique action related to the given state and read symbols by Tr.
Instances For
Tr relates a state and read symbols to an action exactly when tr returns that action.
Construct a deterministic machine from an initial state and transition function.
Instances For
Extracting the transition of ofTr recovers the supplied function.
Stepping a Turing Machine #
The step function lets the machine transition from one configuration to the next, and runFrom
gives the configuration reached after a number of steps. Configurations themselves are defined in
Cslib.Computability.Machines.Turing.MultiTape.Configuration.
The unique successor configuration related to cfg by the inherited step relation.
Instances For
A running configuration takes the action selected by the transition function.
The input head after a live step.
A work tape after a live step.
A work tape head after a live step.
A configuration map semiconjugating the step functions is a homomorphism of the step relations,
so it maps run paths with RelSeries.map.
Instances For
A configuration map commuting with the step functions on running configurations is a
homomorphism from the running steps of tm to the steps of tm'.
Instances For
The path of the first t steps from cfg.
Instances For
Every deterministic run path is the canonical path from its head for its duration.
The path of the first t steps on input, starting at the initial configuration.
Instances For
Every deterministic computation path is the canonical path for its duration.
A step-preserving map sends the path of t steps from cfg to the path of t steps from the
image of cfg.
The configuration reached by running the Turing machine for t steps from cfg.
If the Turing machine halts, it will stay at the halting configuration.
Instances For
Every path of a deterministic machine follows its iterated step function.
A deterministic computation ends at the corresponding iterate.
Running from the image of a configuration under a step-preserving map reaches the image of the original run.
A deterministic machine halted after t steps satisfies the shared time bound.
The work-tape head moves by at most one cell in a single step.
Now we define space usage and add some helper lemmas.
The set of positions visited by the head of work tape i in the computation starting from
configuration cfg up to step t.
Instances For
The number of work tape cells visited by the head of tape i in the computation starting from
configuration cfg up to step t.
Instances For
The number of work tape cells visited in the first t steps from cfg: the space of the path
of these steps.
Instances For
Each tape's space usage is bounded by the total space used.
In t steps the input head moves at most t positions to the right.
The machine eventually halts on input with the given output.
Instances For
The machine computes output from input within the shared time and space bounds.
Instances For
The machine computes f relative to given encodings within the given time and space bounds.
Instances For
Resource bounds can be weakened independently on every input.
Computability by a deterministic machine with a binary tape alphabet and finitely many states, within the supplied input-indexed bounds.
Instances For
There exists a binary Turing machine with finitely many states that, for every input a,
computes encOut (f a) from encIn a in at most t (encIn a).length steps,
using at most s (encIn a).length work-tape cells.
Instances For
Computability is monotone in the resource bounds.
The Boolean indicator function of a set.
Instances For
If a deterministic machine repeats a non-halting configuration, it never halts,
because the sequence between the two configurations will loop forever.
Note that this can be applied to two arbitrary and different time steps t and t + Δ
using Function.iterate_add_apply.