CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.

Slides:



Advertisements
Similar presentations
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Post Correspondence Problem [Section 5.2] Suppose we have dominos of strings, e.g.: The question: is it possible to arrange the dominos in line (repetitions.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Post's Correspondence Problem Word Problem in semi-Thue Systems
Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the.
February 6, 2015CS21 Lecture 141 CS21 Decidability and Tractability Lecture 14 February 6, 2015.
CS355 – The Mathematics and Theory of Computer Science Reductions.
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.
1 The Post Correspondence Problem continued We will prove that the MPC problem is undecidable 2. We will prove that the PC problem is undecidable.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
Recursively Enumerable and Recursive Languages
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2006Costas Busch - RPI1 The Post Correspondence Problem.
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
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
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.
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
Reducibility 1. 2 Text book Pages 187– 199 Reducibility A reduction is a way of converting one problem to another problem in such a way that a solution.
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.
CS 203: Introduction to Formal Languages and Automata
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Recursively Enumerable and Recursive Languages
CS 154 Formal Languages and Computability February 4 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
Costas Busch - LSU1 The Post Correspondence Problem.
CS 154 Formal Languages and Computability March 8 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability March 17 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability March 15 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 19 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 5 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
Recursively Enumerable and Recursive Languages
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
LIMITS OF ALGORITHMIC COMPUTATION
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Jaya Krishna, M.Tech, Assistant Professor
Decidable Languages Costas Busch - LSU.
The Post Correspondence Problem
Undecidable problems:
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Decidability continued….
Presentation transcript:

CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak The State-Entry Problem  Let M be a Turing machine and q one of its states.  If M is applied to input string w, is it decidable whether or not state q is ever entered?  Reduce the halting problem to this problem. Introduce a new state q new so that a transition leading to a final state q final leads to q new instead.  Knowing whether M enters q new on w is equivalent to knowing whether M halts and accepts w. Which is undecidable. 2

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak An Analogy of Problem Reduction  Suppose the multiplication problem is “undecidable”. The calculator on your smart phone is broken, and the multiply function doesn’t always give the right answer.  What about the addition problem?  Assume we have an algorithm to add y + y and y + y + y.  But y + y is 2×y and y + y + y is 3×y.  An algorithm to solve the addition problem would give us an algorithm to solve the multiplication problem.  But multiplication is “undecidable”, and so the addition algorithm must not exist. We reduced the “undecidable” multiplication problem to the addition problem to prove that the latter is also “undecidable”. 3

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Recall  The family of languages associated with unrestricted grammars is identical to the family of recursively enumerable languages.  There does not exist a membership algorithm for recursively enumerable languages.  Emil Post (Polish-American, ) Proved that in 1936 that there are problems that no algorithm can solve. 4

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak The Post Correspondence Problem  You have a collection of domino tiles.  Each tile has a string at the top and a string at the bottom. All the strings are from the same alphabet.  A match: Line up the tiles so that the concatenation of the top strings matches the concatenation of the bottom strings. Repetitions permitted and not all tiles need to be used. Example: Σ = {a, b, c} 5 a ab b ca a abc c a ab b ca a a ab abc c

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak The Post Correspondence Problem, cont’d  Some collections of tiles cannot be matched. Example: Every top string is longer than every bottom string.  The Post Correspondence Problem (PCP): Determine whether a collection of domino tiles has a match.  There is no algorithm to solve the PCP.  Therefore, the PCP is undecidable. 6 ca a abc ab acc c Why not?

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak The Modified Post Correspondence Problem  To prove that the PCP is undecidable, we first consider the Modified Post Correspondence Problem (MPCP).  The MPCP designates one of the domino tiles as the starting tile that must be first in line.  We will prove that the MPCP is undecidable by reducing a known undecidable problem to it.  We choose the undecidable membership problem for recursively enumerable languages. 7

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the MPCP is Undecidable  Suppose we have an unrestricted grammar G = (V, T, S, P) and a target string w.  We already know that there is no membership algorithm that determines whether any w can be generated by G, i.e., whether  We will reduce the process of deriving a string w that is accepted by grammar G to the modified Post correspondence problem. 8

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the MPCP is Undecidable, cont’d  Construct a collection of domino tiles with their top and bottom strings from the production rules of G and a target string w.  Claim: We can predict that if and only if we can predict these dominoes have a match. 9 TopBottom F F is a symbol not in aa for every ViVi ViVi E E is a symbol not in yiyi xixi for every rule in P starting tile F and E mark the start and end of a derivation.

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the MPCP is Undecidable, cont’d  Example: G has productions Let w = aaac Then the derivation 10 S  aABb | Bbb Bb  C AC  aac TopBottom starting tile Formal Languages and Automata, 5 th ed. Peter Linz Jones & Bartlett, 2012

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the MPCP is Undecidable, cont’d 11 TopBottom Formal Languages and Automata, 5 th ed. Peter Linz Jones & Bartlett, 2012

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the MPCP is Undecidable, cont’d 12 TopBottom  Let G = (V, T, S, P) be any unrestricted grammar and w be any string in T +.  Construct a collection of domino tiles from w and G ’s productions.  Then the domino tiles have a match if and only if. F 1 aABb S a a 2 A A 5 Bb C a a 2 AC aac 13 E 9 Using domino tiles:

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak MPCP algorithm MPCP match No MPCP match Proof that the MPCP is Undecidable, cont’d  Assume the MPCP is decidable:  We’ve constructed an algorithm for the membership problem of unrestricted grammar G.  This is a contradiction, since we know that such an algorithm does not exist.  Therefore, there must not be an algorithm for the MPCP, and so the MPCP is undecidable. 13 Create domino tiles from G and w G, w

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the PCP is Undecidable  To prove that the Post correspondence problem is undecidable, we will reduce the modified Post correspondence problem (which we’ve just proven is undecidable) to it.  We first create a new PCP collection of domino tiles based on the MPCP collection of tiles. 14

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the PCP is Undecidable  Suppose the MPCP dominoes have tiles 1, 2, … n. Tile 1 is the starting tile.  Each PCP tile is a copy of the corresponding MPCP tile with the following changes: Introduce two special symbols, ♮ and §. Into the top string of each tile, we insert the special symbol ♮ after each symbol. Into the bottom string of each tile, we insert the special symbol ♮ before each symbol. Let y and z be the top string and bottom string, respectively, of PCP tile 1. Create a new PCP tile 0 with top string ♮ y and bottom string z. Create a new PCP tile n+1 with top string § and bottom string ♮ §. 15 z ♮y♮y 0 ♮§♮§ § n+1

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the PCP is Undecidable, cont’d  Then any PCP match must have tile 0 at the left end and tile n+1 at the right end.  If we ignore the ♮ and § symbols, a PCP match corresponds to an MPCP match. 16 z ♮y♮y ♮§♮§ § 0 n+1

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak Proof that the PCP is Undecidable, cont’d  Example:  If there is a PCP match, then there is a corresponding MPCP match. 17 i TopBottom i TopBottom 0 ♮0♮1♮♮0♮1♮ ♮0♮1♮1♮0♮1♮1 1 0♮1♮0♮1♮♮0♮1♮1♮0♮1♮1 2 1♮0♮1♮0♮♮0♮0 3 0♮1♮0♮1♮♮1♮1♮1♮1 4 1♮1♮♮0♮0 5§ ♮§♮§ MPCP PCP w = Match sequence 1, 4, 3, 2 w = ♮ 0 ♮ 1 ♮ 1 ♮ 0 ♮ 1 ♮ 1 ♮ 0 ♮ § Match sequence 0, 4, 3, 2, 5

Computer Science Dept. Spring 2016: April 28 CS 154: Formal Languages and Computability © R. Mak MPCP match No MPCP match Proof that the PCP is Undecidable, cont’d  Assume that the Post correspondence problem is decidable.  Then we can construct the following machine:  But this machine decides the modified Post correspondence problem, which we’ve proven is undecidable.  Therefore, there is no algorithm to decide the Post correspondence problem, and the PCP is undecidable. 18 PCP algorithm PCP match No PCP match Create PCP dominoes MPCP dominoes