Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises

Slides:



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

6.2 Closure Properties of CFL's
Pumping Lemma Problem: Solution:
The Pumping Lemma for CFL’s
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
CS 3240: Languages and Computation Properties of Context-Free Languages.
Lecture 15UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 15.
1 Lecture 21 Regular languages review –Several ways to define regular languages –Two main types of proofs/algorithms Relative power of two computational.
Lecture Note of 12/22 jinnjy. Outline Chomsky Normal Form and CYK Algorithm Pumping Lemma for Context-Free Languages Closure Properties of CFL.
1 Module 37 Showing CFL’s not closed under set intersection and set complement.
Homework 4 Solutions.
1 Applications of Regular Closure. 2 The intersection of a context-free language and a regular language is a context-free language context free regular.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
Properties of Context-Free Languages
Systems of Linear Equations Vocabulary. This is a System of Linear Equations.
1 Properties of Context-Free Languages Is a certain language context-free? Is the family of CFLs closed under a certain operation?
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
Saeid Pashzadeh Jan 2009 Theory of Computation 1.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
Test # 2 Friday, November 2 nd Covers all of Chapter 2 Test # 2 will be 20% of final score (same as Test #1) Final Exam will be 40% of the final score.
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
Review for final pm. 2 Review for Midterm Induction – On integer: HW1, Ex 2.2.9b p54 – On length of string: Ex p53, HW2, HW3.
1 Closure Properties of Regular Languages L 1 and L 2 are regular. How about L 1  L 2, L 1  L 2, L 1 L 2, L 1, L 1 * ?
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.
Homework 4 due 11/25.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
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.
Chapter 8 Systems of Linear Equations in Two Variables Section 8.3.
CS 154 Formal Languages and Computability March 17 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
© M. Winter COSC/MATH 4P61 - Theory of Computation Pumping Lemma as a game 1.Player 1 picks the language L to be proven nonregular. 2.Player 2 picks.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Properties of Regular Languages 1.Closure 2.Union 3.Concatenation 4.Complement(Negation)
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
General Discussion of “Properties” The Pumping Lemma Membership, Emptiness, Etc.
Review : Theory of Computation. Regular Language and Finite Automata Context-free Language and Pushdown Automata Turing Machine and Recursive Enumerable.
Context-Free Languages
Closed book, closed notes
Properties of Context-Free Languages
Review : Theory of Computation
CSCE 355 Foundations of Computation
7. Properties of Context-Free Languages
Lecture 22 Pumping Lemma for Context Free Languages
PDAs Accept Context-Free Languages
FORMAL LANGUAGES AND AUTOMATA THEORY
Course 2 Introduction to Formal Languages and Automata Theory (part 2)
DPDA Deterministic PDA
4. Properties of Regular Languages
7. Properties of Context-Free Languages
COSC 3340: Introduction to Theory of Computation
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
Properties of Context-Free Languages
Department of Computer Science & Engineering
The Pumping Lemma for CFL’s
Bottom-up parsing Pumping Theorem for CFLs
Properties of Context-Free languages
Cpt S 317: Spring 2009 Sampath Kumar S, AP/CSE, SECE
Midterm #2 — Review problems
COSC 3340: Introduction to Theory of Computation
CS21 Decidability and Tractability
Chapter 2 Context-Free Language - 02
DPDA Deterministic PDA
MA/CSSE 474 Theory of Computation
CS21 Decidability and Tractability
Applications of Regular Closure
Sub: Theoretical Foundations of Computer Sciences
Theoretical Foundations of Computer Sciences
Intersection Method of Solution
CFL Big Picture.
Presentation transcript:

Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises DS020 오토마타형식언어 Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises September 25, 2003

7. Show that the following languages on are not context-free. 8.1 TWO PUMPING LEMMAS 7. Show that the following languages on are not context-free. w = a(m-1)^3bm Solution (m-1)3 m a … … a b … b 1) |vxy| 2) |v x y| 3) |vxy| i = 0 If |v| = 0  i = 2, else if |y| = 0  i = 0, otherwise (*) i = 2 i = 2  a는 (m-1)3 + k1개, b는 (m+k2)개 (m+k2-1)3 ≥ m3 = (m-1)3 + 3m2 -3m + 1 > (m-1)3 + k1 따라서 pumping된 문자열은 L에 속하지 않게 됨  Not CFL September 25, 2003

w = ambmcm+1 a … a b … b c … c |vxy| i = 2 2) |v x y| 3) |vxy| 8.1 TWO PUMPING LEMMAS w = ambmcm+1 Solution m m m+1 a … a b … b c … c |vxy| 2) |v x y| 3) |vxy| 4) |v x y| 5) |vxy| i = 2 If |y| = 0  i = 2, otherwise i = 0 i = 0 September 25, 2003

w = ambm+1cm+1 a … a b … b c … c |vxy| i = 2 2) |v x y| 8.1 TWO PUMPING LEMMAS w = ambm+1cm+1 Solution m m+1 m+1 a … a b … b c … c |vxy| 2) |v x y| 3) |vxy| 4) |v x y| 5) |vxy| i = 2 If |y| = 0  i = 2, otherwise i = 0 i = 0 If |v| = 0  i = 2, otherwise i = 0 September 25, 2003

11. Show that the language is context-free but not linear. 8.1 TWO PUMPING LEMMAS 11. Show that the language is context-free but not linear. Solution 1) context free grammar S  S1 S2 S1  a S1 b | λ S2  a S2 b | λ 2) not linear w = ambm ambm m m m m a … a b … b a … a b … b |uv| |yz| i = 2 September 25, 2003

8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS FOR CONTEXT-FREE LANGUAGES 6. Which of the language families we have discussed are not closed under reversal? September 25, 2003

8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS FOR CONTEXT-FREE LANGUAGES 10. Show that the family of linear language is not closed under intersection. September 25, 2003

8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS FOR CONTEXT-FREE LANGUAGES 19. Is the family of deterministic context-free languages closed under homomorphism? September 25, 2003