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₁.
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₂).
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.
Instances For
Given two BlankRel lists, there exists (constructively) a common join.
Instances For
Given two BlankRel lists, there exists (constructively) a common meet.
Instances For
A ListBlank Γ is a quotient of List Γ by extension by blanks at the end. This is used to
represent half-tapes of a Turing machine, so that we can pretend that the list continues
infinitely with blanks.
Instances For
A modified version of Quotient.liftOn' specialized for ListBlank, with the stronger
precondition BlankExtends instead of BlankRel.
Instances For
The quotient map turning a List into a ListBlank.
Instances For
The head of a ListBlank is well defined.
Instances For
The tail of a ListBlank is well defined (up to the tail of blanks).
Instances For
We can cons an element onto a ListBlank.
Instances For
The n-th element of a ListBlank is well defined for all n : ℕ, unlike in a List.
Instances For
Apply a function to a value stored at the nth position of the list.
Instances For
A pointed map of Inhabited types is a map that sends one default value to the other.
- f : Γ → Γ'
The map underlying this instance.
Instances For
The map function on lists is well defined on ListBlanks provided that the map is
pointed.
Instances For
The i-th projection as a pointed map.
Instances For
Append a list on the left side of a ListBlank.
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.
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
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.
Instances For
Construct a tape from a left side and an inclusive right side.
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.
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.)
Instances For
Replace the current value of the head on the tape.
Instances For
Apply a pointed map to a tape to change the alphabet.