text
stringlengths
0
8.13M
The function ∆ can therefore be written as
1, if i P
∆:I 0,1 where ∆(i)= ∈ M . (2.5)
→{ } (cid:26)0, if i / P M
Note that in this way∆ is naturallydefined as a totalfunction onthe finite
set of instructions I.
Data
A tape expression is an expression consisting entirely of symbols from the set
Γ. Denoting generic tape expressions by calligraphic letters, for example , we
T
canconsidertape expressionsas split inleft andright parts,and = .
L R T LR
By convention, we always mark tape ends by the symbol = , so that the tape
actually looks as .
⊔LR⊔
Executing Turing Machine
An instantaneous description α of TM is an expression satisfying the following
requirements
8Thepowerset (I)ofI isthesetofallTuringmachineprogramsforthegivenalphabet
P
andconfigurationset. SowecouldalsowritePM (I).
∈P
24
1. it contains exactly one q
i
2. this q is not the rightmost token
i
3. it does not contain R or L
4. for all the symbols S in α , S Γ.
k k
The state q is called the instantaneous internal configuration at α. The
i
symbol S immediately to the rightof q inα is calledthe scanned tape symbol.
k i
In practice, an instantaneous description is a tape expression with exactly one
configuration symbol q inserted directly to the left of the scanned symbol.
i
Sincetheremustalwaysbeascannedsymbol,q cannotbetherightmosttoken.
i
Formally,ageneralinstantaneousdescriptioncanbe writtenas q wherethe
i
L R
right tape expression must be non-empty.
R
So far everything is static. In order for the Turing machine to actually
perform a computation we need a computation relation or a set of rewrite rules
α β, allowing us to pass from one instantaneous description to another. In
thefollowing, and denotestapeexpressions,possiblyjuststringsofblanks.
X Y
The computation relation α β is defined by
1. If α = q S and q S S q R P then β = S q
i k i k l j M l j
X Y ∈ X Y
//print and move right
2. If α = q S and q S S q R P then β = S q S
i 0 i 0 l j M l j 0
X ∈ X
//print and right move at right end of tape, insert blank
3. If α = S q S and q S S q L P then β = q S S
m i k i k l j M j m l
X Y ∈ X Y
//print and move left
4. If α = q S and q S S q L P then β = q S S .
i 0 i 0 l j M j 0 l
Y ∈ Y
//print and left move at left end of tape, insert blank
In practice, the rewrite rules are applied by searching for an instruction
having the first two symbols matching the machine state and the scanned tape
symbol. Then, at each step in the computation, the machine scans the symbol
on the tape, prints a new symbol and performs a move according to the rules.
An instantaneous description is terminal if none of the rewrite rules apply.
Acomputationisafinitesequenceα ,α ,...,α ofinstantaneousdescriptions
1 2 p
such that α α for 1 i < p and such that α is terminal. The result of
i i+1 p
→ ≤
the computation is written M(α ) which we define as α . Using the notation
1 p
to denote a computation in several steps, we have
α α =M(α ). (2.6)
1 ∗ p 1
This is the formal definition. Some comments are obviously in order. The
question of whether the Turing machine halts or not is the same as whether
there exists a computation or not. The tape is considered to be potentially
infinite. This is taken care of by the computation rules (2) and (4) which have
25
the effect of inserting blank squares at the ends of the tape when the machine
is about to run off the tape. In any computation, only a finite amount of tape
is ever used.
In orderto getsomething donewith this model, a few morechoicesmust be
made. We needa wayto representinput data astape expressionsand a wayto