1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,

Slides:



Advertisements
Similar presentations
Formal Models of Computation Part III Computability & Complexity
Advertisements

Lecture 19. Reduction: More Undecidable problems
Analysis of Algorithms
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
1 Lecture 4 Topics –Problem solving Subroutine Theme –REC language class The class of solvable problems Closure properties.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
1 Module 15 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
Lecture 9 Recursive and r.e. language classes
1 Lecture 14 Language class LFSA –Study limits of what can be done with FSA’s –Closure Properties –Comparing to other language classes.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Lecture 8 Recursively enumerable (r.e.) languages
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Lecture 2: Fundamental Concepts
Module 5 Topics Proof of the existence of unsolvable problems
1 Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 26 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 10 Proving more specific problems are not recursive Reduction technique –Use subroutine theme to show that if one problem is unsolvable, so is.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
CHAPTER 4 Decidability Contents Decidable Languages
1 Lecture 2 Topics –Importance of this material Fundamental Limitations –Connecting Problems and Languages Problems –Search, function and decision problems.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
1 Lecture 5 Topics –Closure Properties for REC Proofs –2 examples Applications.
1 Lecture 18 Closure Properties of Language class LFSA –Remember ideas used in solvable languages unit –Set complement –Set intersection, union, difference,
1 Strings and Languages Operations Concatenation Exponentiation Kleene Star Regular Expressions.
1 Lecture 13 Turing machine model of computation –Sequential access memory (tape) –Limited data types and instructions –Graphical representation –Formal.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 7 Topics –Problems about program behavior At least problem input is a program/algorithm –Halting Problem Fundamental problem about program behavior.
1 Lecture 23 Decision problems about regular languages –Programs can be inputs to other programs FSA’s, NFA’s, regular expressions –Basic problems are.
1 Module 25 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
1 Module 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 Module 10 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Hardness Results for Problems
1 Lecture 6 Topics –Proof of the existence of unsolvable problems Problems/languages not in REC Proof Technique –There are more problems/languages than.
1 Lecture 11 Studying structure of REC –Complexity theory overview –Automata theory preview Motivating Problem –string searching.
1 Lecture 14 Studying the internal structure of REC, the set of solvable problems –Complexity theory overview –Automata theory preview Motivating Problem.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
C SC 573 Theory of Computation Theory of Computation Lecture 05 Reduction.
Recursively Enumerable and Recursive Languages
1 Module 17 Closure Properties of Language class LFSA –Remember ideas used in solvable languages unit –Set complement –Set intersection, union, difference,
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Strings and Languages Operations Concatenation Exponentiation Kleene Star Regular Expressions.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Decidability.
Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex 1.
The Acceptance Problem for TMs
Busch Complexity Lectures: Reductions
Undecidable Problems Costas Busch - LSU.
Turing Machines 2nd 2017 Lecture 9.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
Lecture 4: Unsolvable Problems
Presentation transcript:

1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable, so is a second problem –Need to clearly differentiate between use of program as a subroutine and a program being an input to another program

2 Question 1 What can we conclude from the following scenario? –We prove/know problem L 2 is solvable –We show that we can construct a program P 1 which solves L 1 using any program P 2 which solves problem L 2 as a subroutine. –We conclude that Does this occur in “real-life programming”?

3 Question 2 What can we conclude from the following scenario? –We prove/know problem L 1 is not solvable –We show that we can construct a program P 1 which solves L 1 using any program P 2 which solves problem L 2 as a subroutine. –We conclude that

4 Rephrasing key step We show that we can construct a program P 1 which solves L 1 using any program P 2 which solves problem L 2 as a subroutine. –This can be rephrased in the following 2 ways: If L 2 is solvable, then L 1 is solvable –Scenario in question 1 If L 1 is not solvable, then L 2 is not solvable –Scenario in question 2

5 Illustration of “If L 1 is not solvable, then L 2 is not solvable” Set of all languages/problems REC L1L1 L2L2 L2L2 L1L1 L1L1 L2L2 L1L1 L2L2

6 What we will typically do Set of all languages/problems REC L1L1 L2L2 If L 1 is not solvable, then L 2 is not solvable

7 Proving “If L 2 is solvable, then L 1 is solvable” Assume L 2 is solvable Let P 2 be a program which solves L 2 Construct a program P 1 which solves L 1 using P 2 –We have no idea how P 2 solves L 2 We treat P 2 as a black box –L 1 and L 2 are now SPECIFIC problems Thus, we can use properties of L 1 and L 2 in this construction Argue P 1 solves L 1

8 Constructing P 1 from P 2 Many ways to construct P 1 from P 2 We focus on one method –Construct a program P 3 which computes a function f which I call an answer-preserving input transformation –P 3 (or f) transforms inputs to problem L 1 into inputs to problem L 2 so that yes inputs of L 1 map to yes inputs of L 2 no inputs of L 1 map to no inputs of L 2

9 Construction Overview P1P1 xYes/No Properties of the construction Input x is transformed into a new input P 3 (x) x is an input to program P 1 (problem L 1 ) P 3 (x) is an input to program P 2 (problem L 2 ) We must give actual program P 3 P 3 will use specific knowledge about L 1 and L 2 We use P 2 as a black box routine P2P2 Y/NP3P3 P 3 (x)

10 Answer-preserving input transformations in detail Properties of f and program P 3

11 Properties of P 3 (f) P 3 must compute an answer-preserving input transformation f:Domain for L 1 --> Domain of L 2 –For all x in Domain of L 1, P 3 (x) must be defined That is P 3 must halt with some output P 3 (x) –For all x in Domain of L 1 (x is a yes input for L 1 ) iff (P 3 (x) is a yes input for L 2 ) (x is a yes input for L 1 ) --> (P 3 (x) is a yes input for L 2 ) (x is a no input for L 1 ) --> (P 3 (x) is a no input for L 2 ) P2P2 P3P3 P1P1 x P 3 (x) Yes/No

12 Yes->Yes and No->No Domain of L 1 Yes inputs for L 1 P2P2 P3P3 P1P1 x P 3 (x) Yes/No No inputs for L 1 Yes inputs for L 2 No inputs for L 2 Domain of L 2

13 No harder If there is such an answer-preserving input transformation f (and the corresponding program P 3 ), we say that L 1 is no harder than L 2 Notation –L 1 <= L 2 Domain of L 1 Yes inputsNo inputs Yes inputsNo inputs Domain of L 2

14 Example L 1 is the set of even length strings over {0,1} –What is the set of all inputs, yes inputs, no inputs for the L 1 LRP? L 2 is the set of odd length strings over {0,1} –Same question as above Tasks –Give an answer-preserving input transformation f which shows that L 1 LRP <= L 2 LRP –Give a corresponding program P 3 which computes f Domain of L 1 Yes inputsNo inputs Yes inputsNo inputs Domain of L 2

15 Program P 3 string main(string x) { return(x concatenate “0”); }

16 Example 2 L 1 is {0,1} * –What is the set of all inputs, yes inputs, no inputs for the L 1 LRP? L 2 is {0} –Same question as above Tasks –Give an answer-preserving input transformation f which shows that the L 1 LRP <=L 2 LRP –Give a corresponding program P 3 which computes f Domain of L 1 Yes inputsNo inputs Yes inputsNo inputs Domain of L 2

17 Program P 3 string main(string x) { return( “0”); }

18 Example 3 L 1 –Input: Java program P that takes as input an unsigned int –Yes/No Question: Does P halt on all legal inputs L 2 –Input: C++ program P that takes as input an unsigned int –Yes/No Question: Does P halt on all legal inputs Tasks –Describe what an answer-preserving input transformation f that shows that L 1 <=L 2 would be Domain of L 1 Yes inputsNo inputs Yes inputsNo inputs Domain of L 2

19 Detailed Example

20 Problem Definitions L 1 is H Input –Program P’ that has one input of type unsigned int –non-negative integer y that is input to program P’ Yes/No Question –Does P’ halt on y? L 2 Input –Program P’’ that has one input of type string Yes/No question –Does Y(P’’) = the set of even length strings?

21 Construction overview again P1P1 xYes/No We are building a program P 1 to solve L 1 which, in this case, is the halting problem H P3P3 P 3 (x) P 1 will use P 3 as a subroutine, and we must explicitly construct P 3 using specific properties of L 1 and L 2 P2P2 Y/N P 1 will use P 2 as a subroutine, and we have no idea how P 2 accomplishes its task

22 Two program roles Programs which are PART of program P 1 and thus “executed” when P 1 executes –Program P 3, an actual program we construct –Program P 2, an assumed program which solves problem L 2 Programs which are INPUTS/OUTPUTS of programs P 1, P 2, and P 3 and which are not “executed” when P 1 executes –Programs Q 1, Q 2, and Q 3 code for Q 2 is available to P 3

23 Analysis of inputs for L 2 L 2 –Input Program P that has one input of type string –Yes/No question Does Y(P) = the set of even length strings? Program P 2 –Solves L 2 –We don’t know how Consider the following program Q bool main(string z) {while (1>0) ;} –Q loops on all inputs, so Y(Q) = {} –P 2 rejects program Q as input Consider the following program Q 2 bool main(string z) { if ((z.length %2) == 0) return (yes) else return (no); } –Y(Q 2 ) = set of even length strings –P 2 accepts program Q 2 as input

24 Declaration of P 3 What is the return type of P 3 ? –Type program1 (with one input of type string) What are the input parameters of P 3 –The same as the input parameters to P 1 ; in this case, type program2 (with one input of type unsigned int) unsigned int (input type to program2) program1 main(program2 Q 1, unsigned int y) P2P2 P3P3 P1P1 Q 1,y Q3Q3 Yes/No

25 program1 main(program2 P, unsigned int y) { /* Will be viewing types program1 and program2 as STRINGS over the program alphabet  P */ program1 Q 3 = replace-main-with-Q 1 (P); /* Insert line break */ Q 3 += “\n”; /* Insert Q 2 */ Q 3 += “bool Q 2 (string z) {\n \t if ((z.length % 2) == 0) return (yes) else return (no);\n }”; /* Add main routine of Q 3 */ Q 3 += “bool main(string z) {\n\t”; /* determined by L 2 */ Q 3 += “unsigned int y =” Q 3 += convert-to-string(y); Q 3 += “;\n\t Q 1 (y)\n\t return(Q 2 (z));\n}”; return(Q 3 ); } program1 replace-main-with-Q 1 (program2 P) /* Details hidden */ string convert-to-string(unsigned int y) /* Details hidden */ Code for P 3 P2P2 P3P3 P1P1 Q 1,y Q3Q3 Yes/No

26 P 3 in action P2P2 P3P3 P1P1 Q 1,y Q3Q3 Yes/No P 3 code for Q 2 Q1Q1 unsigned int y start Q2Q2 Y/N z Q3Q3 halt Q1Q1 y Program Q 1 bool main(unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } Input y 5 Program Q 3 bool Q 1 (unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } bool Q 2 (string z) { if ((z.length % 2) == 0) return (yes) else return (no); } bool main(string z) { unsigned int y = 5; Q 1 (y); return (Q 2 (z)); } P3P3 Q2Q2

27 Example 1 Idea –Q 3 calls subroutine Q 1 on y to “test” if Q 1 halts on y –Q 3 then calls subroutine Q 2 where Q 2 has the right property for L 2 P2P2 P3P3 P1P1 Q 1,y Q3Q3 Yes/No Input to P 3 Program Q 1 bool main(unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } Input y 5 Output of P 3 Program Q 3 bool Q 1 (unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } bool Q 2 (string z) { if ((z.length % 2) == 0) return (yes) else return (no); } bool main(string z) { unsigned int y = 5; Q 1 (y); return (Q 2 (z)); }

28 Example 2 Idea –Q 3 calls subroutine Q 1 on y to “test” if Q 1 halts on y –Q 3 then calls subroutine Q 2 where Q 2 has the right property for L 2 P2P2 P3P3 P1P1 Q 1,y Q3Q3 Yes/No Input to P 3 Program Q 1 bool main(unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } Input y 3 Output of P 3 Program Q 3 bool Q 1 (unsigned int y) { if (y ==5) return yes; else if (y ==4) return no; else while (1>0) {}; } bool Q 2 (string z) { if ((z.length % 2) == 0) return (yes) else return (no); } bool main(string z) { unsigned int y = 3; Q 1 (y); return (Q 2 (z)); }

29 If Q 1 loops on y, Y(Q 3 )={ } –Q 3 begins by running Q 1 on y –Suppose Q 1 does NOT halt on y Q 3 never even looks at input z; it just loops –Typically, Y(Q 3 ) = { } means Q 3 is a no input to problem L 2 If Q 1 halts on y, Y(Q 3 ) = Y(Q 2 ) –Note, Q 2 could be ANY program we want –CHOOSE Q 2 such that Q 2 is a yes input to problem L 2 or if Y(Q 3 ) = { } means Q 3 is a yes input to problem L 2, then choose Q 2 such that Q 2 is a no input to problem L 2 Key Observation start Q2Q2 Y/N z Q3Q3 halt Q1Q1 y

30 Summary Answer-preserving input transformations –L 1 <= L 2 –Construct P 1 from P 2 Similarities with closure property constructions –Use P 2 as a subroutine Differences with closure property constructions –Use specific properties of L 1 and L 2 –P 3 is inside P 1 and it maps inputs of L 1 to inputs of L 2 –Often have programs as inputs and outputs