Turing machine tapes #
This file defines the notion of a Turing machine tape, and the operations on it. A tape is a
bidirectional infinite sequence of cells, each of which stores an element of a given alphabet Γ.
All but finitely many of the cells are required to hold the blank symbol default : Γ.
Main definitions #
The BlankExtends partial order holds of l₁ and l₂ if l₂ is obtained by adding
blanks (default : Γ) to the end of l₁.
Equations
Instances For
Any two extensions by blank l₁,l₂ of l have a common join (which can be taken to be the
longer of l₁ and l₂).
Equations
Instances For
BlankRel is the symmetric closure of BlankExtends, turning it into an equivalence
relation. Two lists are related by BlankRel if one extends the other by blanks.
Equations
Instances For
Equations
Equations
A modified version of Quotient.liftOn' specialized for ListBlank, with the stronger
precondition BlankExtends instead of BlankRel.
Equations
Instances For
Apply a function to a value stored at the nth position of the list.
Equations
Instances For
Equations
Equations
The map function on lists is well defined on ListBlanks provided that the map is
pointed.
Equations
Instances For
The i-th projection as a pointed map.
Equations
Instances For
The flatMap function on lists is well defined on ListBlanks provided that the default
element is sent to a sequence of default elements.
Equations
Instances For
The tape of a Turing machine is composed of a head element (which we imagine to be the
current position of the head), together with two ListBlanks denoting the portions of the tape
going off to the left and right. When the Turing machine moves right, an element is pulled from the
right side and becomes the new head, while the head element is consed onto the left side.
- head : Γ
The current position of the head.
- left : ListBlank Γ
The portion of the tape going off to the left.
- right : ListBlank Γ
The portion of the tape going off to the right.
Instances For
Equations
A direction for the Turing machine move command, either
left or right.
Instances For
Construct a tape from a left side and an inclusive right side.
Equations
Instances For
Construct a tape from a left side and an inclusive right side.
Equations
Instances For
Construct a tape from a list, with the head of the list at the TM head and the rest going to the right.
Equations
Instances For
The nth function of a tape is integer-valued, with index 0 being the head, negative indexes
on the left and positive indexes on the right. (Picture a number line.)
Equations
Instances For
Replace the current value of the head on the tape.
Equations
Instances For
Apply a pointed map to a tape to change the alphabet.