Formal Languages, Automata and Computability
Formal Languages, Automata and Computability
Formal Languages, Automata and Computability
FORMAL LANGUAGES,
AUTOMATA AND
COMPUTABILITY
UNDECIDABILITY II:
REDUCTIONS
ATM = { (M,w) | M is a TM that accepts string w }
ATM is undecidable: (constructive proof & subtle)
Assume machine H semi-decides ATM
Accept if M accepts w
H( (M,w) ) =
Rejects or loops otherwise
loops if D MH loops on D MH
(i.e. if H( D
MH , DMH ) loops)
(M,w)
If M halts
D H Does M
w
halt on w?
If M doesn’t M
halt: REJECT
In most cases, we will show that a
language L is undecidable by showing
that if it is decidable, then so is ATM
1. Create Mw
Mw
s If s w, REJECT
If s = w, run M(w)
Decision Machine
Z L(M w) ==?
L(N)
?
for ATM
Accepts if M does not accept w
Rejects, otherwise
REVERSE accept/reject
REGULARTM = { M | M is a TM and L(M) is regular}
Theorem: REGULARTM is undecidable
Proof: Assume, for a contradiction, that TM R
decides REGULARTM
Mw
s If s = 0n1n, accept
Else run M(w)
Yes M accepts w
ALLPDA = { P | P is a PDA and L(P) = Σ* }
Theorem: ALLPDA is undecidable
Proof: Assume, for a contradiction, that TM A
decides ALLPDA
11010q700110
q7
1 1 0 1 0 0 0 1 1 0
COMPUTATION HISTORIES
An accepting computation history is a
sequence of configurations C1,C2,…,Ck, where
1. C1 is the start configuration,
2. Ck is an accepting configuration,
3. Each Ci follows from Ci-1
ε,ε → ε ε,ε → ε
ε,ε → ε
f
Theorem: If A m B and B is decidable,
then A is decidable
ATM m HALTTM :
Map (M, w) (M’, w)
where M’(w) = M(w) if M(w) accepts
loops otherwise