Automata, Grammars and Languages

Slides:



Advertisements
Similar presentations
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
Advertisements

1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
Reducibility Sipser 5.1 (pages ).
Decidable languages Sipser 4.1 (pages ). CS 311 Mount Holyoke College 2 Hierarchy of languages All languages Turing-recognizable Turing-decidable.
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.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Linear Bounded Automata LBAs
Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 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.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
1 Recursively Enumerable and Recursive Languages.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
The Acceptance Problem for TMs
Recursively Enumerable Languages
Recursively Enumerable and Recursive Languages
Automata, Grammars and Languages
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
Automata, Grammars and Languages
PDAs Accept Context-Free Languages
BCS 2143 Theory of Computer Science
CSE 2001: Introduction to Theory of Computation Fall 2013
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Intro to Theory of Computation
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 8: Undecidability, Mapping Reductions
CSCI 2670 Introduction to Theory of Computing
Decidable Languages Costas Busch - LSU.
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Decidable and undecidable languages
Undecidable problems:
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
Theory of Computability
Instructor: Aaron Roth
Theory of Computability
Instructor: Aaron Roth
Instructor: Aaron Roth
CSE 105 theory of computation
More Undecidable Problems
Intro to Theory of Computation
Presentation transcript:

Automata, Grammars and Languages CSC 473 Automata, Grammars & Languages 6/3/2019 Automata, Grammars and Languages Discourse 06 Decidability and Undecidability x C SC 473 Automata, Grammars & Languages

Decidable Problems for Regular Languages Theorem 4.1: (Membership/Acceptance Prob. for DFAs) is a decidable language. Pf: A decider for the language is: M = “On input <A,w>: Simulate A on w. If the simulation reaches an accept state, halt and accept. If it ends (jams) in a non-accept state, halt and reject.”  C SC 473 Automata, Grammars & Languages

Decidable—Regular Lang.s (cont’d) Theorem 4.2: (Membership/Acceptance Prob. for NFAs) is a decidable language. Pf: A decider for the language is: M = “On input <N,w>: Use the Rabin-Scott algorithm to convert N to DFA A Run the Theorem 4.1 algorithm with input <A,w>.” If that algorithm accepts, then accept; otherwise reject.”  C SC 473 Automata, Grammars & Languages

Decidable—Regular Lang.s (cont’d) Theorem 4.3: (Membership Prob. for RegEx’s) is a decidable language. Pf: Use the algorithm to convert R to an equivalent NFA N and use the algorithm of Theorem 4.2 with input <N,w>  C SC 473 Automata, Grammars & Languages

Decidable—Regular Lang.s (cont’d) Theorem 4.4: (Emptiness Problem for DFAs) is a decidable language. Pf: A decider for the language is: T = “On input <A>: repeat { } until ( ) if accept; otherwise reject.”  C SC 473 Automata, Grammars & Languages

Decidable—Regular Lang.s (cont’d) Theorem 4.5: (Equivalence Problem for DFAs) is a decidable language. Pf: Observe that Because of closure properties, there is an algorithm to construct a DFA C from A, B that accepts Use Theorem 4.4 with <C> to test whether If that algorithm accepts, then accept; otherwise, reject.  C SC 473 Automata, Grammars & Languages

Decidable Problems for CFLs Theorem 4.7: (Membership/Acceptance Prob. for CFGs) is a decidable language. Pf: Chomsky Normal Form parse trees look like: A a Pure Binary Tree w/ n leaves has n-1 internal nodes. Add n terminating rules for a parse tree. C SC 473 Automata, Grammars & Languages

Decidable Problems—CFLs (cont’d) S = “On input <G,w>: Convert G to CNF If |w|>0 try all derivations with 2|w|-1 steps. If |w|=0 try the 1-step derivation If any derivation generates w, accept; else reject.”  Corollary (Text Theorem 4.9). Every CFL is a decidable language. Pf: Let A be a CFL. We want a decider for it. Let G be a CFG generating A. On input w, run the TM S above on <G,w> to accept or reject w.  C SC 473 Automata, Grammars & Languages

Decidable—CFLs (cont’d) Theorem 4.8: (Emptiness Problem for CFGs) is a decidable language. Pf: A variable in a CFG is productive (or co-reachable) iff So iff the start variable is productive. See Homework 4, Problem 2 for an algorithm to decide whether a variable is productive.  All above problems also decidable for PDAs: just convert to CFGs. What about the Equivalence Problem for CFGs? We will show (later) that this problem is UNdecidable. C SC 473 Automata, Grammars & Languages

The Halting Problem Although the following language is TM-recognizable, we will show it is not decidable. This is called the Membership Problem for TMs, and by some authors the Halting Problem for TMs: given a TM M and string w, does M accept w? Why called “Halting Problem”? Given a TM M, can always alter it to an equivalent TM M such that: M halts on w iff M accepts w (iff M accepts w). Pf: For each undefined transition (q,a) in M, M will transition to a state and loop forever; also goes to the same loop state  Thus acceptance can be made synonymous with halting C SC 473 Automata, Grammars & Languages

The Halting Problem (cont’d) Thm: is Turing-recognizable. Pf: Let U be a UTM. A recognizer for is: yes yes no no C SC 473 Automata, Grammars & Languages

The Halting Problem (cont’d) Thm: is undecidable. Pf: Proof by contradiction. Assume that is decidable. Then it has a decider; call it H. H behaves as follows: Construct a TM D that calls H as a subroutine. On input M, D runs H on M,M. That is, D determines if M accepts or rejects its own description as input. If M accepts M, then D rejects; If M rejects M, then D accepts. Here is the picture of how D behaves: accept { if M accepts w } reject { if M does not accept w } C SC 473 Automata, Grammars & Languages

The Halting Problem (cont’d) What happens if we run D on its own description D? Set M = D in the above. Then This contradiction shows that decider H cannot exist.  accept { if M accepts M } accept { if M does not accept M } reject reject { if M does not accept M } { if M accepts M } C SC 473 Automata, Grammars & Languages

“Diagonalization”—Why called? D computes the opposite of the diagonal entries TMs  Encodings C SC 473 Automata, Grammars & Languages

Decidable vs Recognizable Sets: Basics Theorem: decidable decidable Proof: If L is decidable, it has a decider M. The decider halts for every input in either the accepting halt state or in the rejecting halt state . Construct from M as follows: make the accepting halt state the rejecting state and the rejecting halt state the accepting state. Then that is,  C SC 473 Automata, Grammars & Languages

Decidable vs Recognizable: Basics (Cont.) Theorem 4.22: is decidable iff both are Turing-recognizable. Proof: () Previous theorem. () Suppose both are recognizable. Let be recognizers for . Construct M* to simulate alternate steps in each recognizer: Given w it is eventually accepted by one or the other, so must halt and either accept or reject; it is a decider.  accept accept w switch accept reject C SC 473 Automata, Grammars & Languages

A Non-TM-Recognizable Set Corollary 4.23: (the complement of ) is not Turing-recognizable. Pf: By contradiction. We know that is Turing-recognizable. Suppose is Turing-recognizable. By Theorem 4.22, it follows that is decidable. Since we know that is not decidable by Theorem 4.11, this contradiction establishes the result.  Note: What does look like? where , which are all the “junk” strings that cannot be of the form  Coded machine, coded input . Note that J is a regular language. C SC 473 Automata, Grammars & Languages