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
1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
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.
1 Module 13 Studying the internal structure of REC, the set of solvable problems –Complexity theory overview –Automata theory preview Motivating Problem.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Module 10 Universal Algorithms –moving beyond one problem at a time –operating system/general purpose computer.
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
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Recursively Enumerable and Recursive Languages
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)
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 10 Universal Algorithms –moving beyond one problem at a time –operating system/general purpose computer.
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
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.
Odds and Ends HP ≤ p HC (again) –Turing reductions Strong NP-completeness versus Weak NP-completeness Vertex Cover to Hamiltonian Cycle.
1 Lecture 23 Decision problems about regular languages –Programs can be inputs to other programs FSA’s, NFA’s, regular expressions –Basic problems are.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
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,
CS21 Decidability and Tractability
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
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.
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.
 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.
Decidability.
Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex 1.
Undecidable Problems Costas Busch - LSU.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CSCE 411 Design and Analysis of Algorithms
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
CS21 Decidability and Tractability
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 language 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 REC L1L1 L2L2 L2L2 L1L1 L1L1 L2L2 L1L1 L2L2

6 What we will typically do Set of all languages 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 languages 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 map to yes inputs no inputs map to no inputs

9 Construction Overview P1P1 xYes/No Properties of the construction Input string x is transformed into a new string 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:  * -->  * –For all x in  *, P 3 (x) must be defined That is P 3 must halt with some output P 3 (x) –For all x in  *, (x in L 1 ) iff (P 3 (x) in L 2 ) (x in L 1 ) --> (P 3 (x) in L 2 ) Not (x in L 1 ) --> Not (P 3 (x) in L 2 ) P2P2 P3P3 P1P1 x P 3 (x) Yes/No

12 Yes->Yes and No->No ** L1L1 L1L1 ** L2L2 L2L2 P2P2 P3P3 P1P1 x P 3 (x) Yes/No

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 ** L1L1 L1L1 ** L2L2 L2L2

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? L 2 is odd length strings over {0,1} Tasks –Give an answer-preserving input transformation f which shows that L 1 <= L 2 –Give a corresponding program P 3 which computes f ** L1L1 L1L1 ** L2L2 L2L2

15 Example 2 L 1 is {0,1} * –what is the set of all inputs, yes inputs, no inputs? L 2 is {0} Tasks –Give an answer-preserving input transformation f which shows that L 1 <=L 2 –Give a corresponding program P 3 which computes f ** L1L1 L1L1 ** L2L2 L2L2

16 Constructing an example P 3

17 Example L 1 is H Input –Program P’ –input y to program P’ Yes/No Question –Does P’ halt on y? L 2 Input –Program P’’ Yes/No question –Does Y(P’’) = the set of even length strings?

18 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

19 Keep this in mind 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 P’, P’’, and P’’’ code for P’’ is available to P 3

20 Analysis of L 2 L 2 –Input Program P –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 P bool main(string z) {while (1>0) ;} –P loops on all inputs, so Y(P) = {} –P 2 rejects program P as input Consider the following program P’’ bool main(string z) { if ((z.length %2) == 0) return (yes) else return (no); } –Y(P’’) = set of even length strings –P 2 accepts program P’’ as input

21 Declaration of P 3 What is the return type of P 3 ? –Type program What are the input parameters of P 3 –The same as the input parameters to P 1 ; in this case, Type program Type input to the above program program main(program P’, input type y) P2P2 P3P3 P1P1 P’,y P’’’ Yes/No

22 Make P’ and P’’ be two procedures of P’’’ main function of P’’’ –input argument for P’’’ is of the same type as that for P’’ –first line: declare a variable y and make it have the same type and value as the input y passed to P 3 –second line: call P’ with y as the parameter P’(y); –Ignore what P’ returns; only interested if P’ halts on y –third line: call P’’ with the input z as the parameter and return what P’’ does return(P’’(z)); Pseudocode for P 3 P2P2 P3P3 P1P1 P’,y P’’’ Yes/No

23 P 3 illustrated P2P2 P3P3 P1P1 P’,y P’’’ Yes/No P 3 code for P’’ P’ string y start P’’ Y/N z P’’’ halt P’ y Program P’ int main(A[10]) { int max,i max = A[0]; for (i=1;i<10;i++) if (A[i] > max) max = A[i]; return max; } Input y 0,1,5,3,2,7,5,8,2,10 Program P’’’ int P’(A[10]) { int max,I; max = A[0]; for (i=1;i<10;i++) if (A[i] > max) max = A[i]; return max; } bool P’’(string z) { if ((z.length % 2) == 0) return (yes) else return (no); } bool main(string z) { int y[10]={0,1,5,3,2,7,5,8,2,10}; P’(y); return (P’’(z)); } P3P3 P’’

24 Example 1 Idea –P’’’ calls subroutine P’ on y to “test” if P’ halts on y –P’’’ then calls subroutine P’’ where P’’ has the right property P2P2 P3P3 P1P1 P’,y P’’’ Yes/No Input to P 3 Program P’ int main(A[10]) { int max,i max = A[0]; for (i=1;i<10;i++) if (A[i] > max) max = A[i]; return max; } Input y 0,1,5,3,2,7,5,8,2,10 Output of P 3 Program P’’’ int P’(A[10]) { int max,I; max = A[0]; for (i=1;i<10;i++) if (A[i] > max) max = A[i]; return max; } bool P’’(string z) { if ((z.length % 2) == 0) return (yes) else return (no); } bool main(string z) { int y[10]={0,1,5,3,2,7,5,8,2,10}; P’(y); return (P’’(z)); }

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

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

27 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