Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY

Slides:



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

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.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
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)
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
1 Decidability Turing Machines Coded as Binary Strings Diagonalizing over Turing Machines Problems as Languages Undecidable Problems.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 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.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
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.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Universal Turing Machine
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
The Acceptance Problem for TMs
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
CIS Automata and Formal Languages – Pei Wang
This statement is false.
CSCI 2670 Introduction to Theory of Computing
Linear Bounded Automata LBAs
CSE 311 Foundations of Computing I
FORMAL LANGUAGES AND AUTOMATA THEORY
CSCI 2670 Introduction to Theory of Computing
Turing Machines.
BCS 2143 Theory of Computer Science
LIMITS OF ALGORITHMIC COMPUTATION
Turing Machines Acceptors; Enumerators
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Jaya Krishna, M.Tech, Assistant Professor
More Undecidable Problems
Decidable Languages Costas Busch - LSU.
Decidability Turing Machines Coded as Binary Strings
Decidability and Undecidability
Decidability Turing Machines Coded as Binary Strings
The Post Correspondence Problem
Chapter 9 Undecidability
Reducability Sipser, pages
MA/CSSE 474 Theory of Computation
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
CS21 Decidability and Tractability
Instructor: Aaron Roth
Decidability continued….
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Instructor: Aaron Roth
Automata, Grammars and Languages
Post’s Correspondence Problem
More Undecidable Problems
Turing Machines Everything is an Integer
MA/CSSE 474 Theory of Computation
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY Subject Code: 10CS56 Prepared By:Mrs.Pramela Devi,Mrs.Annapoorani,Mrs.Madhusmitha Department:CSE Date:25.09.2014 5/5/2019

UNIT 8 : Undecidability A language that is not recursively enumerable An undecidable problem that is RE Post’s Correspondence problem Other undecidable problems 5/5/2019

1. A language that is not recursively enumerable Any TM for a Recursive language is going to look like this: Any TM for a Recursively Enumerable (RE) language is going to look like this M “accept” w “reject” “accept” M w 5/5/2019

1.1 Binary-Strings from TM’s We shall restrict ourselves to TM’s with input alphabet {0, 1}. Assign positive integers to the three classes of elements involved in moves: States: q1(start state), q2 (final state), q3, … Symbols X1 (0), X2 (1), X3 (blank), X4, … Directions D1 (L) and D2 (R). Suppose δ(qi, Xj) = (qk, Xl, Dm). Represent this rule by string 0i10j10k10l10m. Key point: since integers i, j, … are all > 0, there cannot be two consecutive 1’s in these strings. 5/5/2019

1.2 Enumerating TM’s and Binary Strings Recall we can convert binary strings to integers by prepending a 1 and treating the resulting string as a base-2 integer. Thus, it makes sense to talk about “the i-th binary string” and about “the i-th Turing machine.” Note: if i makes no sense as a TM, assume the i-th TM accepts nothing. 5/5/2019

1.3 Table of Acceptance 1 2 3 4 5 6 . . . 1 2 TM 3 i 4 5 6 x . String j 1 2 3 4 5 6 . TM i 1 2 3 4 5 6 . . . x x = 0 means the i-th TM does not accept the j-th string; 1 means it does. 5/5/2019

1.4 Diagonalization Argument Whenever we have a table like the one on the previous slide, we can diagonalizable it. That is, construct a sequence D by complementing each bit along the major diagonal. Formally, D = a1a2…, where ai = 0 if the (i, i) table entry is 1, and vice-versa Could D be a row (representing the language accepted by a TM) of the table? Suppose it were the j-th row. But D disagrees with the j-th row at the j-th column. Thus D is not a row. Consider the diagonalization language Ld = {w | w is the i-th string, and the i-th TM does not accept w}. We have shown that Ld is not a recursively enumerable language; i.e., it has no TM. 5/5/2019

1.5 A Problem About Turing Machines We can think of the language Ld as a problem. “Does this TM not accept its own code?” Aside: We could also think of it as a problem about binary strings. Do you see how to phrase it? A problem is decidable if there is an algorithm to answer it. Recall: An “algorithm,” formally, is a TM that halts on all inputs, accepted or not. Put another way, “decidable problem” = “recursive language.” Otherwise, the problem is undecidable 5/5/2019

1.6 Relationship between languages Decidable problems = Recursive languages Recursively enumerable Not recursively Ld 5/5/2019

2. An undecidable problem that is RE Complements of Recursive Languages Theorem: If L is a recursive language, L is also recursive. Proof: Let M be a TM for L that always halt. We can construct another TM M from M for L that always halts as follows: M Accept Accept M Reject Input Reject 5/5/2019

2.1 Complements of RE Languages Theorem: If both a language L and its complement L are RE, L is recursive. Proof: Let M1 and M2 be TM for L and L respectively. We can construct a TM M from M1 and M2 for L that always halt as follows: M M1 Accept Accept Input M2 Accept Reject 5/5/2019

2.2 From the Abstract to the Real While the fact that Ld is undecidable is interesting intellectually, it doesn’t impact the real world directly. We first shall develop some TM-related problems that are undecidable, but our goal is to use the theory to show some real problems are undecidable Can a particular line of code in a program ever be executed? Is a given context-free grammar ambiguous? Do two given CFG’s generate the same language? 5/5/2019

2.3 The Universal Language An example of a recursively enumerable, but not recursive language is the language Lu of a universal Turing machine.That is, the UTM takes as input the code for some TM M and some binary string w and accepts if and only if M accepts w. Inputs are of the form. Code for M 111 w Note: A valid TM code never has 111, so we can split M from w. The UTM must accept its input if and only if M is a valid TM code and that TM accepts w. The UTM will have several tapes. Tape 1 holds the input M111w Tape 2 holds the tape of M. Mark the current head position of M. Tape 3 holds the state of M. Step 1: The UTM checks that M is a valid code for a TM. E.g., all moves have five components, no two moves have the same state/symbol as first two components. If M is not valid, its language is empty, so the UTM immediately halts without accepting. Step 2: The UTM examines M to see how many of its own tape squares it needs to represent one symbol of M. Step 3: Initialize Tape 2 to represent the tape of M with input w, and initialize Tape 3 to hold the start state. Step 4: Simulate M. Look for a move on Tape 1 that matches the state on Tape 3 and the tape symbol under the head on Tape 2. If found, change the symbol and move the head marker on Tape 2 and change the State on Tape 3. If M accepts, the UTM also accepts. 5/5/2019

2.4 Lu is Recursively Enumerable, but not Recursive We designed a TM for Lu, so it is surely RE. Suppose it were recursive; that is, we could design a UTM U that always halted. Then we could also design an algorithm for Ld, as follows. Given input w, we can decide if it is in Ld by the following steps. Check that w is a valid TM code. If not, then its language is empty, so w is in Ld. If valid, use the hypothetical algorithm to decide whether w111w is in Lu. If so, then w is not in Ld; else it is. But we already know there is no algorithm for Ld. Thus, our assumption that there was an algorithm for Lu is wrong. Lu is RE, but not recursive. 5/5/2019

2.5 Undecidability of PCP To show that MPCP is undecidable, we will reduce the universal language problem (ULP) to MPCP: If MPCP can be solved, ULP can also be solved. Since we have already shown that ULP is un-decidable, MPCP must also be undecidable. Universal Language Problem (ULP) MPCP 5/5/2019

2.6 CFG’s from PCP We are going to prove that the ambiguity problem (is a given CFG ambiguous?) is undecidable. As with PCP instances, CFG instances must be coded to have a finite alphabet. Let a followed by a binary integer i represent the i-th terminal. Let A followed by a binary integer i represent the i-th variable. Let A1 be the start symbol. Symbols ->, comma, and ε represent themselves. Example: S -> 0S1 | A, A -> c is represented by A1->a1A1a10,A1->A10,A10->a11 Consider a PCP instance with k pairs. i-th pair is (wi, xi). Assume index symbols a1,…, ak are not in the alphabet of the PCP instance. The list language for w1,…, wk has a CFG with productions A -> wiAai and A -> wiai for all i = 1, 2,…, k. 5/5/2019

2.7 Reduction of PCP to the Ambiguity Problem Given a PCP instance, construct grammars for the two list languages, with variables A and B. Add productions S -> A | B. The resulting grammar is ambiguous if and only if there is a solution to the PCP instance. If the two derivations begin with the same first step, say S -> A, then the sequence of index symbols uniquely determines which productions are used. Each except the last would be the one with A in the middle and that index symbol at the end. The last is the same, but no A in the middle. 5/5/2019

Example: S =>A=>*…2321 w1 A 2 w2 3 w3 5/5/2019