4111-04-Reductions_Halting

4111-04-Reductions_Halting - Reductions to the Halting...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Reductions to the Halting Problem Different Models Reductions Simple Reductions Rice's Theorem Reverse Reduction Acceptable 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 Lecture 4 Jeff Edmonds York University COSC 4111 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} = {<P,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. Reductions for Undecidability Now that we have established that the Halting Problem is undecidable, we can use it for a jumping off point for more "natural" undecidability results. Palg poly Poracle Reductions Reduction: Design an algorithm for one computational problem, using a supposed algorithm for another problem as a subroutine. Palg poly Poracle Reductions 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." Sam Bob John Fred Mary Beth Sue Ann Reductions Matching poly Network Flows Who loves who Max matching s t A network BUILD: Matching s t Max Flow GIVEN: Network Flow Oracle Oracle Reductions Computable Exp Halting Poly Learn that a new problem is likely hard, from knowing a known problem is likely hard. We give an algorithm for Palg using a supposed algorithm for Poracle as a subroutine. Reductions Is there an algorithm for Palg? Is there an algorithm for Poracle? ? We give an algorithm for Palg using a supposed algorithm for Poracle as a subroutine. If there is an algorithm for Palg If there is not an algorithm for Palg then there is not fast ? algorithm for Poracle If there is not an algorithm for Poracle Reductions ??? If there is an algorithm for Poracle then there is an algorithm for Palg ? ??? We give an algorithm for Palg using a supposed algorithm for Poracle as a subroutine. Conclusions: Reductions Palg is "at least as easy as" Poracle (Modulo polynomial terms.) Poracle is "at least as hard as" Palg (Modulo polynomial terms.) Notation: Palg poly Poracle 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> | M halts on every input} {<M> | M halts on some input} {<M> | L(M) is regular} {<M,M'> | I M(I) and M'(I)} There is a fixed TM M* {<I> | M* halts on I} {<M> | based on what M does, not on how it does it} poly {<M,I> | M halts on I} Hence, all are undecidable! Reductions for Undecidability {<M,I> | M halts on I} {<M,I> | M prints "Hi" on I at some point in computation } <M',I> <M,I> M(I) halts M'(I) = { Run M(I), suppressing any output Print("Hi") } BUILD: Oracle for {<M,I> | M halts on I} Yes, prints "Hi" GIVEN: Oracle for {<M,I> | M prints "Hi" on I} Reductions for Undecidability {<M,I> | M halts on I} {<M,I> | M prints "Hi" on I at some point in computation } <M',I> <M,I> M(I) does not halt M'(I) = { Run M(I), suppressing any output Print("Hi") } BUILD: Oracle for {<M,I> | M halts on I} No "Hi" GIVEN: Oracle for {<M,I> | M prints "Hi" on I} Reductions for Undecidability {<M,I> | M halts on I} {<M> | M halts empty string} <M,I> M(I) halts or not <M'I> M'I(I') = { Ignore input I' I is a built in value Run M(I) } Yes or No GIVEN: BUILD: Oracle for {<M,I> | M halts on I} Oracle for {<M> | M halts empty string} Reductions for Undecidability {<M,I> | M halts on I} {<M> | M halts on every input} <M,I> M(I) halts or not MI(I') = { Ignore input I' I is a built in value Run M(I) } BUILD: <MI> Oracle for {<M,I> | M halts on I} Yes or No GIVEN: Oracle for {<M> | M halts on every input} Reductions for Undecidability {<M,I> | M halts on I} {<M> | M halts on some input} <M,I> M(I) halts or not MI(I') = { Ignore input I' I is a built in value Run M(I) } BUILD: <MI> Oracle for {<M,I> | M halts on I} Yes or No GIVEN: Oracle for {<M> | M halts on some input} Reductions for Undecidability {<M,I> | M halts on I} {<M> | L(M) is regular} <M,I> M(I) halts MI(I') = { Ignore input I' I is a built in value Run M(I) } BUILD: <MI> Oracle for {<M,I> | M halts on I} L(MI) = {everything} Oracle for Yes , L(MI) is regular {<M> | L(M) is regular} GIVEN: Reductions for Undecidability {<M,I> | M halts on I} {<M> | L(M) is regular} <M,I> M(I) does not halt MI(I') = { Ignore input I' I is a built in value Run M(I) } BUILD: <MI> Oracle for {<M,I> | M halts on I} L(MI) = {nothing} Oracle for Yes, L(MI) is regular {<M> | L(M) is regular} GIVEN: Reductions for Undecidability {<M,I> | M halts on I} {<M> | L(M) is regular} <M,I> <MI> MI(I') = M(I) does not halt { If I' has the form 0n1n halt and accept else run M(I) halt and accept } BUILD: Oracle for {<M,I> | M halts on I} L(MI) = 0n1n Oracle for No, L(MI) is not regular {<M> | L(M) is regular} GIVEN: MI accepts 0n1n, but "computes" no language Reductions for Undecidability {<M,I> | M halts on I} {<M> | L(M) is regular} <M,I> M(I) halts <MI> MI(I') = { If I' has the form 0n1n halt and accept else run M(I) halt and accept } L(MI) = {everything} Oracle for Yes, L(MI) is regular {<M> | L(M) is regular} GIVEN: BUILD: Oracle for {<M,I> | M halts on I} Reductions for Undecidability {<M,I> | M halts on I} {<M,M'> | I M(I)=M'(I)} <M,I> M(I) halts or not <MI,M'> MI(I') = M' = ? { Ignore input I' I is a built in value Run M(I) } Same or different GIVEN: BUILD: Oracle for {<M,I> | M halts on I} Oracle for {<M,M'> | I M(I)=M'(I)} Reductions for Undecidability {<M,I> | M halts on I} {<M,M'> | I M(I) and M'(I)} <MI,M'> MI(I') = M' = ? { Ignore input I' I is a built in value Run M(I) } If M halts on I MI halts on every input M' halts on every input MI and M' have the same results on every input Oracle says yes We say yes Reductions for Undecidability {<M,I> | M halts on I} {<M,M'> | I M(I)=M'(I)} <MI,M'> MI(I') = M' = ? { Ignore input I' I is a built in value Run M(I) } If M does not halt on I MI does not halt on every input M' halts on every input MI and M' have different results on some input Oracle says no We say no Reductions for Undecidability {<M,I> | M halts on I} {<M,M'> | I M(I)=M'(I)} <M,I> M(I) halts or not <MI,M'> MI(I') = { Ignore input I' I is a built in value Run M(I) } Yes or No ignores input and halts M' = ? BUILD: GIVEN: Oracle for {<M,I> | M halts on I} Oracle for {<M,M'> | I M(I) = M'(I)} Reductions for Undecidability {<M,I> | M halts on I} {<I> | M* halts on I} where M* is a special TM <M,I> M(I) halts or not <I'> Need to tell oracle about M and I I' = <M,I> M* is the universal TM simulates M on I. Yes or No GIVEN: BUILD: Oracle for {<M,I> | M halts on I} Oracle for {<I> | M* halts on I} Reductions for Undecidability {<M,I> | M halts on I} Rice's Theorem L = {<M> | based on what M does, not on how it does it} If L(M) =L(M'), then ML iff ML' L {everything} L {nothing} Assume Mempty L, i.e. L(Mempty) = {nothing} (Else switch to L) Assume Myes L Reductions for Undecidability {<M,I> | M halts on I} L = {<M> | based on what M does, not on how it does it} <M'> M'(I') = { Run M(I) Run Myes(I') respond as Myes(I') does } BUILD: <M,I> M(I) halts Oracle for {<M,I> | M halts on I} L(M') = L(Myes) Myes L M' L Yes GIVEN: Oracle for L Reductions for Undecidability {<M,I> | M halts on I} L = {<M> | based on what M does, not on how it does it} <M'> M'(I') = { Run M(I) Run Myes(I') respond as Myes(I') does } BUILD: <M,I> M(I) does not halt Oracle for {<M,I> | M halts on I} L(M') = {nothing} Oracle for = L(Mempty) Mempty L M' L L No GIVEN: 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> | M halts on every input} {<M> | M halts on some input} {<M> | L(M) is regular} {<M,M'> | M=M' have the same results on every input} There is a fixed TM M* {<I> | M* halts on I} {<M> | based on what M does, not on how it does it} poly {<M,I> | M halts on I} Hence, all are undecidable! 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} poly {<M,I> | M halts on I} poly {<M,I> | M halts on I} Hence, all are equivalent! {<M,I> | M prints "Hi" on I at some point in computation } <M,I> Reductions for Undecidability {<M,I> | M halts on I} M(I) prints "Hi" on I <M',I> M'(I) = { Run M(I) if "Hi" is printed halt Loop forever } BUILD: Oracle for {<M,I> | M prints "Hi" on I} Yes halts GIVEN: Oracle for {<M,I> | M halts on I} {<M,I> | M prints "Hi" on I at some point in computation } <M,I> Reductions for Undecidability {<M,I> | M halts on I} M(I) does not print "Hi" <M',I> M'(I) = { Run M(I) if "Hi" is printed halt Loop forever } BUILD: Oracle for {<M,I> | M prints "Hi" on I} No, does not halt GIVEN: Oracle for {<M,I> | M halts on I} 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> | M halts on every input} {<M> | M halts on some input} {<M> | L(M) is regular} {<M,M'> | I M(I)=M'(I)} There is a fixed TM M* {<I> | M* halts on I} {<M> | based on what M does, not on how it does it} poly {<M,I> | M halts on I} Hence, all are equivalent! Yes Yes Yes Yes ? ? Yes ? {<M,M'> | I M(I)=M'(I)} Reductions for Undecidability {<M,I> | M halts on I} <M,M'> M=M' on every input <M',I> ? BUILD: Oracle for {<M,M'> | I M(I) = M'(I)} M' halts or not Oracle for on this input {<M,I> | M halts on I} GIVEN: Acceptable Acceptable Computable A computational problem/language is said to be computable/decidable/recursive iff TM M On every input the machine halts and gives the correct answer. is said to be accepted/semidecided/enumerable iff TM M On every yes input the machine halts and gives the correct answer. (A halting computation is a witness of a yes answer) On every no inputs the machine could halt and gives the correct answer or could run for ever. Acceptable Acceptable Halting Computable Is there a language that can be accepted but not computed? Halting: Given <M,I> does program halt on I? Alg: Run it. Acceptable iff TM M On every yes input the machine halts and gives the correct answer. (A halting computation is a witness of a yes answer) On every no inputs the machine could halt and gives the correct answer or could run for ever. Acceptable Acceptable Halting Computable {<M,I> | M prints "Hi" on I} {<M> | M halts empty string} {<M> | M halts on every input} {<M> | M halts on some input} TM M* {<I> | M* halts on I} Acceptable Acceptable Halting Computable Co-Acceptable Not Halting A computational problem/language is said to be co-accepted/semidecided/enumerable iff TM M On every no input the machine halts and gives the correct answer. (A halting computation is a witness of a no answer) On every yes inputs the machine could halt and gives the correct answer or could run for ever. Acceptable Acceptable {<M,I> | M does print "Hi" on I} {<M,I> | M does not print "Hi" on I} Computable Co-Acceptable A computational problem/language is said to be co-accepted/semidecided/enumerable iff TM M On every no input the machine halts and gives the correct answer. (A halting computation is a witness of a no answer) On every yes inputs the machine could halt and gives the correct answer or could run for ever. Acceptable {<M,I> | M halts on I} {<M,I> | M does not print "Hi" on I at some point in computation } <M,I> No halt <M',I> M'(I) = { Run M(I), suppressing any output Print("Hi") } BUILD: Oracle for {<M,I> | M halts on I} GIVEN:O racle for Yes, no print {<M,I> | M not print "Hi" on I} Acceptable {<M,I> | M halts on I} {<M,I> | M does not print "Hi" on I at some point in computation } <M,I> Yes halt <M',I> M'(I) = { Run M(I), suppressing any output Print("Hi") } BUILD: Oracle for {<M,I> | M halts on I} GIVEN:O racle for No, no print {<M,I> | M not print "Hi" on I} Acceptable {<M,I> | M halts on I} {<M,I> | M does not print "Hi" on I at some point in computation } Computable If not computable If not co-acceptable If computable Not computable ???? Yes and no flipped Acceptable Palg poly Poracle Cook Reduction: Design any algorithm for Palg using a supposed algorithm for Poracle as a subroutine. Karp Reduction: The algorithm for Palg calls that for Poracle only once Yes Yes & No No Acceptable Palg poly Poracle Karp Reduction: Yes Yes & No No We will only consider reductions of this simple form. Because they preserve acceptable/co-acceptable Acceptable {<M,I> | M halts on I} <M,I> Yes M(I) halts <M',I> M'(I) = {<M,I> | M does not print "Hi" on I at some point in computation } ? BUILD: Oracle for {<M,I> | M halts on I} Yes, no print GIVEN: Oracle for {<M,I> | M not print "Hi" on I} Acceptable Acceptable Co-Acceptable Computable {<M,I> | M does {<M,I> | M does not print "Hi" on I} print "Hi" on I } The two complement problems: Are equivalent wrt being computable i.e. one is, then the other is. But not equivalent wrt being acceptable Acceptable Acceptable Computable Co-Acceptable {<M,M'> | I M(I)=M'(I)} A computational problem/language is said to be accepted/semidecided/enumerable On every yes input the machine halts and gives the correct answer. On every no inputs the machine could halt and gives the correct answer or could run for ever. Acceptable Acceptable Computable Co-Acceptable {<M,M'> | I M(I)=M'(I)} A computational problem/language is said to be co-accepted/semidecided/enumerable On every no input the machine halts and gives the correct answer. On every yes inputs the machine could halt and gives the correct answer or could run for ever. Reductions for Undecidability Now that we have established that the Halting Problem and its friends are undecidable, we can use it for a jumping off point for more "natural" undecidability results. The Post Correspondence Problem The input is a finite collection of dominos P= b a ca abc ca , ab , a , c A solution is a finite sequence of the dominos (with repeats) a b ca a abc ab ca a ab c So that the combined string on the top is the same as that on the bottom abcaaabc abcaaabc PCP = {<P> | P is a collection of dominos with a solution} PCP is undecidable The Post Correspondence Problem {<M,I> | M halts on I} {<P> | Dominos P has a solution} <M,I> Yes M(I) halts <P> Dominos in P mimic the rules of the TM M on input I BUILD: Yes, there is a solution GIVEN: Oracle for {<M,I> | M halts on I} Oracle for {<P> | Dominos P has a solution} The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 Encode configuration of the TM as a string giving the contents of the tape and the current state inserted where the head is. 10qi10010 The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 Encode the halting computation of M on I as the string of configurations separated by `#' #qstart0110010#1q3010010#10q710010#100q60010#10 .... #qaccept# I TM accepts by halting in the accept state with the tape empty The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 Encode the halting computation of M on I as the string of configuration separated by `#' #qstart0110010#1q3010010#10q710010#100q60010#10 .... #qaccept# M halts on I iff there is such a computation string iff the dominos P has a solution with this string as the combined string on the top and on the bottom The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 The first domino in P is # #qstart0110010# I Lets temporarily assume that the domino solution must start with this domino. The loop invariant is that in the only domino solution the combined string so far on the top consists of the first t TM configurations and on the bottom the first t+1. The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 qj TM is in state qi and sees a 1. Transition (qi,1) = <qj,c,right> 1 0 c 1 0 1 0 Config: #10qi11010# #10qj11010# #10qjc1010# #10cqj1010# qi1 Related domino: cqj The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 qj TM is in state qi and sees a 1. Transition (qi,1) = <qj,c,left> 1 0 c 1 0 1 0 Config: #10qi11010# #10qj11010# #10qjc1010# #1qj0c1010# Related dominos: 0qi1 1qi1 & qj0c qj1c The Post Correspondence Problem Consider some configuration of a TM q 1 0 1 1 0 1 0 Related dominos: 0 b 1 Copy unchanged characters: , ,& b 0 1 # Start a new configuration: # b# # Add and removing trailing blanks: b# & # qaccept## Accepting: # The Post Correspondence Problem The loop invariant is that in the only domino solution the combined string so far on the top consists of the first t TM configurations and on the bottom the first t+1. ...0# ...0#10qi1001b# The Post Correspondence Problem For the top string to match the bottom string this t+1st configuration must be produced by dominos on the top. ...0# 1 ...0#10qi1001b# 0 qi1 0 0 1 b # The Post Correspondence Problem With With transition (qi,1) = <qj,0,right> the only way to match the "qi1" on top is with the domino Then the remain characters can be copied down. ...0# 1 ...0#10qi1001b# 1 0 qi1 0 0 0qj 0 0 0 1 1 b b # # The Post Correspondence Problem This maintains the loop invariant that in the only domino solution the combined string so far on the top consists of the first t TM configurations and on the bottom the first t+1. ...0# 1 0 qi1 0 0 1 ...0#10qi1001b# 1 0 0qj 0 0 1 ...0#10qi1001b# ...0#10qi1001b#100qj001b# b b # # The Post Correspondence Problem The TM is allowed to use as much tape as it likes. The extra cells are assumed to initially contain blanks. Towards this end, suppose you would like to insert a blank at the end of this configuration before the #. ...0# 1 ...0#10qi1001b# 1 ...0# 1 ...0#10qi1001b# 1 0 qi1 0 0 0qj 0 0 q...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern