1 / 23

CSCI 3130: Automata theory and formal languages

Fall 2010. The Chinese University of Hong Kong. CSCI 3130: Automata theory and formal languages. Reducibility. Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130. Summary of last lecture. U. program 〈 M 〉. accept , if M accepts w. reject , if M rejects w. input w.

holeman
Download Presentation

CSCI 3130: Automata theory and formal languages

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. Fall 2010 The Chinese University of Hong Kong CSCI 3130: Automata theory and formal languages Reducibility Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130

  2. Summary of last lecture U program 〈M〉 accept, if M accepts w reject, if M rejects w input w loops, if M loops on w The universal TMU takes as inputs a program Mand a string x and simulates M on x The program M itself is specified as a TM!

  3. Summary of last lecture recognizable: By universal TM U qacc qrej undecidable: Turing’s Theorem accept reject loop halt ATM = {〈M, w〉: Mis a TM that accepts input w}

  4. Another undecidable language • We will argue that … so by Turing’s Theorem it is undecidable. HALTTM = {〈M, w〉: Mis a TM that halts on input w} HALTTMis an undecidable language If HALTTMis decidable, so is ATM.

  5. Undecidability of halting • Suppose H decides HALTTM If HALTTMcan be decided, so can ATM. accept ifM halts on w R 〈M, w〉 reject ifM loops on w • We want to use R to design TM S that decides ATM accept ifM accepts w ? 〈M, w〉 reject ifM rejects or loops on w

  6. Undecidability of halting accept ifM halts on w R 〈M, w〉 reject ifM loops on w S R acc acc simulate M on w accept ifM accepts w U 〈M, w〉 rej rej reject ifM rejects or loops on w

  7. Undecidability of halting HALTTM = {〈M, w〉: Mis a TM that halts on input w} ATM = {〈M, w〉: Mis a TM that accepts input w} Suppose that HALTTM is decidable. Let H be a TM that decides HALTTM. Then this TM decides ATM: S := On input 〈M, w〉, Run R on input 〈M, w〉. If R rejects, reject. If R accepts, run U on input 〈M, w〉 If U accepts, accept. If U rejects, reject. Impossible, because ATM is undecidable.

  8. Reducibility • Suppose you think L is undecidable. • How do you know for sure? Show: If some TM R decides L then using R, I can build another TM S so that S decides ATM ...but this is impossible, because ATM is undecidable.

  9. Example 1 • Step 1: You gotta believe it • To know if M accepts e, it looks like we have to simulate it • But then we might end up in a loop • Step 2: Prove it! AEPSTM = {〈M〉: Mis a TM that accepts input e} decidable undecidable

  10. Example 1: Figuring out the reduction accept ifM’ accepts e R 〈M’〉 reject if not S accept ifM accepts w 〈M, w〉 reject if not R 〈M’〉 M’ should be a Turing Machine such that: If M accepts w, then M’ accepts e If M does not accept w, then M’ does not accept e M’ on input e=M on input w

  11. Example 1: Implementing the reduction 〈M, w〉 construct M’ 〈M’〉 M’ should be a Turing Machine such that: M’ on input e=M on input w M’ := On input z, Simulate M on input w If M accepts, accept Otherwise, reject

  12. Example 1: Impementing the reduction accept ifM accepts w construct M’ 〈M, w〉 reject if not S := On input 〈M, w〉: Construct the following TM M’: R 〈M’〉 M’ := On input z, Simulate M on input w and output answer Run R on input 〈M’〉 and output its answer.

  13. Example 1: Writing it up undecidable AEPSTM = {〈M〉: Mis a TM that accepts input e} ATM = {〈M, w〉: Mis a TM that accepts input w} Suppose AEPSTM is decidable and R decides it. Let S := On input 〈M, w〉 where M is a TM and w is a string Construct the following TM M’: M’ := On input z, Simulate M on input w and output answer Run R on input 〈M’〉 and output its answer. Then S accepts 〈M, w〉if and only if M accepts w So S decides ATM, which is impossible.

  14. Example 2 • Step 1: You gotta believe it • To know if M is in SOMETM, looks like we have to simulate • But then we might end up in a loop • Step 2: Prove it! SOMETM = {〈M〉: Mis a TM that accepts some input} decidable undecidable

  15. Example 2: Setting up the reduction SOMETM = {〈M〉: Mis a TM that accepts some input} Show: If SOMETM can be decided by some TM R, accept ifM’ accepts some input R 〈M’〉 reject if M’ accepts no inputs ... then ATM can be decided by some other TM S S accept ifM accepts w 〈M, w〉 reject if not

  16. Example 2: Setting up the reduction accept ifM accepts w construct M’ 〈M, w〉 reject if not Task Given 〈M, w〉, constructM’ so that: R 〈M’〉 If M accepts w, then M’ accepts some input If M does not accept w, then M’ accepts no inputs

  17. Example 2: Implementing the reduction Task Given 〈M, w〉, construct M’ so that: If M accepts w, then M’ accepts some input If M does not accept w, then M’ accepts no inputs M’ := On input z, Simulate M on input w If M accepts, accept Otherwise, reject

  18. Example 2: Writing it up undecidable SOMETM = {〈M〉: Mis a TM that accepts some input} ATM = {〈M, w〉: Mis a TM that accepts input w} Suppose SOMETM is decidable and R decides it. Let S := On input 〈M, w〉 where M is a TM and w is a string Construct the following TM M’: M’ := On input z, Simulate M on input w and output answer Run R on input 〈M’〉 and output its answer. Then S accepts 〈M, w〉if and only if M accepts w So S decides ATM, which is impossible.

  19. Example 3 ETM = {〈M〉: Mis a TM that accepts no input} decidable undecidable Show: If ETM can be decided by some TM R, ... then SOMETM can be decided by another TM S SOMETM = {〈M〉: Mis a TM that accepts some input}

  20. Example 3 undecidable ETM = {〈M〉: Mis a TM that accepts no input} SOMETM = {〈M〉: Mis a TM that accepts some input} Suppose ETM can be decided by some TM R. S := On input 〈M〉 where M is a TM Run R on input 〈M〉. Consider the following TM S: If R accepts, reject. If R rejects, accept. Then S decides SOMETM, a contradiction.

  21. Example 4 EQTM = {〈M1, M2〉: M1and M2 accept the same inputs} decidable undecidable Show: If EQTM can be decided by some TM R, ... then ETMcan be decided by another TM S

  22. Example 4: Setting up the reduction EQTM = {〈M1, M2〉: M1and M2 accept the same inputs} ETM = {〈M〉: Mis a TM that accepts no input} Task Given 〈M〉, construct〈M1, M2〉 so that: If M accepts no input, then M1, M2 accept same inputs If M accepts some input, then M1, M2 do not acceptsame inputs Make M1 = M Idea Make M2accept nothing

  23. Example 2: Writing it up undecidable EQTM = {〈M1, M2〉: M1and M2 accept the same inputs} ETM = {〈M〉: Mis a TM that accepts no input} Suppose EQTM is decidable and R decides it. Let S := On input 〈M〉 where M is a TM Construct the following TM M2: M2:= On input z, reject. Run R on input 〈M, M2〉 and output its answer. Then S accepts 〈M〉if and only if M accepts no input So S decides ETM, which is impossible.

More Related