Jaya Krishna, M.Tech, Assistant Professor

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Reducibility 2 Theorem 5.1 HALT TM is undecidable.
1 Introduction to Computability Theory Lecture12: Decidable 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.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
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.
Foundations of (Theoretical) Computer Science Chapter 4 Lecture Notes (Section 4.1: Decidable Languages) David Martin With modifications.
PZ03A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03A - Pushdown automata Programming Language Design.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Decidable languages Section 4.1 CSC 4170 Theory of Computation.
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.
 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.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
PZ03A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03A - Pushdown automata Programming Language Design.
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.
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.
1 Introduction to Turing Machines
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
Formal Languages, Automata and Models of Computation
Non Deterministic Automata
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Reductions Costas Busch - LSU.
Turing Machines.
Context Sensitive Languages and Linear Bounded Automata
Intro to Theory of Computation
PDAs Accept Context-Free Languages
Chapter 7 PUSHDOWN AUTOMATA.
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
PZ03A - Pushdown automata
CSCI 2670 Introduction to Theory of Computing
Jaya Krishna, M.Tech, Assistant Professor
CSE322 The Chomsky Hierarchy
Jaya Krishna, M.Tech, Assistant Professor
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
Automata and Formal Languages (Final Review)
Non Deterministic Automata
CSC 4170 Theory of Computation Decidable languages Section 4.1.
Decidable and undecidable languages
CSCI 2670 Introduction to Theory of Computing
Reducability Sipser, pages
CSCI 2670 Introduction to Theory of Computing
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
… NPDAs continued.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Theory of Computability
Automata, Grammars and Languages
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
The Chomsky Hierarchy Costas Busch - LSU.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Presentation transcript:

Jaya Krishna, M.Tech, Assistant Professor UNIT-VIII 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

CONTEXT SENSITIVE LANGUAGE Context Sensitive Grammar G = (N, Σ P, S) where: N Set of non terminal symbols Σ  Set of terminal symbols S  Start symbol of the production P  Finite set of Productions P are of the form αAβ  αϒβ Where α, β, ϒ Є (N U Σ)+ and ϒ  non empty 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

CONTEXT SENSITIVE LANGUAGE In addition S  ε provided does not appear on the right hand side of any rule language generated by the context sensitive grammar ? CSL 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

COMPUTATIONAL PROPERTIES CSL ≡ with linear bounded nondeterministic TM a tape of only kn cells Constant associated with machine Size of input 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor LBA model of LBA is important because set of CSL is accepted by the model infinite storage is restricted in size but not in accessibility to the storage Called as LBA because a linear function is used in restrict (to bound) the length of the tape LBA Nondeterministic TM with single tape of finite length bounded by a linear function of the length of i/p string 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor LBA LBA M = (Q, Σ, Γ, δ, q0, b, ₵, $, F) Q  finite set of states ∑  finite set of input symbols Γ  complete set of tape symbols δ  transition function q0  initial state b  blank ₵  left end marker $  right end marker F  set of final states / accepting states 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor Model of LBA 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor Model of LBA Two tapes i/p tape head never prints and never moves left Working tape head can modify the contents in any way without restriction 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Instantaneous Description In LBA ID  (q, w, k) q Є Q w Є Γ k is integer between 1 to n transition of ID’s is similar except that k changes k-1  R/W head moves left k+1  R/W head moves right 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor Language language accepted by the LBA is defined as the set {w Є (Σ – {₵, $})* | (q0, ₵w$, 1) (q, α, i) for some q Є F and for some integer i between 1 & n} 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor LR (0) Grammar A grammar is said to be LR grammar, it is sufficient that a left-to-right shift-reduce parser be able to recognize the handles of right-sentential forms when they appear on top of stack. L stands for Left-to-right R stands for Right most derivation 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor LR(0) Grammar To understand shift reduce parsing let us consider the construction of the string id* id for grammar “EE+T | T, TT*F | F, F (E) | id” 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABILITY PROBLEMS We begin with certain computational problems concerning finite automata we give algorithms for testing whether a finite automaton accepts a string language of a finite automaton is empty whether two finite automata are equivalent For example the acceptance problem for DFA’s of testing whether a particular DFA accepts a given string can be expressed as a language, ADFA. Let ADFA = {<B, w>| B is a DFA that accepts input string w} 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABILITY PROBLEMS DECIDABLE PROBLEMS CONCERNING REGULAR LANGUAGES DECIDABLE PROBLEMS CONCERNING CONTEXT-FREE LANGUAGES 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABLE PROBLEMS CONCERNING REGULAR LANGUAGES Theorem 6.1: ADFA is a decidable language. Proof Idea: We need to present a TM M that decides ADFA. M = “On input <B, w>, where B is a DFA and w is a string: Simulate B on input w. If the simulation ends in an accept state, accept. If it ends in a nonaccepting state, reject.” 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABLE PROBLEMS CONCERNING REGULAR LANGUAGES Theorem 6.2: ANFA is a decidable language. We present a TM N that decides ANFA. N = “On input <B, w> where B is an NFA, and w is a string: Convert NFA B to an equivalent DFA C. Run TM M from theorem 6.1 on input <C, w>. If M accepts, accept; otherwise, reject.” Running TM M in stage 2 means incorporating M into the design of N as a sub procedure. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABLE PROBLEMS CONCERNING REGULAR LANGUAGES Similarly we can determine whether a regular expression generates a given string. Let AREX = {<R, w>| R is a regular expression that generates string w}. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABLE PROBLEMS CONCERNING REGULAR LANGUAGES Theorem 6.3: AREX is a decidable language. Proof: The following TM P decides AREX. P = ”On input <R, w> where R is a regular expression and w is a string: Convert regular expression R to an equivalent NFA A. Run TM N on input <A, w>. If N accepts, accept; if N rejects, reject.” 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

DECIDABLE PROBLEMS CONCERNING CONTEXT-FREE LANGUAGES Theorem: ACFG is a decidable language. Proof: The TM S for ACFG follows. S = “On input <G, w>, where G is a CFG and w is a string: Convert G to an equivalent grammar in Chomsky normal form. List all derivations with 2n–1 steps, where n is the length of w, except if n = 0, then instead list all derivations with 1 step. If any of these derivations generate w, accept; if not reject” 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

UNIVERSAL TURING MACHINE Theorem: ATM is undecidable. Proof: Before we get to the proof, let’s first observe that ATM is Turing-recognizable. The following Turing machine U recognizes ATM. U = “On input <M, w>, where M is a TM and w is a string: Simulate M on input w. If M ever enters it’s accept state, accept; if M ever enters its reject state, reject.” 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

UNIVERSAL TURING MACHINE machine is called universal because it is capable of simulating any other Turing machine from the description of that machine. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

POST CORRESPONDENCE PROBLEM we show phenomenon of undecidability is not confined to problems concerning automata. an example of an undecidable problem concerning simple manipulations of strings PCP describe this problem easily as a type of puzzle 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

POST CORRESPONDENCE PROBLEM We begin with a collection of dominos(pack) each containing two strings, one on each side Individual domino looks like a collection of dominos looks like 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

POST CORRESPONDENCE PROBLEM What’s the task is? make a list of these dominos (repetitions permitted) string we get by reading off the symbols on the top is the same as the string of symbols on the bottom. Called match for e.g. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

POST CORRESPONDENCE PROBLEM Reading of the top string we get abcaaabc, which is the same as reading off the bottom For some collections of dominos finding a match may not be possible. E.g. PCP is to determine whether a collection of dominos has a match. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor TURING REDUCIBILITY Reduction way of converting one problem to another problem such a way that a solution to the second problem can be used to solve the first problem. Definition An oracle for a language B is an external device that is capable of reporting whether any string w is a member of B 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor Definition of P class of languages that are decidable in polynomial time on a deterministic single-tape Turing machine. In other words 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor Definition of NP class of languages that have polynomial time verifiers. P versus NP: major unsolved problem in computer science the class of languages for which membership can be decided quickly NP = the class of languages for which membership can be verified quickly 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor NP-COMPLETENESS If a polynomial time algorithm exists for any of these problems all problems in NP would be polynomial time solvable. called NP-complete. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor

Jaya Krishna, M.Tech, Assistant Professor NP-HARD NP-hard is called as non-deterministic polynomial-time hard. A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H (i.e., L ≤ TH). Informally can think of an algorithm that can call such an oracle machine as a subroutine for solving H, and solves L in polynomial time If that call takes only one step to compute. NP-hard problems may be of any type: decision problems, search problems, or optimization problems. 11/21/2018 Jaya Krishna, M.Tech, Assistant Professor