Positive Properties of Context-Free languages

Similar documents
A Turing Machine. The Tape. Languages accepted by Turing Machines. Tape... Read-Write head. Context-Free n Languages. Control Unit.

CSE303 Q4 SOLUTIONS. YES/NO questions 1. The set of terminals is always non- empty

CD5080 AUBER RECAPITULATION. Context-Free Languages. Models of Computation, Languages and Automata. S asb. S bsb

PRACTICE FINAL SOLUTIONS

Applications of Regular Closure

Context-free grammars and. Basics of string generation methods

Properties of Regular Languages. Reading: Chapter 4

2017 PRACTICE MIDTERM SOLUTIONS

CS375 Midterm Exam Solution Set (Fall 2017)

Computability and computational complexity

Automata Theory CS F-08 Context-Free Grammars

Review of CFGs and Parsing I Context-free Languages and Grammars. Winter 2014 Costas Busch - RPI 1

Finite Automata. Reading: Chapter 2

Homework 4 Solutions. 2. Find context-free grammars for the language L = {a n b m c k : k n + m}. (with n 0,

Quiz No. 1. ln n n. 1. Define: an infinite sequence A function whose domain is N 2. Define: a convergent sequence A sequence that has a limit

Sigma notation. 2.1 Introduction

Introduction to Automata Theory. Reading: Chapter 1

Today in Physics 217: separation of variables IV

Announcements, Nov. 19 th

Math 25 Solutions to practice problems

Worksheet on Generating Functions

Course 8 Properties of Regular Languages

Namely, for regular languages L1. Concatenation. Regular Languages. Star operation L 1. Complement. For regular language L the complement L is regular

CS 154 Formal Languages and Computability Assignment #2 Solutions

Formal Languages The Pumping Lemma for CFLs

Automata Theory Final Exam Solution 08:10-10:00 am Friday, June 13, 2008

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

A string of not-so-obvious statements about correlation in the data. (This refers to the mechanical calculation of correlation in the data.

Lecture 11 Context-Free Languages

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

Simplification of CFG and Normal Forms. Wen-Guey Tzeng Computer Science Department National Chiao Tung University

Simplification of CFG and Normal Forms. Wen-Guey Tzeng Computer Science Department National Chiao Tung University

VTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a.

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Recitation 4: Converting Grammars to Chomsky Normal Form, Simulation of Context Free Languages with Push-Down Automata, Semirings

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

6.4 Binomial Coefficients

42 Dependence and Bases

Grammars and Context Free Languages

CS A Term 2009: Foundations of Computer Science. Homework 2. By Li Feng, Shweta Srivastava, and Carolina Ruiz.

Computability and computational complexity

Mathematical Description of Discrete-Time Signals. 9/10/16 M. J. Roberts - All Rights Reserved 1

Solutions to Final Exam Review Problems

9.3 Power Series: Taylor & Maclaurin Series

Applications in Linear Algebra and Uses of Technology

Section 11.8: Power Series

Statistics for Applications Fall Problem Set 7

Web Appendix O - Derivations of the Properties of the z Transform

CS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Lecture 12 Simplification of Context-Free Grammars and Normal Forms

B = B is a 3 4 matrix; b 32 = 3 and b 2 4 = 3. Scalar Multiplication

MIXED REVIEW of Problem Solving

Honors Algebra 2 Summer Assignment

Physical Chemistry I for Biochemists. Lecture 2 (1/12/11) Yoshitaka Ishii. Gas Ch. 1 Non-Ideal Gas (Ch 1 & Raff p21-41) Announcement

Grammars and Context Free Languages

Analytic Theory of Probabilities

STK4011 and STK9011 Autumn 2016

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

Properties of Context-Free Languages

Chapter 8 Hypothesis Testing

MEI STRUCTURED MATHEMATICS FURTHER CONCEPTS FOR ADVANCED MATHEMATICS, FP1. Practice Paper FP1-B

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

Concordia University Department of Computer Science & Software Engineering

Ma/CS 6a Class 22: Power Series

Ma 530 Introduction to Power Series

Lecture 11: Pseudorandom functions

On Modeling On Minimum Description Length Modeling. M-closed

CS 70 Second Midterm 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):

Axioms of Measure Theory

Tutorial F n F n 1

Lesson 10: Limits and Continuity

CS 133 : Automata Theory and Computability

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

Define a Markov chain on {1,..., 6} with transition probability matrix P =

Exercises 1 Sets and functions

Context Free Languages (CFL) Language Recognizer A device that accepts valid strings. The FA are formalized types of language recognizer.

Infinite Series. Definition. An infinite series is an expression of the form. Where the numbers u k are called the terms of the series.

Discrete-Time Signals and Systems. Discrete-Time Signals and Systems. Signal Symmetry. Elementary Discrete-Time Signals.

Recurrence Relations

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

Long-term Memory Review CRT PRACTICE 8 th Grade: MONDAY REVIEW STATE STANDARDS AND 2.8.2

Theory of Computation - Module 3

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

Define and Use Sequences and Series

Calculus 2 - D. Yuen Final Exam Review (Version 11/22/2017. Please report any possible typos.)

You may work in pairs or purely individually for this assignment.

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Matrix Algebra 2.2 THE INVERSE OF A MATRIX Pearson Education, Inc.

Automated Proofs for Some Stirling Number Identities

CSCI-6971 Lecture Notes: Stochastic processes

( ) = p and P( i = b) = q.

Announcements. Introduction to String Matching. String Matching. String Matching. String Matching. String Matching

Sets. Sets. Operations on Sets Laws of Algebra of Sets Cardinal Number of a Finite and Infinite Set. Representation of Sets Power Set Venn Diagram

Course Material. CS Lecture 1 Deterministic Finite Automata. Grading and Policies. Workload. Website:

A Simple Optimum-Time FSSP Algorithm for Multi-Dimensional Cellular Automata

Lecture 2: April 3, 2013

EXAMPLE CFG. L = {a 2n : n 1 } L = {a 2n : n 0 } S asa aa. L = {a n b : n 0 } L = {a n b : n 1 } S asb ab S 1S00 S 1S00 100

Transcription:

CS 30 - Leture 8 Properties of Cotext Free Graars Fall 008 Review Laguages ad Graars Alphabets, strigs, laguages Regular Laguages Deteriisti Fiite ad Nodeteriisti Autoata Equivalee of NFA ad DFA Regular Expressios Regular Graars Properties of Regular Laguages Laguages that are ot regular ad the pupig lea Cotext Free Laguages Cotext Free Graars Derivatios: leftost, rightost ad derivatio trees Parsig ad abiguity Siplifiatios ad Noral Fors Nodeteriisti Pushdow Autoata Pushdow Autoata ad Cotext Free Graars Deteriisti Pushdow Autoata Pupig Lea for Cotext Free Graars Today: Closure ad Deidable Properties for Cotext Free Laguages Uio Positive Properties of Cotext-Free laguages L L is otext free is otext free Cotext-free laguages are losed uder: Uio L L is otext-free

Exaple I geeral: Laguage b Graar S as b λ For otext-free laguages with otext-free graars ad start variables L, L G, G S, S L = { ww R Uio R b { ww S as a bsb S S S λ The graar of the uio has ew start variable L L S S S S ad additioal produtio Coateatio Cotext-free laguages are losed uder: Coateatio Laguage b Exaple Graar S as b λ L is otext free L = { ww R S as a bsb λ L is otext free L L is otext-free Coateatio R b { ww S S S

I geeral: For otext-free laguages with otext-free graars ad start variables L, L G, G S, S Star Operatio Cotext-free laguages are losed uder: Star-operatio The graar of the oateatio has ew start variable S ad additioal produtio S S S L L L is otext free * L is otext-free Exaple I geeral: Laguage b Graar S asb λ For otext-free laguage with otext-free graar ad start variable L G S b Star Operatio * S SS λ The graar of the star operatio has ew start variable S ad additioal produtio L* S SS λ 3

Itersetio Negative Properties of Cotext-Free Laguages L Cotext-free laguages are ot losed uder: is otext free itersetio L L L is otext free ot eessarily otext-free b Exaple Cotext-free: Cotext-free: b S AC S AB A aab λ A aa λ C C λ B bb λ L b Itersetio NOT otext-free Copleet Cotext-free laguages are ot losed uder: opleet L is otext free L ot eessarily otext-free 4

b Exaple Cotext-free: Cotext-free: Copleet NOT otext-free L L = L b b S AC S AB A aab λ A aa λ C C λ B bb λ Itersetio of Cotext-free laguages ad Regular Laguages The itersetio of a otext-free laguage ad a regular laguage is a otext-free laguage ahie ahie for L DFA for otext-free regular L L L otext free regular L L otext-free Costrut a ew ahie that aepts L L siulates i parallel ad 5

DFA a, b q q a p p trasitio trasitio DFA λ, b q q p trasitio q, p a, b q, p q, p λ, b q, p trasitio trasitio DFA DFA q 0 p 0 q p p iitial state iitial state fial state fial states q 0, p 0 q, p q, p Iitial state fial states 6

Exaple: otext-free * * L = { w w : w = w, w { a, b, w {, d regular * L = { a, DFA a, λ b, λ, λ d, λ a, q λ, λ λ λ, λ λ λ, λ λ 0 q q q3 p 0 otext-free Autoato for: L L = { a : 0 a, λ, λ λ, λ λ λ, λ λ λ, λ λ q0, p 0 q, p 0 q, p0 q 3, p 0 I Geeral: siulates i parallel ad aepts strig w aepts strig if ad oly if w aepts strig w ad L( ) = L( ) L( ) 7

Therefore: is L( ) L( ) is otext-free Appliatios of Regular Closure L L is otext-free The itersetio of a otext-free laguage ad a regular laguage is a otext-free laguage A Appliatio of Regular Closure Prove that: b : 00, 0 L L otext free regular Regular Closure L L otext-free is otext-free 8

We kow: We also kow: { a b : 0 is otext-free 00 00 L = { a b is regular * 00 00 b L = {( a + b) { a is regular { a b otext-free (regular losure) 00 L = {( a + b) { a b { a b L * 00 regular otext-free Aother Appliatio of Regular Closure Prove that: L = { w: a = b = is ot otext-free { a b L = { a b : 00, 0 = L is otext-free 9

If L = { w: a = b = is otext-free The (regular losure) L { a * b* * = { a b otext-free regular otext-free Ipossible!!! Deidable Properties of Cotext-Free Laguages Therefore, L is ot otext free ebership Questio: for otext-free graar fid if strig w L(G) G Epty Laguage Questio: for otext-free graar fid if L(G) = G ebership Algoriths: Parsers Exhaustive searh parser CYK parsig algorith Algorith:. Reove useless variables. Chek if start variable is useless S 0

Ifiite Laguage Questio: Algorith: for otext-free graar fid if is ifiite L(G). Reove useless variables. Reove uit ad produtios λ 3. Create depedey graph for variables 4. If there is a loop i the depedey graph the the laguage is ifiite G Exaple: S AB A acb a B bb bb C BS Depedey graph A S B Ifiite laguage C S AB A acb a B bb bb C BS S AB acbb absbb abbsbbb S abbsbbb ( abb) ( abb) i S( bbb) i S( bbb) Read What s Next Liz Chapter,.,.,.3, (skip.4), 3, 4, 5, 6., 6., (skip 6.3), 7., 7., 7.3, (skip 7.4), 8, ad 9. JFLAP Chapter,., (skip.), 3, 4, 5, 6, 7, (skip 8), 9., 9. Next Leture Topis Fro 9. Turig ahies Quiz 3 i Reitatio o Wedesday / Covers Liz 7., 7., 7.3, (skip 7.4), 8, ad JFLAP 5,6,7 Closed book, but you ay brig oe sheet of 8.5 x ih paper with ay otes you like. Quiz will take the full hour Hoework Hoework Due Today New Hoework Available Friday New Hoework Due Next Thursday