1 / 52

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

15-453. FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. A TM = { (M,w) | M is a TM that accepts string w }. HALT TM = { (M,w) | M is a TM that halts on string w }. E TM = { M | M is a TM and L(M) =  }. REG TM = { M | M is a TM and L(M) is regular}.

laszlo
Download Presentation

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

  2. 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?

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

  4. 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)

  5. 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mHALTTM 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 HALTTMis NOT DECIDABLE, but it is SEMI-DECIDABLE (Why?)

  6. 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mETM CONSTRUCT f : Σ*  Σ* f: (M,w)  Mwwhere 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?

  7. ATM = { (M,w) | M is a TM that accepts string w } REGTM = { M | M is a TM and L(M) is regular} CLAIM: ATMmREGTM SoREGTMis UNDECIDABLE CONSTRUCT f : Σ*  Σ* f: (M,w)  M’wwhere 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?

  8. ATM = { (M,w) | M is a TM that accepts string w } REGTM = { M | M is a TM and L(M) is regular} CLAIM: ATMmREGTM So, REG NOTSEMI-DECIDABLE CONSTRUCT f : Σ*  Σ* f: (M,w)  M”wwhere 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 NOTSEMI-DECIDABLE

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

  10. 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mALLPDA CONSTRUCT f : Σ*  Σ* f: (M,w)  Pwwhere 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

  11. 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

  12. 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.

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

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

  15. P recognizes all strings except: #C1# C2R#C3 #C4R#C5 #C6R#….# Ck If k is odd, putCk 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

  16. P recognizes all strings except: #C1# C2R#C3 #C4R#C5 #C6R#….# Ck If k is odd, putCk 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

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

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

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

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

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

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

  23. THE POST CORRESPONDENCE PROBLEM

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

  25. aaa aaa a a a c a aa aa aa a c a a

  26. abc abc ca ca b b a a a ab ab ab ca ca a c a c

  27. abc acc ca ab ca a

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

  29. aab acc caa b b c aa b b a a a

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

  31. 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!

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

  33. aaa aaa a a a c a aa aa aa a c a a FPCP

  34. ba b b a bcb ab a a FPCP

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

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

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

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

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

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

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

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

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

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

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

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

  47. qacc## # STEP 7 add END

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

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

  50.  t1 tk t2 t1 t1 t2 tk  b1 b2 b1 bk b1 b2 bk 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 FPCP: … PCP: …

More Related