Context-Free Languages (Pre Lecture)
|
|
- Iris Kelly
- 5 years ago
- Views:
Transcription
1 Context-Free Languages (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
2 Outline Pumping Lemma for CFL s Decision Properties Closure Properties Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
3 Pumping Lemma for CFL s Outline Pumping Lemma for CFL s Decision Properties Closure Properties Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
4 Pumping Lemma for CFL s Regular Pumping Lemma Idea σ [j]... σ [k 1] σ [0]... σ [j 1] σ [k]... σ [n 1] q [0] q [j] = q [k] q [n] Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
5 Pumping Lemma for CFL s Context-Free Pumping Lemma Idea PDA Interpretation σ [i]... σ [j 1] ɛ β [0]... β [t] σ [k]... σ [l 1] β [t]... β [0] ɛ σ [0]... σ [i 1] ɛ α [0]... α [s] q [0] q [i] = q [j] q [k] = q [l] q [n] u v σ [j]... σ [k 1] ɛ ɛ x y σ [l]... σ [n 1] α [s]... α [0] ɛ z Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
6 Pumping Lemma for CFL s Context-Free Pumping Lemma Idea Grammar Interpretation S S... S... R... R... R... R u x z R... u v x y z R u v v x y y z Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
7 Pumping Lemma for CFL s Theorem: Pumping Lemma for CFLs Theorem: Pumping Lemma for CFLs If L is a context-free language, there is a number p (the pumping length) where if: σ L σ p then we can divide σ into five pieces σ = uvxyz such that: for each i 0, uv i xy i z L vy > 0 vxy p Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
8 Pumping Lemma for CFL s Pumping Lemma for CFLs Restated For every context-free language L, There exists an integer p, such that For every string σ L where σ p There exists an u, v, x, y, and z where σ = uvxyz for alli 0, uv i xy i z L vy > 0 vxy p L C, p Z, σ L, ( σ p) = ( u, v, x, y, z) ((σ = uvxyz) ( vxy p) ( vy > 0) ( i, uv i xy i z L )) Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
9 Pumping Lemma for CFL s Example 0: Pumping Lemma A = {a n b n c n n 0} is not context-free Proof Assume A is context-free and apply the pumping lemma Choose σ = a p b p c p = uvxyz Any way to divide σ into uvxyz will violate the pumping lemma Case 1: Both v and y contain only one type of symbol. Then uv 2 xy 2 z will not contain equal numbers of a s, b s, and c s. Case 2: Either v or y contain more than one type of symbol. Then uv 2 xy 2 z will not have symbols in the correct order. Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
10 Pumping Lemma for CFL s Example 1: Pumping Lemma B = { a k b l c k d l k 1 l 1 } is not context-free Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
11 Pumping Lemma for CFL s Example 2: Pumping Lemma C = {ωω ω {0, 1} } is not context-free Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
12 Decision Properties Outline Pumping Lemma for CFL s Decision Properties Closure Properties Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
13 Decision Properties Summary of CFL Decision Properties Can Answer: Membership: ω? C Emptiness: C? = Infinite: C? = Regular Subset: C? R Cannot Answer: Equivalence: C 1? = C2 Disjoint: C 1 C 2? = Subset: C 1? C2 Need more powerful computation model (Turing Machine) to prove no algorithm exists Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
14 Decision Properties Membership Given: CFL A, string w Find: Is w in A? w? L (A) Solution (simple): Simulate PDA for A on w Solution (fast): Many specialized parsing algorithms Earley: An CFL, O(n 3 ) in length of string CYK: An CFL, O(n 3 ) in length of string LALR: Some CFL, O(n) in length of string LL(1): Some CFLs, O(n) in length of string LL(*): Some CFL, O(n 2 ) in length of string Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
15 Decision Properties Useless symbols Useful Nonterminal X is useful if: There exists a derivation S α X β ω where S is the start symbol and ω T Requirements Two requirements for usefulness: 1. A terminal string is derivable from X 2. X is in string derivable from S Useless No such derivation using X Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
16 Decision Properties Useless symbols Terminal-deriving symbols Algorithm 1: Find terminal-deriving symbols 1 V old ; 2 V new A A σ for some σ T }{{} ; 3 while V old V new do 4 V old V new ; 5 V new V old A 6 return V new ; A derives string of terminals A α for α (T V old) }{{} A derives string of terminals and terminal-deriving nonterminals ; Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
17 Decision Properties Useless symbols Reachable symbols Algorithm 2: Find terminal-deriving symbols 1 V old ; 2 V new {S}; 3 while V old V new do 4 V old V new ; 5 V new V old B A V old, A αbβ }{{} ; 6 return V new ; A derives B Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
18 Decision Properties Useless symbols Useful Set V useful = V terminal-deriving V reachable P useful are productions containing only V useful Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
19 Decision Properties Useless symbols Example Original Grammar Symbols Simplified Grammar S A B [a] A [a] Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
20 Decision Properties Emptiness Given: Grammar G Find: Is the language of G empty? L (G) =? Solution: Is start symbol S a useless symbol? Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
21 Decision Properties Infiniteness Given: Context-Free Language L Find: Is L infinite? L? = Solution: Based on pumping lemma For pumping length p Is there a string in the language between p and 2p 1? Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
22 Closure Properties Outline Pumping Lemma for CFL s Decision Properties Closure Properties Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
23 Closure Properties CFL Closure under Concatenation Given: CFGs A = (V A, T A, P A, S A ) B = (V B, T B, P B, S B ) Find: C = (V C, T C, P C, S C ) where L (C) = L (A)L (B) Solution (simple): Union on start symbols: V C = V A V B {S } T C = T A T B S C = S P C = P A P B {S S A S B } Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
24 Closure Properties Example: Concatenation on CFGs A B AB A 0 A 1 ɛ B 1 B 0 ɛ Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
25 Closure Properties CFL Closure under Union Given: CFGs A = (V A, T A, P A, S A ) B = (V B, T B, P B, S B ) Find: C = (V C, T C, P C, S C ) where L (C) = L (A) L (B) Solution (simple): Union on start symbols: V C = V A V B {S } T C = T A T B S C = S P C = P A P B {S S A, S S B } Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
26 Closure Properties Example: Union on CFGs A B A B A 0 A 1 ɛ B 1 B 0 ɛ Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
27 Closure Properties CFL Closure under Repetition Given: CFGs A = (V A, T A, P A, S A ) Find: C = (V C, T C, P C, S C ) where L (C) = L (A) Solution (simple): Union on start symbols: V C = V A {S } T C = T A S C = S P C = P A {S S A S, S ɛ} Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
28 Closure Properties Example: Repetition on CFGs A A A 0 A 1 ɛ Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
29 Closure Properties CFL Non-closure under Intersection Theorem The context-free set is not closed under intersection ( ). Proof Proof by counterexample L 1 = {a n b n c n n 1} is not context-free L 2 = { a n b n c i n 1, i 1 } is context-free S A B A a A b ab B c B c L 3 = { a i b n c n n 1, i 1 } is context-free S A B A a A a B b B c bc L 1 = L 2 L 3 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
30 Closure Properties CFL Non-closure under Difference Theorem The context-free set is not closed under difference (\). Proof Proof by contradiction Generally: L M = L \ (L \ M) If CFLs were closed under difference, they would also be closed under intersection. But CFLs are not closed under intersection. Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
31 Closure Properties CFL-Regular Intersection Given: A context-free language and a regular language as: PDA P = (Q P, Σ, Γ P, δ P, q 0,P, F P ) DFA D = (Q D, Σ, δ D, q 0,D, F D ), where Find: C such that L (C) = L (P) L (D) Solution: Simulate P and D in parallel. Result is a PDA. Q C = Q P Q D and q 0,C = (q 0,P, q 0,D ) and F C = F P F D Γ C = Γ P predecessor input {}}{{}}{ (q P, q D ), a, δ C ( q P, ) q D, γ }{{} successor }{{} pushed popped {}}{ γ (( q P, γ ) δ P (q P, a, γ) ) ( q D }{{} = δ D(q D ) ) }{{} PDA Transition DFA Transition Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
32 Closure Properties CFL-Regular Intersection Diagram PDA q p a, γ γ q p Intersect. DFA a, γ γ (q p, q d ) (q p, q d ) q d a q d Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
33 Closure Properties CFL-Regular Intersection Example {ω {0, 1} ω has an equal number of 0 s and 1 s} 0 1 start 0, ɛ 0 0, 1 ɛ ɛ, ɛ $ ɛ, $ ɛ p 0 p 1 p 2 start 0 1 d 0 1 d 1 1, ɛ 1 1, 0 ɛ Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
34 Closure Properties CFL-Regular Intersection Example continued Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall / 34
Pushdown Automata (Pre Lecture)
Pushdown Automata (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Pushdown Automata (Pre Lecture) Fall 2017 1 / 41 Outline Pushdown Automata Pushdown
More informationContext-Free and Noncontext-Free Languages
Examples: Context-Free and Noncontext-Free Languages a*b* is regular. A n B n = {a n b n : n 0} is context-free but not regular. A n B n C n = {a n b n c n : n 0} is not context-free The Regular and the
More informationNPDA, CFG equivalence
NPDA, CFG equivalence Theorem A language L is recognized by a NPDA iff L is described by a CFG. Must prove two directions: ( ) L is recognized by a NPDA implies L is described by a CFG. ( ) L is described
More information2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a
. Solution E T F a E E + T T + T F + T a + T a + F a + a E E + T E + T + T T + T + T F + T + T a + T + T a + F + T a + a + T a + a + F a + a + a E T F ( E) ( T ) ( F) (( E)) (( T )) (( F)) (( a)) . Solution
More informationOgden s Lemma for CFLs
Ogden s Lemma for CFLs Theorem If L is a context-free language, then there exists an integer l such that for any u L with at least l positions marked, u can be written as u = vwxyz such that 1 x and at
More informationCS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL) Objectives Introduce Pumping Lemma for CFL Apply Pumping Lemma to show that some languages are non-cfl Pumping Lemma
More informationHarvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs
Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton
More informationProperties of Context-Free Languages. Closure Properties Decision Properties
Properties of Context-Free Languages Closure Properties Decision Properties 1 Closure Properties of CFL s CFL s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms
More informationTHEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET
THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages
More informationContext-Free Languages
CS:4330 Theory of Computation Spring 2018 Context-Free Languages Non-Context-Free Languages Haniel Barbosa Readings for this lecture Chapter 2 of [Sipser 1996], 3rd edition. Section 2.3. Proving context-freeness
More informationPumping Lemma for CFLs
Pumping Lemma for CFLs v y s Here we go again! Intuition: If L is CF, then some CFG G produces strings in L If some string in L is very long, it will have a very tall parse tree If a parse tree is taller
More informationCSE 355 Test 2, Fall 2016
CSE 355 Test 2, Fall 2016 28 October 2016, 8:35-9:25 a.m., LSA 191 Last Name SAMPLE ASU ID 1357924680 First Name(s) Ima Regrading of Midterms If you believe that your grade has not been added up correctly,
More informationProperties of Context-Free Languages
Properties of Context-Free Languages Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr
More informationCS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL, DPDA PDA)
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL, DPDA PDA) Objectives Introduce the Pumping Lemma for CFL Show that some languages are non- CFL Discuss the DPDA, which
More informationSCHEME FOR INTERNAL ASSESSMENT TEST 3
SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each
More informationAutomata Theory. CS F-10 Non-Context-Free Langauges Closure Properties of Context-Free Languages. David Galles
Automata Theory CS411-2015F-10 Non-Context-Free Langauges Closure Properties of Context-Free Languages David Galles Department of Computer Science University of San Francisco 10-0: Fun with CFGs Create
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable
More informationComputational Models - Lecture 5 1
Computational Models - Lecture 5 1 Handout Mode Iftach Haitner. Tel Aviv University. November 28, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationPushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen
Pushdown Automata Notes on Automata and Theory of Computation Chia-Ping Chen Department of Computer Science and Engineering National Sun Yat-Sen University Kaohsiung, Taiwan ROC Pushdown Automata p. 1
More informationIntroduction to Theory of Computing
CSCI 2670, Fall 2012 Introduction to Theory of Computing Department of Computer Science University of Georgia Athens, GA 30602 Instructor: Liming Cai www.cs.uga.edu/ cai 0 Lecture Note 3 Context-Free Languages
More informationPushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.
Pushdown Automata We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata. Next we consider a more powerful computation model, called a
More informationFoundations of Informatics: a Bridging Course
Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html
More informationThis lecture covers Chapter 7 of HMU: Properties of CFLs
This lecture covers Chapter 7 of HMU: Properties of CFLs Chomsky Normal Form Pumping Lemma for CFs Closure Properties of CFLs Decision Properties of CFLs Additional Reading: Chapter 7 of HMU. Chomsky Normal
More informationMA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation Bottom-up parsing Pumping Theorem for CFLs Recap: Going One Way Lemma: Each context-free language is accepted by some PDA. Proof (by construction): The idea: Let the stack
More informationTheory of Computation
Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L
More informationRegular Expressions (Pre Lecture)
Regular Expressions (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Regular Expressions (Pre Lecture) Fall 2017 1 / 39 Regular Expressions Outline
More informationComputational Models - Lecture 4
Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push
More informationBefore We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?
Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)
More informationComment: The induction is always on some parameter, and the basis case is always an integer or set of integers.
1. For each of the following statements indicate whether it is true or false. For the false ones (if any), provide a counter example. For the true ones (if any) give a proof outline. (a) Union of two non-regular
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of
More informationProblem 2.6(d) [4 pts] Problem 2.12 [3pts] Original CFG:
Problem 2.6(d) [4 pts] S X T#X X#T T#X#T X axa bxb #T# # T at bt #T ε Problem 2.12 [3pts] Original CFG: R XRX S S atb bta T XTX X ε X a b q start ε, ε $ ε, R X ε, ε R ε, ε X ε, R S ε, T X ε, T ε ε, X a
More informationNon-context-Free Languages. CS215, Lecture 5 c
Non-context-Free Languages CS215, Lecture 5 c 2007 1 The Pumping Lemma Theorem. (Pumping Lemma) Let be context-free. There exists a positive integer divided into five pieces, Proof for for each, and..
More informationThe Pumping Lemma for Context Free Grammars
The Pumping Lemma for Context Free Grammars Chomsky Normal Form Chomsky Normal Form (CNF) is a simple and useful form of a CFG Every rule of a CNF grammar is in the form A BC A a Where a is any terminal
More informationFinal exam study sheet for CS3719 Turing machines and decidability.
Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,
More informationClosure Properties of Context-Free Languages. Foundations of Computer Science Theory
Closure Properties of Context-Free Languages Foundations of Computer Science Theory Closure Properties of CFLs CFLs are closed under: Union Concatenation Kleene closure Reversal CFLs are not closed under
More informationLecture 17: Language Recognition
Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to
More informationContext Free Languages: Decidability of a CFL
Theorem 14.1 Context Free Languages: Decidability of a CFL Statement: Given a CFL L and string w, there is a decision procedure that determines whether w L. Proof: By construction. 1. Proof using a grammar
More informationCliff s notes for equivalence of CFLs and L(PDAs) LisaCFL L = L(M) for some PDA M L=L(M)forsomePDAM L = L(G) for some CFG G
What s on our plate today? Cliff s notes for equivalence of CFLs and L(PDAs) LisaCFL L = L(M) for some PDA M L=L(M)forsomePDAM L = L(G) for some CFG G Pumping Lemma (one last time) Statement of Pumping
More informationDM17. Beregnelighed. Jacob Aae Mikkelsen
DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................
More informationCS500 Homework #2 Solutions
CS500 Homework #2 Solutions 1. Consider the two languages Show that L 1 is context-free but L 2 is not. L 1 = {a i b j c k d l i = j k = l} L 2 = {a i b j c k d l i = k j = l} Answer. L 1 is the concatenation
More informationCS 341 Homework 16 Languages that Are and Are Not Context-Free
CS 341 Homework 16 Languages that Are and Are Not Context-Free 1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure
More informationComputational Models - Lecture 4 1
Computational Models - Lecture 4 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 3/8, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationMA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online
More informationCS20a: summary (Oct 24, 2002)
CS20a: summary (Oct 24, 2002) Context-free languages Grammars G = (V, T, P, S) Pushdown automata N-PDA = CFG D-PDA < CFG Today What languages are context-free? Pumping lemma (similar to pumping lemma for
More informationIntro to Theory of Computation
Intro to Theory of Computation LECTURE 9 Last time: Converting a PDA to a CFG Pumping Lemma for CFLs Today: Pumping Lemma for CFLs Review of CFGs/PDAs Sofya Raskhodnikova 2/9/2016 Sofya Raskhodnikova;
More informationTheory of Computation (IV) Yijia Chen Fudan University
Theory of Computation (IV) Yijia Chen Fudan University Review language regular context-free machine DFA/ NFA PDA syntax regular expression context-free grammar Pushdown automata Definition A pushdown automaton
More informationCISC4090: Theory of Computation
CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter
More informationV Honors Theory of Computation
V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant
More informationProperties of context-free Languages
Properties of context-free Languages We simplify CFL s. Greibach Normal Form Chomsky Normal Form We prove pumping lemma for CFL s. We study closure properties and decision properties. Some of them remain,
More informationFormal Languages, Automata and Models of Computation
CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2011 1 Content - More Properties of Regular Languages (RL)
More informationProperties of Context-free Languages. Reading: Chapter 7
Properties of Context-free Languages Reading: Chapter 7 1 Topics 1) Simplifying CFGs, Normal forms 2) Pumping lemma for CFLs 3) Closure and decision properties of CFLs 2 How to simplify CFGs? 3 Three ways
More informationHarvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition
Harvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition Salil Vadhan October 11, 2012 Reading: Sipser, Section 2.3 and Section 2.1 (material on Chomsky Normal Form). Pumping Lemma for
More informationNotes for Comp 497 (Comp 454) Week 10 4/5/05
Notes for Comp 497 (Comp 454) Week 10 4/5/05 Today look at the last two chapters in Part II. Cohen presents some results concerning context-free languages (CFL) and regular languages (RL) also some decidability
More informationThe View Over The Horizon
The View Over The Horizon enumerable decidable context free regular Context-Free Grammars An example of a context free grammar, G 1 : A 0A1 A B B # Terminology: Each line is a substitution rule or production.
More informationSYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES
Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,
More informationChap. 7 Properties of Context-free Languages
Chap. 7 Properties of Context-free Languages 7.1 Normal Forms for Context-free Grammars Context-free grammars A where A N, (N T). 0. Chomsky Normal Form A BC or A a except S where A, B, C N, a T. 1. Eliminating
More informationFunctions on languages:
MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet
More informationHomework 5 - Solution
DCP3122 Introduction to Formal Languages, Spring 2015 Instructor: Prof. Wen-Guey Tzeng Homework 5 - Solution 5-May-2015 Due: 18-May-2015 1. Given Σ = {a, b, c}, find an NPDA that accepts L = {a n b n+m
More informationSection 1 (closed-book) Total points 30
CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes
More informationContext Free Language Properties
Context Free Language Properties Knowing that the context free languages are exactly those sets accepted by nondeterministic pushdown automata provides us a bit of information about them. We know that
More informationNotes for Comp 497 (454) Week 10
Notes for Comp 497 (454) Week 10 Today we look at the last two chapters in Part II. Cohen presents some results concerning the two categories of language we have seen so far: Regular languages (RL). Context-free
More informationPUSHDOWN AUTOMATA (PDA)
PUSHDOWN AUTOMATA (PDA) FINITE STATE CONTROL INPUT STACK (Last in, first out) input pop push ε,ε $ 0,ε 0 1,0 ε ε,$ ε 1,0 ε PDA that recognizes L = { 0 n 1 n n 0 } Definition: A (non-deterministic) PDA
More informationEinführung in die Computerlinguistik
Einführung in die Computerlinguistik Context-Free Grammars formal properties Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2018 1 / 20 Normal forms (1) Hopcroft and Ullman (1979) A normal
More informationCSE 105 THEORY OF COMPUTATION. Spring 2018 review class
CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus
More informationCISC 4090 Theory of Computation
CISC 4090 Theory of Computation Context-Free Languages and Push Down Automata Professor Daniel Leeds dleeds@fordham.edu JMH 332 Languages: Regular and Beyond Regular: a b c b d e a Not-regular: c n bd
More informationMore Properties of Regular Languages
More Properties of Regular anguages 1 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse 2 Namely, for regular languages 1 and 2 : Union 1 2 Concatenation Star
More informationNote: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules).
Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules). 1a) G = ({R, S, T}, {0,1}, P, S) where P is: S R0R R R0R1R R1R0R T T 0T ε (S generates the first 0. R generates
More informationTDDD65 Introduction to the Theory of Computation
TDDD65 Introduction to the Theory of Computation Lecture 2 Gustav Nordh, IDA gustav.nordh@liu.se 2012-08-31 Outline - Lecture 2 Closure properties of regular languages Regular expressions Equivalence of
More informationClosure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism
Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement
More informationFall 1999 Formal Language Theory Dr. R. Boyer. Theorem. For any context free grammar G; if there is a derivation of w 2 from the
Fall 1999 Formal Language Theory Dr. R. Boyer Week Seven: Chomsky Normal Form; Pumping Lemma 1. Universality of Leftmost Derivations. Theorem. For any context free grammar ; if there is a derivation of
More informationCPS 220 Theory of Computation
CPS 22 Theory of Computation Review - Regular Languages RL - a simple class of languages that can be represented in two ways: 1 Machine description: Finite Automata are machines with a finite number of
More informationChapter 16: Non-Context-Free Languages
Chapter 16: Non-Context-Free Languages Peter Cappello Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 cappello@cs.ucsb.edu Please read the corresponding chapter
More information10. The GNFA method is used to show that
CSE 355 Midterm Examination 27 February 27 Last Name Sample ASU ID First Name(s) Ima Exam # Sample Regrading of Midterms If you believe that your grade has not been recorded correctly, return the entire
More informationCpSc 421 Final Exam December 15, 2006
CpSc 421 Final Exam December 15, 2006 Do problem zero and six of problems 1 through 9. If you write down solutions for more that six problems, clearly indicate those that you want graded. Note that problems
More informationLet P(n) be a statement about a non-negative integer n. Then the principle of mathematical induction is that P(n) follows from
1. Define automata? ANNA UNIVERSITY, CHENNAI B.E/B.Tech DEGREE EXAMINATION APR/MAY 2008 Fifth Semester Computer Science and Engineering CS1303-Theory of Computation Part-A An automaton is an abstract computing
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Design a PDA and a CFG for a given language Give informal description for a PDA,
More informationWhat languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?
} We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are
More informationPushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen
Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata
More informationTheory Bridge Exam Example Questions
Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with
More informationFinite Automata and Formal Languages TMV026/DIT321 LP Useful, Useless, Generating and Reachable Symbols
Finite Automata and Formal Languages TMV026/DIT321 LP4 2012 Lecture 13 Ana Bove May 7th 2012 Overview of today s lecture: Normal Forms for Context-Free Languages Pumping Lemma for Context-Free Languages
More informationDecidability (What, stuff is unsolvable?)
University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Define push down automata Trace the computation of a push down automaton Design
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTATION
FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described
More informationCS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018
CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts
More informationComputational Models - Lecture 3 1
Computational Models - Lecture 3 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. March 13/18, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models - Lecture 3
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover
More informationQuestion Bank UNIT I
Siddhivinayak Technical Campus School of Engineering & Research Technology Department of computer science and Engineering Session 2016-2017 Subject Name- Theory of Computation Subject Code-4KS05 Sr No.
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.
More informationCS375: Logic and Theory of Computing
CS375: Logic and Theory of Computing Fuhua (Frank) Cheng Department of Computer Science University of Kentucky 1 Table of Contents: Week 1: Preliminaries (set algebra, relations, functions) (read Chapters
More informationChapter 6. Properties of Regular Languages
Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is
More informationFinite Automata and Regular languages
Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationSolution Scoring: SD Reg exp.: a(a
MA/CSSE 474 Exam 3 Winter 2013-14 Name Solution_with explanations Section: 02(3 rd ) 03(4 th ) 1. (28 points) For each of the following statements, circle T or F to indicate whether it is True or False.
More informationThe Pumping Lemma and Closure Properties
The Pumping Lemma and Closure Properties Mridul Aanjaneya Stanford University July 5, 2012 Mridul Aanjaneya Automata Theory 1/ 27 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationCSE 105 Homework 5 Due: Monday November 13, Instructions. should be on each page of the submission.
CSE 05 Homework 5 Due: Monday November 3, 207 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments
More information6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs
CSC4510/6510 AUTOMATA 6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs The Pumping Lemma for Context Free Languages One way to prove AnBn is not regular is to use the pumping lemma
More informationTheory of Computation
Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs
More informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
More informationCS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression) Objectives Prove the Pumping Lemma, and use it to show that there are non-regular languages
More information