P3ch3 - Formal Language and Automata Theory Part III Turing...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Transparency No. P3C3-1 Formal Language and Automata Theory Part III Turing Machines and Effective Computability
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Transparency No. P3C3-1 Formal Language and Automata Theory PART III Chapter 3 Undecidable Problems
Background image of page 2
Undecidable problems about CFLs Transparency No. P3C3-3 The Halting Problem L : any of your favorite programming languages (C, C++, Java, BASIC, TuringLang, etc. ) Problem: Can you write an L-program HALT(P,X), which takes another L-program P(-) and string X as input, and HALT(P,X) return true if P(X) halt and return false if P(X) does not halt. The problem of ,given an (L-)program P and a data X,determining if P will halt on input X is called the halting problem [for L] . Use simple diagonalization principle , we can show that the halting problem is undecidable (or unsolvable )[i.e., the program HALT(P,X) does not exist!!]
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Undecidable problems about CFLs Transparency No. P3C3-4 Halt(P,X) does not exist Ideas leading to the proof: Problem1 : What about the truth value of the sentence: L: L is false Problem 2 : Let S = {X | X X}. Then does S belong to S or not ? The analysis: S S => S S; S S => S S. Problem 3 : 矛矛矛 : 1. 矛矛矛矛矛矛矛矛 2. 矛矛矛矛矛矛矛矛矛 矛矛矛矛矛 : 1. 2. 矛矛矛矛矛矛矛 Problem 4 : 矛矛矛矛 : 矛矛矛矛矛矛矛矛矛 => 矛矛矛矛矛矛矛矛矛矛矛矛 => 矛矛矛矛矛矛矛矛矛矛矛矛矛 => 矛矛矛矛矛矛矛矛 . 矛矛矛矛 : 矛矛矛矛矛矛矛矛 Conclusion: 1. S is not a set!! 2. If a language is too powerful, it may produce expressions that is meaningless or can not be realized. Question: If HALT(P,X) can be programmed, will it incur any absurd result like the case of S? Ans: yes!!
Background image of page 4
Undecidable problems about CFLs Transparency No. P3C3-5 The proof Assume HALT(P,X) does exist (i.e, can be programmed). Now construct a new program Diag() with HALT() as a subroutine as follows: Diag(P) L 1 : if HALT(P,P) then goto L 1 ; L 2 : end. Properties of Diag(): 1. Diag(P) halts iff HALT(P,P) returns false. 2. Hence if P is a program ==> Diag(P) halts iff HALT(P,P) returns false iff P does not halt on P (i.e., P(P) does not halt). The absurd result: Will Diag() halt on input ‘Diag’ ? Diag(Diag) halts <=> Diag does not halt on input Diag. (by (2)) a contradiction!! Hence both Diag and HALT are not programmable
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Undecidable problems about CFLs Transparency No. P3C3-6 Analysis of diag(p) and HALT(p,p) p 1 p 2 p 3 p k diag p 1 0 p 2 1 p 3 1 …. p k 1 diag 1 0 0 0 x ~x 0 1 1. Let p 1 ,p 2 ,… be the set of all programs accepting one string input. 2. cell(m,n) = 1/0 means m(n) halts/does not halt. 3. The diagonal row corresponds to the predicate “p(p) halts”.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2009 for the course CSC cscc73 taught by Professor Unknown during the Spring '09 term at University of Toronto- Toronto.

Page1 / 41

P3ch3 - Formal Language and Automata Theory Part III Turing...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online