Presentation is loading. Please wait.

Presentation is loading. Please wait.

FORMAL LANGUAGES AND AUTOMATA THEORY

Similar presentations


Presentation on theme: "FORMAL LANGUAGES AND AUTOMATA THEORY"— Presentation transcript:

1 FORMAL LANGUAGES AND AUTOMATA THEORY
C K Nagpal M.Tech. Ph.D. Associate Professor Computer Engg. YMCA University of Science & Technology

2 Chapter 8 THE PITFALL OF ALGORITHMIC COMPUTING: UNDECIDABILITY
In these slides, we will cover the following topics: • What a decision problem is • Recursive and recursively enumerable languages Coding the Turing Machine Decision Problems Related to Turing machines Reduction (P1 ≤ P2) Rice’s Theorem • Decision problem relating to context-free grammars • Post correspondence problem Constructing CFG Using PCP PCP Unsolvability

3 Recursive & Recursively Enumerable Languages
Recursive Language L :- TM halts for every string w over ∑*. Stops to say yes if w belongs to L and stops to say no if w does not belong to L. (Turing decidable language) Recursively Enumerable Language L : TM halts for every string w belonging to L and stopping is not sure for if w does not belong to L. ( Turing acceptable language)

4 Recursive & Recursively Enumerable Languages (Contd.)
Languages which are neither recursive nor RE RE languages which are not recursive Recursive languages Universe of languages

5 Some Conclusions (Theorems 8.1-8.7)
If a language L is recursive then its complement L’ is also recursive. If two languages L1 and L2 are recursive their union L1 U L2 is also recursive. If two languages L1 and L2 are recursive their intersection L1 ∩ L2 is also recursive. If a language L and its complement L’ are both recursively enumerable then L is recursive. Let L1, L2, L3,……, Ln be the set of recursively enumerable languages over ∑ such that they form partition set over ∑*. Then each of language L1, L2, L3,……, Ln is recursive. If two languages L1 and L2 are recursive enumerable then their union L1 U L2 is also recursive enumerable. If two languages L1 and L2 are recursive enumerable then their intersection L1 ∩ L2 is also recursive enumerable.

6 Coding the Turing Machine
A Turing machine can be coded in the form binary string Lv : Set of all binary strings which form the valid code for a TM Le = {M | M is the code of Turing machine and L(M) = ϕ} Lne = {M | M is the code of Turing machine and L(M) ≠ ϕ} Ld = {M | M is a Turing machine and M belongs to L(M)} Lnd = {M | M is a Turing machine and M does not belong to L(M)} Conclusions ( Theorem ) The language Lv is recursive The language Lnd is not recursively enumerable The language Ld is not recursive

7 Decision Problems Related to Turing machines
Lu : Language of Universal Turing Machine Lu = {x | x = (M, w) and w ϵ L(M)} Theorem The language Lu is recursively enumerable but not recursive Given a Turing machine M and a string w, the problem ‘Does M accepts w?’ is undecidable

8 Reduction (P1 ≤ P2) The language Lne is not recursive
Process of converting the instances of a problem P1 to the corresponding instances of a problem P2 such that they have the same answer, thereby solving the problem P2 through the problem P1. The symbol for reduction is ≤. If the problem P1 reduces to P2, then it is denoted as P1 ≤ P2. Theorems based upon reduction ( Theorem ) The halting problem of a Turing machine is undecidable The language Lne is recursively enumerable The language Lne is not recursive The language Le is not recursively enumerable ( Rice’s theorem) Every non-trivial property of a recursively enumerable language is undecidable.

9 Rice’s Theorem (Implications)
Undecidable Problems Given a Turing machine M, does L(M) contain any string? 2. Given a Turing machine M, does L(M) contain at least two strings? 3. Given a Turing machine M, is L(M) finite? 4. Given a Turing machine M, is L(M) = Σ* ? 5. Given a Turing machine M, is L(M) a context-free language? 6. Given a Turing machine M, is L(M) a regular language?

10 Decision Problems Related to CFG
Theorem Given a string x and a CFG G = (V, Σ, P, S), the problem ‘does x ϵ L(G )?’ is decidable. Given a CFG G = (V, Σ, P, S), the problem ‘Is L(G) = ϕ?’ is decidable. Given a CFG G = (V, Σ, P, S), the problem ‘Is L(G) finite?’ is decidable.

11 Post Correspondence Problem (PCP)
The Post Correspondence Problem is unsolvable, there is no algorithm to check if a given instance of the PCP has a solution.

12 Constructing CFG Using PCP

13 PCP Unsolvability ( Implications)
Theorems Given two CFGs Gx and Gy, the problem ‘Is L(Gx) ∩L(Gy) ≠ϕ?’ is undecidable. Given a CFG G, the problem ‘Is G ambiguous?’ is undecidable. Given two CFGs Gx and Gy, the problem ‘Is L(Gx) = L(Gy)?’ is undecidable. Given two CFGs Gx and Gy, the problem ‘Is L(Gx) a subset of L(Gy)?’ is undecidable.


Download ppt "FORMAL LANGUAGES AND AUTOMATA THEORY"

Similar presentations


Ads by Google