DETERMINISTIC CONTEXT FREE LANGUAGES

Slides:



Advertisements
Similar presentations
Context-Free and Noncontext-Free Languages
Advertisements

Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
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,
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
LR-Grammars LR(0), LR(1), and LR(K).
Pushdown Automata Part II: PDAs and CFG Chapter 12.
CS21 Decidability and Tractability
Introduction to Computability Theory
Applied Computer Science II Chapter 2 : Context-free languages Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 11, 2006.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
Transparency No. P2C1-1 Formal Language and Automata Theory Part II Pushdown Automata and Context-Free Languages.
Fall 2006Costas Busch - RPI1 The Chomsky Hierarchy.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
1 A Non Context-Free Language (We will prove it at the next class)
CS 3240: Languages and Computation Pushdown Automata & CF Grammars NOTE: THESE ARE ONLY PARTIAL SLIDES RELATED TO WEEKS 9 AND 10. PLEASE REFER TO THE TEXTBOOK.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2010.
Pushdown Automata (PDA) Part 2 While I am distributing graded exams: Design a PDA to accept L = { a m b n : m  n; m, n > 0} MA/CSSE 474 Theory of Computation.
Pushdown Automata (PDA) Intro
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Cs3102: Theory of Computation Class 6: Pushdown Automata Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint manual.
Pushdown Automata Part I: PDAs Chapter Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2)
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
Context-Free and Noncontext-Free Languages Chapter 13 1.
Pushdown Accepters & Context-Free Grammars Sipser, Theorem 2.12 Denning, Chapter 8.
Chapter 7 Pushdown Automata
PushDown Automata. What is a stack? A stack is a Last In First Out data structure where I only have access to the last element inserted in the stack.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Context-Free and Noncontext-Free Languages Chapter 13.
Pumping Lemma for CFLs. Theorem 7.17: Let G be a CFG in CNF and w a string in L(G). Suppose we have a parse tree for w. If the length of the longest path.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
CFL Big Picture. Context Free Languages Conclusion We have studied the class of context free languages (CFL) We saw two different ways to express a CFL.
Context Free Languages and Pushdown Automata. اثبات مستقل از متن بودن یک زبان ( PDA ) Prove that the class of Context-Free Languages is closed under MissingMiddle,
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
1.Draw a parse tree for the following derivation: S  C A C  C A b b  b b A b b  b b B b b  b b a A a a b b  b b a b a a b b 2. Show on your parse.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
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,
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Pushdown Automata - like NFA-  but also has a stack - transition takes the current state, the current input symbol, and the top-of-the-stack symbol (which.
Context-Free and Noncontext-Free Languages Chapter 13.
Lecture # 21.
Formal Languages, Automata and Models of Computation
CSE 105 theory of computation
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
CSE 105 theory of computation
Pushdown Automata PDAs
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Pushdown Automata PDAs
CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n }
Push-down Automata.
CSE322 The Chomsky Hierarchy
MA/CSSE 474 Theory of Computation
CSE 105 theory of computation
Pushdown automata The Chinese University of Hong Kong Fall 2011
MA/CSSE 474 Theory of Computation
CSE 105 theory of computation
The Chomsky Hierarchy Costas Busch - LSU.
Normal Forms for Context-free Grammars
CFL Big Picture.
CSE 105 theory of computation
Presentation transcript:

DETERMINISTIC CONTEXT FREE LANGUAGES Ethakota Krishnamurthi Surendranath Manoj Gujjari

What is a CFL(Context Free Language)? Deterministic Context Free Language Description Properties Importance

CONTEXT FREE LANGUAGES A context-free language (CFL) is a language generated by some context-free grammar (CFG). Different CF grammars can generate the same CF language, or conversely, a given CF language can be generated by different CF grammars. The class of context-free languages generalizes the class of regular languages, i.e., every regular language is a context-free language. The reverse of this is not true, i.e., every context-free language is not necessarily regular.

DCFL Deterministic context-free languages are a proper subset of context-free languages. Context free languages that can be accepted by Deterministic Push-Down Automata. DCFLs are always unambiguous. Many programming languages can be described by means of DCFLs.

DCFL Description Consider $: end of string marker Consider an example: Let L = a*  {anbn : n > 0}. When it begins reading a’s, M must push them onto the stack. In case there are going to be b’s it runs out of input without seeing b’s, it needs a way to pop the a’s from the stack before it can accept. The end-of-string marker allows the popping to happen, when all the input has been read. Add $ to make it easier to build DPDAs, it does not add power (to allow building a PDA for L that was not context-free) There exist CLFs that are not deterministic, e.g., L = {aibjck, i  j or j  k}.

A DETERMINISTIC PDA FOR L L = a*  {anbn : n > 0}.

A NDPDA FOR L( No end-marker) L = a*  {anbn : n > 0}.

Properties of DCFL DCFLS are not closed under union. DCFLS are not closed under intersection. DCFLS are closed under complement.

DCFLS are not closed under UNION L1 = {aibjck, i, j, k  0 and i  j}. (a DCFL) L2 = {aibjck, i, j, k  0 and j  k}. (a DCFL) L = L1  L2. = {aibjck, i, j, k  0 and (i  j) or (j  k)}. L = L. = {aibjck, i, j, k  0 and i = j = k}  {w  {a, b, c}* : the letters are out of order}. L = L  a*b*c*. = {anbncn, n 0}. L is not even CF, much less DCF.

DCFLS are not closed under Intersection L1 = {aibjck, i, j, k  0 and i = j}. L2 = {aibjck, i, j, k  0 and j = k}. L = L1  L2 = L1 and L2 are deterministic context-free:

CFL HIERARCHY

References Automata, Computability and Complexity, Elaine Rich. http://en.wikipedia.org/wiki/Deterministic_context-free_language http://en.wikipedia.org/wiki/Context-free_language http://en.wikipedia.org/wiki/Unambiguous_grammar

QUESTIONS?