Prof. Busch - LSU1 Properties of Context-Free languages.

Slides:



Advertisements
Similar presentations
PDAs Accept Context-Free Languages
Advertisements

Fall 2003Costas Busch - RPI1 Properties of Context-Free languages.
Automata and Formal Languages Tim Sheard 1 Lecture 9 Reasoning with DFAs.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2006Costas Busch - RPI1 Regular Expressions.
Courtesy Costas Busch - RPI1 Positive Properties of Context-Free languages.
1 … NPDAs continued. 2 Pushing Strings Input symbol Pop symbol Push string.
1 Positive Properties of Context-Free languages. 2 Context-free languages are closed under: Union is context free is context-free.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
1 Converting NPDAs to Context-Free Grammars. 2 For any NPDA we will construct a context-free grammar with.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2004COMP 3351 NPDA’s Accept Context-Free Languages.
Costas Busch - RPI1 Positive Properties of Context-Free languages.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
Courtesy Costas Busch - RPI1 Non-regular languages.
Prof. Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
Prof. Busch - RPI1 Decidable Problems of Regular Languages.
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.
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
1 A Non Context-Free Language (We will prove it at the next class)
NFA Closure Properties Sipser pages pages NFAs also have closure properties We have given constructions for showing that DFAs are closed under.
1 Let L= { w= u v : u  {a, b}*, v  {c, d}* and |u|= |v|} 1.Design a context-free grammar that generates L. 2.Use your grammar and the construction from.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
TK PrasadPumping Lemma1 Nonregularity Proofs. TK PrasadPumping Lemma2 Grand Unification Regular Languages: Grand Unification (Parallel Simulation) (Rabin.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Context-Free and Noncontext-Free Languages Chapter 13 1.
Regular Expressions Costas Busch - LSU.
Costas Busch - LSU1 Properties of Context-Free languages.
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.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
Costas Busch - LSU1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
1 Use the pumping theorem for context-free languages to prove that L= { a n b a n b a p : n, p ≥ 0, p ≥ n } is not context-free. Hint: For the pumping.
PDAs Accept Context-Free Languages
Properties of Regular Languages
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
NPDAs Accept Context-Free Languages
Formal Language & Automata Theory
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
Single Final State for NFA
Regular Expressions Prof. Busch - LSU.
DPDA Deterministic PDA
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Non-Deterministic Finite Automata
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
Decidable Problems of Regular Languages
Undecidable problems:
Properties of Context-Free languages
DPDA Deterministic PDA
… NPDAs continued.
Chapter 1 Regular Language
NFAs accept the Regular Languages
The Chomsky Hierarchy Costas Busch - LSU.
Presentation transcript:

Prof. Busch - LSU1 Properties of Context-Free languages

Prof. Busch - LSU2 Context-free languages are closed under: Union is context free is context-free Union

Prof. Busch - LSU3 Example Union LanguageGrammar

Prof. Busch - LSU4 In general: The grammar of the union has new start variable and additional production For context-free languages with context-free grammars and start variables

Prof. Busch - LSU5 Context-free languages are closed under: Concatenation is context free is context-free Concatenation

Prof. Busch - LSU6 Example Concatenation LanguageGrammar

Prof. Busch - LSU7 In general: The grammar of the concatenation has new start variable and additional production For context-free languages with context-free grammars and start variables

Prof. Busch - LSU8 Context-free languages are closed under: Star-operation is context freeis context-free Star Operation

Prof. Busch - LSU9 Example Language Grammar Star Operation

Prof. Busch - LSU10 In general: The grammar of the star operation has new start variable and additional production For context-free language with context-free grammar and start variable

Prof. Busch - LSU11 Negative Properties of Context-Free Languages

Prof. Busch - LSU12 Context-free languages are not closed under: intersection is context free not necessarily context-free Intersection

Prof. Busch - LSU13 Example Context-free: NOT context-free Intersection

Prof. Busch - LSU14 Context-free languages are not closed under: complement is context freenot necessarily context-free Complement

Prof. Busch - LSU15 NOT context-free Example Context-free: Complement

Prof. Busch - LSU16 Intersection of Context-free languages and Regular Languages

Prof. Busch - LSU17 The intersection of a context-free language and a regular language is a context-free language context free regular context-free

Prof. Busch - LSU18 for NPDA DFA Construct a new NPDA machine that accepts Machine context-free regular simulates in parallel and

Prof. Busch - LSU19 transition NPDADFA transition NPDA

Prof. Busch - LSU20 transition NPDADFA transition NPDA

Prof. Busch - LSU21 initial state NPDADFA Initial state NPDA

Prof. Busch - LSU22 final state final states NPDADFA final states NPDA

Prof. Busch - LSU23 Example: NPDA context-free

Prof. Busch - LSU24 DFA regular

Prof. Busch - LSU25 Automaton for: NPDA context-free

Prof. Busch - LSU26 simulates in parallel and accepts stringif and only if accepts string and accepts string In General:

Prof. Busch - LSU27 Therefore: is NPDA is context-free

Prof. Busch - LSU28 Applications of Regular Closure

Prof. Busch - LSU29 The intersection of a context-free language and a regular language is a context-free language context free regular context-free Regular Closure

Prof. Busch - LSU30 An Application of Regular Closure Prove that: is context-free

Prof. Busch - LSU31 We know: is context-free

Prof. Busch - LSU32 is regular We also know:

Prof. Busch - LSU33 regularcontext-free is context-free (regular closure)

Prof. Busch - LSU34 Another Application of Regular Closure Prove that: is not context-free

Prof. Busch - LSU35 context-freeregularcontext-free If is context-free Then Impossible!!! Therefore, is not context free (regular closure)