1 / 190

Jeff Edmonds York University

Reductions to the Halting Problem. CSE 4111. CSE 2001. Different Models Reductions Simple Reductions Rice's Theorem Reductions with NotHalting Recognizable/Enumerable Recognizablity Complete The Rest Quick for 2001. The Post Correspondence Prob Tiling CFG G Generates I

Download Presentation

Jeff Edmonds York University

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. Reductions to the Halting Problem • CSE 4111 • CSE 2001 • Different Models • Reductions • Simple Reductions • Rice's Theorem • Reductions with NotHalting • Recognizable/Enumerable • Recognizablity Complete • The Rest Quick for 2001 • The Post Correspondence Prob • Tiling • CFG G Generates I • CFG G Generates Every String • CFG G Generates Some String • CFG L(G)=L(G') • Game of Life • Hilbert's 10th Problem Jeff Edmonds York University Lecture5.2 CSE 2001/4111

  2. Reductions for Undecidability • Undecidable problems: Halting Problem • = {“M”,I | TM M halts on input I} • = {“J”,I | Java program J halts on input I} • = {“P”,I | Primitive Recursive Program P halts on input I} • = {“P”,I | Recursive Program P halts on input I} • = {“M”,I | Register Machine halts on input I} • = {“C”,I | Uniform circuit C halts on input I} • = {“M”,I | Quantum Machine M Java halts on input I} • = {“G”,I | Context Sensitive Grammar G generates string input I} • = {“H”,I | Human H halts on input I} Every primitive recursive program halts. n, circuit computed in time size(n) Every human dies.

  3. Reductions for Undecidability Halting Problem = {“M”,I | M halts on I} is undecidable Will prove: • {“M”,I | M prints “Hi” at some point in computation on I} • {“M” | M halts empty string} • {“M” | I, M halts on I} • {“M” | I, M halts on I} • {“M”,“M'” | I M(I)=M'(I)} • {“M” | L(M) is regular} • There is a fixed TM M* {I | M* halts on I} • {“M” | based on what M does, not on how it does it} • {“M”,I | M does not halt on I} Is Undecidable, butthe reduction requires switching Yes & No Recognizable & Co-Recognizable. X ≥comp {“M”,I | M halts on I} Hence, all are undecidable!

  4. Reductions for Undecidability {“M”,I | M halts on I} ≥comp • {“M”,I | M prints “Hi” at some point in computation on I} • {“M” | M halts empty string} • {“M” | I, M halts on I} • {“M” | I, M halts on I} • {“M”,“M'” | I M(I)=M'(I)} • {“M” | L(M) is regular} • There is a fixed TM M* {I | M* halts on I} • {“M” | based on what M does, not on how it does it} X Funny that these have different complexities! Some how harder. X X X ≥comp {“M”,I | M halts on I} Hence, all are undecidable!

  5. Reductions for Undecidability Hence, equivalent. {“M”,I | M halts on I} ≥comp • {“M”,I | M prints “Hi” at some point in computation on I} • {“M” | M halts empty string} • {“M” | I, M halts on I} • There is a fixed TM M* {I | M* halts on I} ≥comp {“M”,I | M halts on I} Hence, all are undecidable!

  6. Reductions for Undecidability • {“M” | I, M halts on I} • {“M”,“M'” | I M(I)=M'(I)} • {“M” | L(M) is regular} • {“M” | based on what M does, not on how it does it} X Some how harder. X X X ≥comp {“M”,I | M halts on I} ≥comp {“M”,I | M does not halt on I}

  7. Reductions for Recognizablity Recognizable Co-Recognizable • Yes instance  Run forever or answer “yes” • No instance  Halt and answer “no” • Yes instance  Halt and answer “yes” • No instance  Run forever or answer “no” Computable/Decidable • Yes instance  Halt and answer “yes” • No instance  Halt and answer “no” Halting Halting

  8. Reductions for Recognizablity Recognizable Co-Recognizable • Yes instance  Run forever or answer “yes” • No instance  Halt and answer “no” • Yes instance  Halt and answer “yes” • No instance  Run forever or answer “no” Halting Halting Computable/Decidable {“M”,I | M prints “Hi” on I} {“M” | M halts empty string} {“M” | I, M halts on I}  TM M* {I | M* halts on I} Halting ≤ ≤ Halting

  9. Reductions for Recognizablity Recognizable Co-Recognizable • Yes instance  Run forever or answer “yes” • No instance  Halt and answer “no” • Yes instance  Halt and answer “yes” • No instance  Run forever or answer “no” Halting Halting Computable/Decidable {“M” | I, M halts on I} {“M”,“M'” | I M(I)=M'(I)} {“M” | L(M) is regular} {“M” | based on what M does, not on how it does it} Halting ≤ Halting ≤

  10. Reductions • Two problems/languages Peasierand Phardereach with their own definitions of Iharder Ieasier • what a legal input is (Ieasiervs Iharder) and • which are yes-inputs and which no-inputs. Pharder Peasier Iharder yes Ieasieryes Iharder no Ieasierno

  11. Reductions Iharder Ieasier Pharder(Iharder) Peasier(Ieasier) Iharder Ieasier Pharder Peasier Algharder Algeasier Iharder yes Ieasieryes • We want machines that decide/accept them. Iharder no Ieasierno

  12. Reductions • Computable/Decidable • Exp • Poly • Recognizable • Co-Recognizable Peasier≤compPharder • Co-NP • NP Ieasier Iharder • How do their complexities/difficulties compare? Pharder Peasier Ieasieryes Iharder yes Ieasierno Iharder no

  13. Reductions Peasier≤compPharder • It is hard to prove problem is Pharderhard. • It is easier to prove Peasieris easy. • by design an algorithm Algeasier for it. • But you only need to prove Peasieris at least as easy as Pharder . • Pretend you have an algorithm Algharder for Pharderto use as a subroutine. Iharder Ieasier Pharder Peasier Iharder yes Ieasieryes Iharder no Ieasierno

  14. Reductions Palg≤compPoracle • We often call the algorithm assumed to exist, an Oracle. Ioracle Ialg Poracle(Ioracle) Ioracle Poracle Palg GivenAlgoracle Ioracle yes Ialgyes Ioracle no Ialgno

  15. Reductions Palg≤compPoracle BuildAlgAlg Ioracle Ialg Poracle(Ioracle) Ioracle Ialg Palg Poracle GivenAlgoracle Ioracle yes Ialgyes Palg(Ialg) • We useAlgoracle as an subroutinein an algorithm Algalg for solving Palg. Ialgno Ioracle no

  16. Reductions Palg≤compPoracle InstanceMap Ioracle BuildAlgAlg Ioracle Ialg Poracle(Ioracle) Ioracle Ioracle=InstanceMap(Ialg) Ialg GivenAlgoracle Ialg Palg(Ialg) • Algalgis given an input Ialg. It maps it to input Ioracle.and gives this to Algoracle.

  17. Reductions Palg≤compPoracle Poracle InstanceMap Ioracle yes Ioracle no BuildAlgAlg Ioracle Ialg Poracle(Ioracle) Ioracle Ioracle=InstanceMap(Ialg) Ialg GivenAlgoracle Return same answer yesyes no no Ialg Palg(Ialg) • Algoracle gives the yes/no answer for his input Ioracle. Algalg returns the same answer.

  18. Reductions Palg≤compPoracle Palg Poracle InstanceMap Ialgyes Ioracle yes Ialgno Ioracle no BuildAlgAlg Ioracle Ialg Poracle(Ioracle) Ioracle Ioracle=InstanceMap(Ialg) Ialg GivenAlgoracle Return same answer yesyes no no Palg(Ialg) • To ensure Algalg works, Ioracle=InstanceMap(Ialg)must map yes instances to yes instances and no to no.

  19. Reductions Palg≤compPoracle Palg Poracle InstanceMap Ialgyes Ioracle yes Ialgno Ioracle no BuildAlgAlg Ioracle Ialg Poracle(Ioracle) Ioracle Ioracle=InstanceMap(Ialg) Ialg GivenAlgoracle Return same answer yesyes no no Palg(Ialg) • Must prove Algalg works. Ialgis a yes input  Ioracleis a yes input  Algoraclesays yesAlgalgsays yes

  20. Reductions Palg≤compPoracle

  21. Reductions Palg≤compPoracle • Reduction: Design an algorithm for one computational problem, using a supposed algorithm for another problem as a subroutine. • Used to create a new algorithm from a known algorithm. • Learn that a new problem is likely hard, from knowing a known problem is likely hard. • Learn that two problems have a similar “structure.”

  22. Reductions Sam Mary s t Bob Beth Who loves who Max matching John Sue Fred Ann A network s t Max Flow BUILD:MatchingOracle GIVEN:NetworkFlow Oracle Matching ≤compNetwork Flows

  23. Reductions Computable Exp Poly Halting • Learn that a new problem is likely hard, from knowing a known problem is likely hard.

  24. Reductions We give an algorithm for Palg using a supposed algorithm for Poracle as a subroutine. If there is not an algorithm for Palg If there is an algorithm for Palg ? ?? then there is not fast algorithm for Poracle ? If there is an algorithm for Poracle If there is not an algorithm for Poracle then there is an algorithm for Palg ?? ? ?

  25. Reductions computable We give an algorithm for Palg using a supposed algorithm for Poracle as a subroutine. Conclusions: Palgis “at least as easy as”Poracle (Modulo polynoM'al terms.) Poracleis “at least as hard as”Palg (Modulo polynoM'al terms.) Notation: Palg≤compPoracle

  26. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } = Poracle {“M”,I | M halts on I} ≤ • Proof Poracle is undecidable. • By way of contradiction assume Poracle is decidable. • Given an algorithm for Poracle,I construct a working algorithm for the halting problem. • Contradiction because the halting problem is undecidable. • Contrapositive:I can’t have a working algorithm for the halting problem,hence I can’t have an algorithm for Poracle,

  27. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ “M'”,I PHi Phalting <M'Hi ,I> <Mhalts,I> “M”,I <M'¬Hi,I> <M¬halts,I> • Consider the form of the instances of each problemand which are yes-instances.

  28. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ “M'”,I PHi Phalting InstanceMap <M'Hi ,I> <Mhalts,I> “M”,I <M'¬Hi,I> <M¬halts,I> • To ensure Algalg works, Ioracle=InstanceMap(Ialg)must map yes instances to yes instances and no to no.

  29. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ InstanceMap: • Given <“M”,I>, I can built “M'”. • Note: Given a description of M,I must construct the description of M'.This does not need a universal TM.M and M' will have similar states. M'(I') = { Ignore input I' M is built in Run M(I), Print(“Hi”) } suppressing any output • To ensure Algalg works, Ioracle=InstanceMap(Ialg)must map yes instances to yes instances and no to no.

  30. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ InstanceMap: • Given <“M”,I>, I can built “M'”. M'(I') = { Ignore input I' M is built in Run M(I), Print(“Hi”) } suppressing any output • To ensure Algalg works, Ioracle=InstanceMap(Ialg)must map yes instances to yes instances and no to no. M(I) halts  M'(I') says “Hi” on every I' M(I) ¬halt  M'(I') no “Hi” on every I'

  31. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ • Given an algorithm for Poracle,I construct a working algorithm for the halting problem. M(I) halts  M'(I') says “Hi” on every I' M(I) ¬halt  M'(I') no “Hi” on every I'

  32. Yes/No Yes/No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ “M”,I “M'”,I M'(I') = { Ignore input I' M is built in Run M(I), Print(“Hi”) } Must prove Alg works. suppressing any output {“M”,I | M prints “Hi” on I} {“M”,I | M halts on I} M(I) halts  M'(I') says “Hi” on every I' M(I) ¬halt  M'(I') no “Hi” on every I'

  33. Yes Yes, prints “Hi” BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ Case: M(I) halts “M”,I “M'”,I M'(I') = { Ignore input I' M is built in Run M(I), Print(“Hi”) } Must prove Alg works. suppressing any output {“M”,I | M prints “Hi” on I} {“M”,I | M halts on I} M(I) halts  M'(I') says “Hi” on every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') no “Hi” on every I'

  34. No No “Hi” BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ Case: M(I) ¬halts “M”,I “M'”,I M'(I') = { Ignore input I' M is built in Run M(I), Print(“Hi”) } Must prove Alg works. suppressing any output {“M”,I | M prints “Hi” on I} {“M”,I | M halts on I} M(I) halts  M'(I') says “Hi” on every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') no “Hi” on every I' • Oracle: No  Alg: No

  35. Reductions for Undecidability {“M”,I | M prints “Hi” on I at some point in computation } {“M”,I | M halts on I} ≤ • Given an algorithm for Poracle,I have a working algorithm for the halting problem. But I can’t have a working algorithm for the halting problem,hence I can’t have an algorithm for Poracle, Done Proof! M(I) halts  M'(I') says “Hi” on every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') no “Hi” on every I' • Oracle: No  Alg: No

  36. M(I) halts or not Yes or No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M” | M halts empty string} {“M”,I | M halts on I} ≤ “M”,I “M'” M'(I') = { Ignore input I' M & I are built in Run M(I) } Must prove Alg works. {“M” | M halts empty string} {“M”,I | M halts on I} M(I) halts  M'(I') halt for every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') ¬halt for every I' • Oracle: No  Alg: No

  37. M(I) halts or not Yes or No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M” | I, M halts on I} {“M”,I | M halts on I} ≤ “M”,I “M'” M'(I') = { Ignore input I' M & I are built in Run M(I) } Must prove Alg works. {“M”,I | M halts on I} {“M” | I, M halts on I} M(I) halts  M'(I') halt for every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') ¬halt for every I' • Oracle: No  Alg: No

  38. M(I) halts or not Yes or No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M” | I, M halts on I} {“M”,I | M halts on I} ≤ “M”,I “M'” M'(I') = { Ignore input I' M & I are built in Run M(I) } Must prove Alg works. {“M”,I | M halts on I} {“M” | I, M halts on I} M(I) halts  M'(I') halt for every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') ¬halt for every I' • Oracle: No  Alg: No

  39. M(I) halts or not Yes or No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M”,“M'” | I M(I)=M'(I)} {“M”,I | M halts on I} ≤ “M”,I “M'”,“M''” M''(I') halts and accepts M'(I') = { Ignore input I' M & I are built in Run M(I) } Must prove Alg works. {“M”,“M'” | I M(I)=M'(I)} {“M”,I | M halts on I} M(I) halts  M'(I') halt for every I' • Oracle: Yes  Alg: Yes M(I) ¬halt  M'(I') ¬halt for every I' • Oracle: No  Alg: No

  40. M(I) halts or not Yes or No BUILD:Oracle for GIVEN:Oracle for Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M”,I “M'” M'(I') = { Ignore input I' M & I are built in Run M(I) } Must prove Alg works. {“M” | L(M) is regular} {“M”,I | M halts on I} • L(M') = {0,1}* M(I) halts  M'(I') halt for every I' • Oracle: Yes • L(M') = {} M(I) ¬halt  M'(I') ¬halt for every I' • Oracle: Yes!

  41. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” Phalting Preg “M'reg” <Mhalts,I> “M”,I “M'¬reg ” <M¬halts,I> • Consider the form of the instances of each problemand which are yes-instances.

  42. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” Phalting Preg “M'reg” <Mhalts,I> I “M”,I • A yes-input of Preg • is the description of a TM M'reg • whose language L(M'reg) is regular.i.e. can be computed by a DFA. “M'¬reg ” <M¬halts,I> L(M'reg) 01101 Iyes Ino Irun forever

  43. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” Phalting Preg “M'reg” <Mhalts,I> I “M”,I • A no-input of Preg • is the description of a TM M'¬reg • whose language L(M'¬reg) is not regular.i.e. cannot be computed by a DFA. “M'¬reg ” <M¬halts,I> L(M'¬reg) 01101 Iyes Ino Irun forever

  44. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” “M'” “M'” 0n1n 1n0n “M'all” “M'none” Phalting Preg <Mhalts,I> “M”,I <M¬halts,I> • Lets be more discerning

  45. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” “M'” “M'” 0n1n 1n0n “M'all” “M'none” Phalting Preg <Mhalts,I> I “M”,I • Any input “M' ” • is the description of a TM • whose language L(M') is 0n1n • which is not regular. <M¬halts,I> 0n1n 0n1n 0n1n 000111 There are many such TM. 10

  46. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” “M'” “M'” 0n1n 1n0n “M'all” “M'none” Phalting Preg <Mhalts,I> I “M”,I • The TM M' • does not care to distinguish whether its input has the form 1n0n or not. <M¬halts,I> 0n1n 0n1n 000111 101 1n0n 10

  47. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” “M'” “M'” 0n1n 1n0n “M'all” “M'none” Phalting Preg <Mhalts,I> I “M”,I {0,1}* • Any input “M'all” • is the description of a TM • whose language L(M'all) is {0,1}* • which is regular. <M¬halts,I> 000111 10

  48. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ “M'” “M'” InstanceMap “M'” 0n1n 1n0n “M'all” “M'none” Phalting Preg <Mhalts,I> “M”,I • To ensure Algalg works, Ioracle=InstanceMap(Ialg)must <M¬halts,I> map yes instances to yes instances and no to no. • It is ok that Ioracle=InstanceMap(Ialg)maps only instances that we like.

  49. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ InstanceMap: • Given <“M”,I>, I can built “M'”. M'(I') = { If I’ has the form 0n1n halt and accept else run M(I) halt and accept } M(I) ¬halt  L(M') = ?  M' accepts If I’ has the form 0n1n  M' runs forever. If I’ has the form 1n0n

  50. Reductions for Undecidability {“M” | L(M) is regular} {“M”,I | M halts on I} ≤ InstanceMap: • Given <“M”,I>, I can built “M'”. M'(I') = { If I’ has the form 0n1n halt and accept else run M(I) halt and accept } M(I) ¬halt  L(M') = ?  M' accepts If I’ has the form 0n1n  M' runs forever. If I’ not have form 0n1n M'recognizes 0n1n, but “computes” no language L(M') = 0n1n • L(M') is not regular

More Related