TM Theory
TM Theory
Context-Sensitive Languages
Hinrich Schütze
IMS, Uni Stuttgart, WS 2006/07
With slides borrowed from:
for some qf ∈ F, x1 , x2 ∈
Γ*.
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Linear Bounded Automaton (LBA)
Input string
[ a b c d e ]
Working space
Left-end Right-end
on tape
marker marker
n n n
L {a b c }
Control Unit
Deterministic
We want to prove:
Each Class has the same
power as the Standard Model
And vice-versa
Second Class
First Class Simulation Machine
Original Machine M2
M1 M1
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Turing Machines with Stay-Option
aababbcac a
L,R,S: moves
14
Example: Time 1
aababbcac a
q1
Time 2
b ab abb c ac a
q2
q1 a b, S q2
15
Theorem: Stay-Option Machines
have the same power as
Standard Turing machines
16
Proof:
17
Proof:
18
Stay-Option Machine
a b, L
q1 q2
a b, L
q1 q2
a b, S
q1 q2
a b, L x x, R
q1 q2 q3
a b a b track 1
b a c d track 2
a b a b track 1
b a c d track 2
one symbol
q1
a c a b track 1
b d c d track 2
q2
(b, a ) (c, d ), L
q1 q2
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Semi-Infinite Tape
# a b a c .........
Trivial
Standard machine
......... .........
reference point
q2
q1
R (a, x) ( g , x), R R
Right part q1 q2
L ( x, a ) ( x, g ), L L
Left part q1 q2
For all symbols x
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Time 1
Standard machine
......... a b c d e .........
q1
q2
R (# , # ) (# , # ), R L
Right part q1 q1
L (# , # ) (# , # ), R R
Left part q1 q1
Time 1
Right part # d e .........
Left part # c b g
L
q1
Time 2
Right part # d e .........
Left part # c b g
R
q1
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Theorem: Semi-infinite tape machines
have the same power as
Standard Turing machines
Control Unit
Tape read-write
g d e
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Proof of equivalence?
Off-line machine:
2. Continue computation as in
Standard Turing machine
Off-line machine
Off-line machine
# a b c d Input File
# 0 0 1 0 head position
e f g Tape
0 1 0 head position
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Reference point
# a b c d Input File
# 0 0 1 0 head position
e f g Tape
0 1 0 head position
Control unit
Tape 1 Tape 2
a b c e f g
Input
Time 2
a g c e d g
q2 q2
(b, f ) ( g , d ), L, R
q1 q2
C. Busch, E. Rich, R. Sproat, G. Taylor and M. Volk
Proof of equivalence?
Standard machine:
a b c Tape 1
#
# 0 1 0 head position
# e f g h Tape 2
# 0 0 1 0 head position
they execute
only one program
57
Solution: Universal Turing Machine
Attributes:
• Reprogrammable machine
58
Universal Turing Machine
simulates any other Turing MachineM
Description of transitions of M
Initial tape contents of M
59
Tape 1
Three tapes
Description of M
Universal
Tape 2
Turing
Machine
Tape Contents of M
Tape 3
State of M 60
Tape 1
Description of M
61
Alphabet Encoding
Symbols: a b c d
62
State Encoding
States: q1 q2 q3 q4
Move: L R
Encoding: 1 11
63
Transition Encoding
Encoding: 1 0 1 0 11 0 11 0 1
separator
64
Machine Encoding
Transitions:
(q1, a ) (q2 , b, L) (q2 , b) (q3 , c, R )
Encoding:
1 0 1 0 11 0 11 0 1 00 11 0 1 10 111 0 111 0 11
separator
65
Tape 1 contents of Universal Turing Machine:
66
A Turing Machine is described
with a binary string of 0’s and 1’s
Therefore:
67
Language of Turing Machines
111010011110010101,
……
…… }
68