FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Slides:



Advertisements
Similar presentations
CSCI 3130: Formal languages and automata theory Tutorial 9
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Post Correspondence Problem [Section 5.2] Suppose we have dominos of strings, e.g.: The question: is it possible to arrange the dominos in line (repetitions.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
Reducibility Sipser 5.1 (pages ).
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
Foundations of (Theoretical) Computer Science Chapter 5 Lecture Notes David Martin (with modifications by Karen Daniels) With thanks.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
February 1, 2016CS21 Lecture 121 CS21 Decidability and Tractability Lecture 12 February 1, 2016.
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
FORMAL LANGUAGES AND AUTOMATA THEORY
Turing Machines.
Intro to Theory of Computation
Pumping Lemma Revisited
Undecidable problems for CFGs
Undecidable problems for CFGs
CS154, Lecture 7: Turing Machines.
Reducibility The Chinese University of Hong Kong Fall 2010
Intro to Theory of Computation
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
More Undecidable Problems
CS154, Lecture 8: Undecidability, Mapping Reductions
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Finite Automata Reading: Chapter 2.
Decidable and undecidable languages
Reducability Sipser, pages
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
CSC 4170 Theory of Computation Mapping Reducibility Section 5.3.
CSCI 2670 Introduction to Theory of Computing
More undecidable languages
Decidability and Tractability
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 105 theory of computation
CS 461 – Nov. 14 Section 5.2 – Undecidable problems starting from ATM:
Theory of Computability
Instructor: Aaron Roth
CS154, Lecture 11: Self Reference, Foundation of Mathematics
CSC 4170 Theory of Computation Mapping Reducibility Section 5.3.
More undecidable languages
CSCI 2670 Introduction to Theory of Computing
Instructor: Aaron Roth
Theory of Computability
Instructor: Aaron Roth
CSE 105 theory of computation
Turing -Recognizable vs. -Decidable
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Which are SEMI-DECIDABLE? ATM = { (M,w) | M is a TM that accepts string w } HALTTM = { (M,w) | M is a TM that halts on string w } ETM = { M | M is a TM and L(M) =  } REGTM = { M | M is a TM and L(M) is regular} EQTM = {( M, N) | M, N are TMs and L(M) =L(N)} ALLPDA = { P | P is a PDA and L(P) = Σ* } ALL UNDECIDABLE Use Reductions to Prove Which are SEMI-DECIDABLE?

Say: A is mapping reducible to B; Write: A m B Let f : Σ*  Σ* be a computable function such that w  A  f(w)  B Σ* Σ* A B f f Say: A is mapping reducible to B; Write: A m B Also,  A m  B, why?

Theorem: If A m B and B is (semi) decidable, then A is (semi) decidable Let M decide B and let f be a reduction from A to B Proof: We build a machine N that decides A as follows: On input w: 1. Compute f(w) 2. Run M on f(w)

ATM = { (M,w) | M is a TM that accepts string w } HALTTM = { (M,w) | M is a TM that halts on string w } CLAIM: ATM m HALTTM CONSTRUCT f : Σ*  Σ* f: (M,w)  (M’, w) where M’( w) = M(w) if M(w) accepts Loops otherwise So, (M, w ) ATM  (M’, w)  HALTTM So HALTTM is NOT DECIDABLE, but it is SEMI-DECIDABLE (Why?)

ATM = { (M,w) | M is a TM that accepts string w } ETM = { M | M is a TM and L(M) =  } CLAIM: ATM m  ETM  ATM m ETM CONSTRUCT f : Σ*  Σ* f: (M,w)  Mw where Mw (s) = M(w) if s = w Loops otherwise So, M(w) accepts  L (Mw)   So, (M, w ) ATM  Mw   ETM So  ETM is NOT DECIDABLE, but it is SEMI-DECIDABLE (why?) Is ETM SEMI-DECIDABLE?

ATM = { (M,w) | M is a TM that accepts string w } REGTM = { M | M is a TM and L(M) is regular} CLAIM: ATM m REGTM So REGTM is UNDECIDABLE CONSTRUCT f : Σ*  Σ* f: (M,w)  M’w where M’w (s) = accept if s = 0n1n M(w) otherwise So, L (M’w) = Σ* if M(w) accepts {0n1n} if not So, (M, w ) ATM  M’w  REGTM Is REG SEMI-DECIDABLE?

ATM = { (M,w) | M is a TM that accepts string w } REGTM = { M | M is a TM and L(M) is regular} CLAIM:  ATM m REGTM So, REG NOT SEMI-DECIDABLE CONSTRUCT f : Σ*  Σ* f: (M,w)  M”w where M”w (s) = accept if s = 0n1n and M(w) accepts Loop otherwise So, L (M’w) = {0n1n} if M(w) accepts  if not So, (M, w )  ATM  M”w  REGTM So, REG NOT SEMI-DECIDABLE

ETM = { M | M is a TM and L(M) =  } EQTM = {( M, N) | M, N are TMs and L(M) =L(N)} CLAIM: ETM m EQTM So EQTM is UNDECIDABLE CONSTRUCT f : Σ*  Σ* f: M  (M, M  ) where M  (s) = Loops So, M E TM  (M, M  )  EQTM Is EQTM SEMI-DECIDABLE? NO, since,  ATM m ETM m EQTM

ATM = { (M,w) | M is a TM that accepts string w } ALLPDA = { P | P is a PDA and L(P) = Σ* } CLAIM: ATM m  ALLPDA  ATM m ALLPDA CONSTRUCT f : Σ*  Σ* f: (M,w)  Pw where Pw (s) = accept iff s is NOT an accepting computation of M(w) So, (M, w )  ATM  Pw  ALLPDA So, (M, w ) ATM  Pw   ALLPDA

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 An rejecting computation history is a sequence of configurations C1,C2,…,Ck, where 1. C1 is the start configuration, 2. Ck is a rejecting configuration, 3. Each Ci follows from Ci-1 M accepts w if and only if there exists an accepting computation history that starts with C1=q0w

Non-deterministic checks for 1, 2, and 3. P will recognize all strings (read as sequences of configurations) that: 1. Do not start with C1 2. Do not end with an accepting configuration 3. Where some Ci does not properly yield Ci+1 ε,ε → ε ε,ε → ε ε,ε → ε Non-deterministic checks for 1, 2, and 3.

{ 0 | n ≥ 0 } 2n qreject qaccept x → x, L 0 → 0, L q2  → , R x → x, R x → x, R q0 q1 q3 0 → , R 0 → x, R x → x, R  → , R 0 → 0, R  → , R 0 → x, R qreject qaccept q4 x → x, R  → , R

{ 0 | n ≥ 0 } q00000 2n q1000 xq300 x0q40 x0xq3 x0q2x xq20x 0 → , R  → , R qaccept qreject 0 → x, R x → x, R 0 → 0, L x → x, L  → , L 0 → 0, R { 0 | n ≥ 0 } 2n q0 q1 q2 q3 q4 q00000 q1000 xq300 x0q40 x0xq3 x0q2x xq20x q2x0x q2x0x

P recognizes all strings except: #C1# C2R #C3 #C4R #C5 #C6R #….# Ck If k is odd, put Ck on stack and see if Ck+1R follows properly: For example, If =uaqibv and  (qi,b) = (qj,c,R), then Ck properly yields Ck+1  Ck+1 = uacqjv

P recognizes all strings except: #C1# C2R #C3 #C4R #C5 #C6R #….# Ck If k is odd, put Ck on stack and see if Ck+1R follows properly: If =uaqibv and  (qi,b) = (qj,c,L), then Ck properly yields Ck+1  Ck+1 = uqjacv

P recognizes all strings except: #C1# C2R #C3 #C4R #C5 #C6R #….# Ck If k is even, put CkR on stack and see if Ck+1 follows properly.

#q00000#000q1#xq300#0q40x #x0xq3# ... # q1  q1000 q0 xq300 x0q40 ODD x0xq3 x0q2x xq20x q2x0x : #q00000#000q1#xq300#0q40x #x0xq3# ... #

#q00000#000q1#xq300#0q40x #x0xq3# ... # q1  q1000 q0 xq300 x0q40 ODD x0xq3 x0q2x xq20x q2x0x : #q00000#000q1#xq300#0q40x #x0xq3# ... #

#q00000#000q1#xq300#0q40x #x0xq3# ... # q1  q1000 q0 xq300 x0q40 ODD x0xq3 x0q2x xq20x q2x0x : #q00000#000q1#xq300#0q40x #x0xq3# ... #

#q00000#000q1#xq300#0q40x #x0xq3# ... # q1000  q1 xq300 x0q40 EVEN x0xq3 x0q2x xq20x q2x0x : #q00000#000q1#xq300#0q40x #x0xq3# ... #

#q00000#000q1#xq300#0q40x #x0xq3# ... # q1000  q1 xq300 x0q40 EVEN x0xq3 x0q2x xq20x q2x0x : #q00000#000q1#xq300#0q40x #x0xq3# ... #

THE POST CORRESPONDENCE PROBLEM

THE PCP GAME ba a ba a a ab a ab b bcb b a

aaa a aaa a a c a aa a aa a aa c a

b ca b ca a ab a ab a ab ca a ca a abc c abc c

abc ab ca a acc ca

GENERAL RULE #1 If every top string is longer than the corresponding bottom one, there can’t be a match

caa a acc a b b aab aa c a

GENERAL RULE #2 If there is a domino with the same string on the top and on the bottom, there is a match

Given a collection of dominos, is there a match? POST CORRESPONDENCE PROBLEM Given a collection of dominos, is there a match? PCP = { P | P is a set of dominos with a match } PCP is undecidable!

THE FPCP GAME … is just like the PCP game except that a match has to start with the first domino

FPCP aaa a aaa a a c a aa a aa a aa c a

FPCP ba a a ab b bcb b a

We will show how to use C to decide ATM Theorem: FPCP is undecidable Proof: Assume machine C decides FPCP We will show how to use C to decide ATM

Given (M,w) we will construct a set of dominos P where a match is an accepting computation history for M on w caa c aba bb a d … P = C P has a match?

{ 0 | n ≥ 0 } 2n qreject qaccept x → x, L 0 → 0, L q2  → , R x → x, R x → x, R q0 q1 q3 0 → , R 0 → x, R x → x, R  → , R 0 → 0, R  → , R 0 → x, R qreject qaccept q4 x → x, R  → , R

#q00000#q1000#xq300#x0q40#x0xq3# ... # 0 → , R  → , R qaccept qreject 0 → x, R x → x, R 0 → 0, L x → x, L  → , L 0 → 0, R { 0 | n ≥ 0 } 2n q0 q1 q2 q3 q4 q00000 q1000 xq300 x0q40 x0xq3 x0q2x xq20x q2x0x q2x0x #q00000#q1000#xq300#x0q40#x0xq3# ... # :

Given (M,w), we will construct an instance P of FPCP in 7 steps

STEP 1 # #q0w1w2…wn# Put into P START

If (q,a) = (p,b,R) then add If (q,a) = (p,b,L) then add STEP 2 qa bp If (q,a) = (p,b,R) then add STEP 3 cqa pcb If (q,a) = (p,b,L) then add for all c  Γ RULES

{ 0 | n ≥ 0 } 2n qreject qaccept x → x, L 0 → 0, L q2  → , R x → x, R x → x, R q0 q1 q3 0 → , R 0 → x, R x → x, R  → , R 0 → 0, R  → , R 0 → x, R qreject qaccept q4 x → x, R  → , R

{ 0 | n ≥ 0 } 2n qreject qaccept … 0 → , R  → , R 0 → x, R x → x, R 0 → 0, L x → x, L  → , L 0 → 0, R { 0 | n ≥ 0 } 2n q0 q1 q2 q3 q4 0q20 q200 xq20 q2x0 q20 q20 # #q00000# q00 q1 q10 xq3 0q3 q20 xq3 q2x q3 q2 …

STEP 4 a add for all a  Γ STEP 5 # # # add CONTINUE

STEP 4 STEP 5 STEP 6 a add for all a  Γ # # # add aqacc qacc qacca

# #q00000# # #q00000# # #q00000# q1 q00 q1 q00 xq3 q10 xq1 q1x q0x xqr q0 qr qa q1 q2 q1 q3x xq3 q30 0q4 q40 xq3 q4x xq4 q4 qr 0q20 q200 q20 q20 xq20 q2x0 q20 0q3 xq3 q2x q2 q3 0q3x q20x q2xx xq3x q3x q2x x  # # # # 0qacc qacc0 x xqacc x qaccx x qacc x qacc  xq3 q10

STEP 7 qacc## # add END

0 → 0, R  → , R q0 q1 qaccept  → , R qreject # #q00# 0q1 q00 0qrej q10 qrej q0 q1 qacc  # # # qacc qacc qacc 0qacc qacc qacc qacc qacc0 # qacc## # #q00# 0q1 q00 # # q1 qacc # qacc qacc # qacc 0qacc #

Given (M,w), we can construct an instance of FPCP that has a match if and only if M accepts w

Can convert an instance of FPCP into one of PCP: Let u = u1u2…un, define: u =  u1  u2  u3  …  un u = u1  u2  u3  …  un  u =  u1  u2  u3  …  un  t1 b1 t2 b2 tk bk FPCP: … t1 b1 t1 b1 t2 b2 tk bk   PCP: …

Given (M,w), we can construct an instance of PCP that has a match if and only if M accepts w

Read Chapters 5.2 and 5.3 of the book for next time