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
A modified version of Quotient.liftOn'
specialized for ListBlank
, with the stronger
precondition BlankExtends
instead of BlankRel
.
Equations
Instances For
Equations
Equations
The i
-th projection as a pointed map.
Equations
Instances For
The flatMap
function on lists is well defined on ListBlank
s 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 ListBlank
s 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 cons
ed 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
Apply a pointed map to a tape to change the alphabet.