1 91.304 Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications.

Slides:



Advertisements
Similar presentations
Applied Computer Science II Chapter 4: Decidability Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Advertisements

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture5: Context Free Languages Prof. Amos Israeli.
Decidable languages Sipser 4.1 (pages ). CS 311 Mount Holyoke College 2 Hierarchy of languages All languages Turing-recognizable Turing-decidable.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under.
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.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.1: Context-Free Grammars) David Martin With some.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
Foundations of (Theoretical) Computer Science
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.1: DFA’s) David Martin With some modifications.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.3: Non-Context-Free Languages) David Martin With.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.4: Nonregular Languages) David Martin With some.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.2: NFA’s) David Martin With some modifications.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
TM Design Universal TM MA/CSSE 474 Theory of Computation.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.1: Turing Machines) David Martin With some modifications.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CSCI 2670 Introduction to Theory of Computing October 12, 2005.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Foundations of (Theoretical) Computer Science
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.2: The “Halting” Problem) David Martin With modifications.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
CSE 105 theory of computation
BCS 2143 Theory of Computer Science
CSE 105 theory of computation
CSE 2001: Introduction to Theory of Computation Fall 2013
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Intro to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Decidable and undecidable languages
CS21 Decidability and Tractability
Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Theory of Computability
CSE 105 theory of computation
Automata, Grammars and Languages
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications by Prof. Karen Daniels, Fall 2009 This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

2 Back to  1  The fact that  1 is not closed under complement means that there exists some language L that is not recognizable by any TM.  By Church-Turing thesis this means that no imaginable finite computer, even with infinite memory, could recognize this language L!

3 A non- 1 language ALL FIN Each point is a language in this Venn diagram REG RPP CFL CFPP 00 11 L 2 ALL -  1

4 Strategy  Goal: Explore limits of algorithmic solvability.  We’ll show (later in Chapter 4) that there are more (a lot more) languages in ALL than there are in  1 Namely, that  1 is countable but ALL isn’t countable Which implies that  1  ALL Which implies that there exists some L that is not in  1

5 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language Context-Free Languages (see next slide)…

6 Overview of Section 4.1 (cont.)  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Context-Free Languages  Does a given CFG generate a given string?  Is the language of a given CFG empty?  Every CFL is decidable by a Turing machine.

7 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language

8 Decidable Problems for Regular Languages: DFAs  Acceptance problem for DFAs Language includes encodings of all DFAs and strings they accept. Showing language is decidable is same as showing the computational problem is decidable.  Theorem 4.1: A DFA is a decidable language. Proof Idea: Specify a TM M that decides A DFA.  M = “On input, where B is a DFA and w is a string: 1.Simulate B on input w. 2.If simulation ends in accept state, accept. If it ends in nonaccepting state, reject.” Implementation details??

9 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language

10 Decidable Problems for Regular Languages: NFAs  Acceptance problem for NFAs  Theorem 4.2: A NFA is a decidable language. Proof Idea: Specify a TM N that decides A NFA.  N = “On input, where B is an NFA and w is a string: 1.Convert NFA B to equivalent DFA C using Theorem Run TM M from Theorem 4.1 on input. 3.If M accepts, accept. Otherwise, reject.” N uses M as a “subroutine.” Alternatively, could we have modified proof of Theorem 4.1 to accommodate NFAs?

11 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language

12 Decidable Problems for Regular Languages: Regular Expressions  Acceptance problem for Regular Expressions  Theorem 4.3: A REX is a decidable language. Proof Idea: Specify a TM P that decides A REX.  P = “On input, where R is a regular expression and w is a string: 1.Convert regular expression R to equivalent NFA A using Theorem Run TM N from Theorem 4.2 on input. 3.If N accepts, accept. If N rejects, reject.”

13 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language

14 Decidable Problems for Regular Languages: DFAs  Emptiness problem for DFAs  Theorem 4.4: E DFA is a decidable language. Proof Idea: Specify a TM T that decides E DFA.  T = “On input, where A is a DFA: 1.Mark start state of A. 2.Repeat until no new states are marked: 3. Mark any state that has a transition coming into it from any state that is already marked. 4.If no accept state is marked, accept; otherwise, reject.”

15 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Regular Languages  Acceptance problem for DFAs  Acceptance problem for NFAs  Acceptance problem for Regular Expressions  Emptiness testing for DFAs  2 DFAs recognizing the same language

16 Decidable Problems for Regular Languages: DFAs  2 DFAs recognizing the same language  Theorem 4.5: EQ DFA is a decidable language. symmetric difference: emptiness: Source: Sipser Textbook

17 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Context-Free Languages  Does a given CFG generate a given string?  Is the language of a given CFG empty?  Every CFL is decidable by a Turing machine.

18 Decidable Problems for Context- Free Languages: CFGs  Does a given CFG generate a given string?  Theorem 4.7: A CFG is a decidable language. Why is this unproductive: use G to go through all derviations to determine if any yields w ? Better Idea…Proof Idea: Specify a TM S that decides A CFG.  S = “On input, where G is a CFG and w is a string: 1.Convert G to equivalent Chomsky normal form grammar. 2.List all derivations with 2 n -1 steps (why? ), where n = length of w. (Except if n =0, only list derivations with 1 step.) 3.If any of these derivations yield w, accept; otherwise, reject.”

19 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Context-Free Languages  Does a given CFG generate a given string?  Is the language of a given CFG empty?  Every CFL is decidable by a Turing machine.

20 Decidable Problems for Context- Free Languages: CFGs  Is the language of a given CFG empty?  Theorem 4.8: E CFG is a decidable language. Proof Idea: Specify a TM R that decides E CFG.  R = “On input, where G is a CFG: 1.Mark all terminal symbols in G. 2.Repeat until no new variables get marked: 3. Mark any variable A where G has rule A -> U 1, U 2 … U k and each symbol U 1, U 2 … U k has already been marked. 4.If start variable is not marked, accept; otherwise, reject.”

21 Decidable (?) Problems for Context-Free Languages: CFGs  Check if 2 CFGs generate the same language.  Not decidable! (see Chapter 5)  Why is this possible? Why is this problem not in  0 if CFL is in  0 ?

22 Overview of Section 4.1  Decidable Languages (in  0 ): to foster later appreciation of undecidable languages Context-Free Languages  Does a given CFG generate a given string?  Is the language of a given CFG empty?  Every CFL is decidable by a Turing machine.

23 Decidable Problems for Context- Free Languages: CFLs  Every CFL is decidable by a Turing machine.  Theorem 4.9: Every context-free language is decidable.  Let A be a CFL and G be a CFG for A.  Design TM M G that decides A.  M G = “On input w, where w is a string: 1.Run TM S from Theorem 4.7 on input. 2.If S accepts, accept. If S rejects, reject.”

24 Summary: Some problems (languages) related to languages in  0 have been shown in this lecture to be in  0. ALL FIN Each point is a language in this Venn diagram REG RPP CFL CFPP 00 11 Remember that just because a language is in  0 does not mean that every problem (language) related to members of its class is also in  0 !