FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453.

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
Reducibility Sipser 5.1 (pages ).
Mapping Reducibility Sipser 5.3 (pages ). CS 311 Fall Computable functions Definition 5.17: A function f:Σ*→Σ* is a computable function.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Linear Bounded Automata LBAs
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
CS21 Decidability and Tractability
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
February 4, 2015CS21 Lecture 131 CS21 Decidability and Tractability Lecture 13 February 4, 2015.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Recursively Enumerable and Recursive Languages
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
THE HALTING PROBLEM - PROOF. Review  What makes a problem decidable?  3 properties of an efficient algorithm?  What is the meaning of “complete”, “mechanistic”,
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Decidability.
Chapters 11 and 12 Decision Problems and Undecidability.
February 1, 2016CS21 Lecture 121 CS21 Decidability and Tractability Lecture 12 February 1, 2016.
Recursively Enumerable Languages
Theory of Computability
CSCI 2670 Introduction to Theory of Computing
Undecidable Problems Costas Busch - LSU.
Automata, Grammars and Languages
Theory of Computability
MCC 2093 Advanced Theoretical Computer Science
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 8: Undecidability, Mapping Reductions
CSCI 2670 Introduction to Theory of Computing
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Reducability Sipser, pages
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CS21 Decidability and Tractability
Theory of Computability
Theory of Computability
Theory of Computability
More undecidable languages
Theory of Computability
Automata, Grammars and Languages
More Undecidable Problems
Presentation transcript:

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

UNDECIDABILITY II: REDUCTIONS

A TM = { (M,w) | M is a TM that accepts string w } A TM is undecidable: (constructive proof & subtle) Assume machine H semi-decides A TM H( (M,w) ) = Accept if M accepts w Rejects or loops otherwise Construct a new TM D H as follows: on input M, run H on (M,M) and output the “opposite” of H whenever possible.

D H ( M ) = Reject if M accepts M (i.e. if H( M, M ) = Accept) Accept if M rejects M (i.e. if H( M, M ) = Reject) loops if M loops on M (i.e. if H( M, M ) loops) DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH DHDH Note: There is no contradiction here! D H loops on D H We can effectively construct an instance which does not belong to A TM (namely, (D H, D H ) ) but H fails to tell us that.

That is: Given any semi-decision machine H for A TM (and thus a potential decision machine for A TM ), we can effectively construct an instance which does not belong to A TM (namely, ( D H, D H )) but H fails to tell us that. So H cannot be a decision machine for A TM

HALT TM = { (M,w) | M is a TM that halts on string w } Theorem: HALT TM is undecidable THE HALTING PROBLEM Proof: Assume, for a contradiction, that TM H decides HALT TM We use H to construct a TM D that decides A TM On input (M,w), D runs H on (M,w) If H rejects then reject If H accepts, run M on w until it halts: Accept if M accepts and Reject if M rejects

H (M,w) M w If M doesn’t halt: REJECT If M halts Does M halt on w? D

In most cases, we will show that a language L is undecidable by showing that if it is decidable, then so is A TM We reduce deciding A TM to deciding the language in question A TM “<” L So, A TM “<” Halt TM Is Halt TM “<” A TM ?

E TM = { M | M is a TM and L(M) =  } Theorem: E TM is undecidable Proof: Assume, for a contradiction, that TM Z decides E TM s If s  w, REJECT If s = w, run M(w) Algorithm for deciding A TM : On input (M,w): MwMw 1. Create M w 2. Run Z on M w Use Z as a subroutine to decide A TM So, L (M w ) =   M(w) does not accept L (M w )    M(w) accepts

Accepts if M does not accept w Rejects, otherwise Z s If s  w, REJECT If s = w, run M(w) MwMw (M,w) L(M w ) =  ? So, L (M w ) =   M(w) does not accept REVERSE accept/reject Decision Machine for A TM N L(N) =  ? MwMw

REGULAR TM = { M | M is a TM and L(M) is regular} Theorem: REGULAR TM is undecidable Proof: Assume, for a contradiction, that TM R decides REGULAR TM

R N Is L(N) regular? s If s = 0 n 1 n, accept Else run M(w) MwMw L(M w ) = Σ* if M(w) accepts {0 n 1 n } otherwise L(M w ) is regular  M(w) accepts MwMw Is L(M w ) regular? Yes  M accepts w

ALL PDA = { P | P is a PDA and L(P) = Σ* } Theorem: ALL PDA is undecidable Proof: Assume, for a contradiction, that TM A decides ALL PDA We use A to decide A TM More subtle construction Idea! If M(w) does not accept, then there is no accepting computation for M on input w. Then any string of 0’s and 1’s will fail to be (a code for) an accepting computation. So, given (M, w) construct a PDA that accepts non-accepting computations of M on w. Thus, M(w) does not accept  L(P) = Σ* Idea!

CONFIGURATIONS 11010q q7q

COMPUTATION HISTORIES An accepting computation history is a sequence of configurations C 1,C 2,…,C k, where An rejecting computation history is a sequence of configurations C 1,C 2,…,C k, where 1. C 1 is the start configuration, 2. C k is a rejecting configuration, 3. Each C i follows from C i-1 2. C k is an accepting configuration, 1. C 1 is the start configuration,

M accepts w if and only if there exists an accepting computation history that starts with C 1 =q 0 w

ALL PDA = { P | P is a PDA and L(P) = Σ* } Theorem: ALL PDA is undecidable Proof: Assume, for a contradiction, that TM A decides ALL PDA We use A to decide A TM On input (M,w), construct a PDA P that accepts Σ* if and only if M does not accept w P will recognize all strings that are NOT accepting computation histories for M on w

1. Do not start with C 1 2. Do not end with an accepting configuration 3. Where some C i does not properly yield C i+1 P will recognize all strings (read as sequences of configurations) that: ε,ε → ε Non-deterministic checks for 1, 2, and 3.

0 → , R  → , R q accept q reject 0 → x, R x → x, R  → , R x → x, R 0 → 0, L x → x, L x → x, R  → , L  → , R 0 → x, R 0 → 0, R  → , R x → x, R { 0 | n ≥ 0 } 2n2n q0q0 q1q1 q2q2 q3q3 q4q4

0 → , R  → , R q accept q reject 0 → x, R x → x, R  → , R x → x, R 0 → 0, L x → x, L x → x, R  → , L  → , R 0 → x, R 0 → 0, R  → , R x → x, R { 0 | n ≥ 0 } 2n2n q0q0 q1q1 q2q2 q3q3 q4q4 q  q  xq 3 00  x0q 4 0  x0xq 3  x0q 2 x  xq 2 0x  q 2 x0x q 2  x0x

P recognizes all strings except: #C 1 # C 2 R #C 3 #C 4 R #C 5 #C 6 R #….# C k If k is odd, put C k on stack and see if C k+1 R follows properly: For example, If =uaq i bv and  (q i,b) = (q j,c,R), then C k properly yields C k+1  C k+1 = uacq j v

P recognizes all strings except: #C 1 # C 2 R #C 3 #C 4 R #C 5 #C 6 R #….# C k If k is odd, put C k on stack and see if C k+1 R follows properly: For example, If =uaq i bv and  (q i,b) = (q j,c,L), then C k properly yields C k+1  C k+1 = uq j acv

P recognizes all strings except: #C 1 # C 2 R #C 3 #C 4 R #C 5 #C 6 R #….# C k If k is even, put C k R on stack and see if C k+1 follows properly: For example, If =uaq i bv and  (q i,b) = (q j,c,L), then C k properly yields C k+1  C k+1 = uq j acv

ALL PDA = { P | P is a PDA and L(P) = Σ* } Theorem: ALL PDA is undecidable Proof: Assume, for a contradiction, that TM A decides ALL PDA We use A to decide A TM On input (M,w), construct a PDA P that accepts Σ* if and only if M does not accept w P will recognize all strings that are NOT accepting computation histories for M on w

MAPPING REDUCIBILITY f : Σ*  Σ* is a computable function if some Turing machine M, on every input w, halts with just f(w) on its tape A language A is mapping reducible to language B, written A  m B, if there is a computable function (“coding”) f : Σ*  Σ*, where for every w, w  A  f(w)  B f is called a reduction from A to B

AB f f

Theorem: If A  m B and B is decidable, then A is decidable Proof: Let M decide B and let f be a reduction from A to B We build a machine N that decides A as follows: On input w: 1. Compute f(w) 2. Run M on f(w)

All undecidability proofs from today can be seen as constructing an f that reduces A TM to the proper language Exercise. Construct such an f in each case. (Hint. Sometimes you have to consider the complement of the language. )

All undecidability proofs from today can be seen as constructing an f that reduces A TM to the proper language A TM  m HALT TM : Map (M, w)  (M’, w) where M’(w) = M(w) if M(w) accepts loops otherwise So (M, w)  A TM  (M’, w)  HALT TM

Read chapter of the book for next time