Properties of Context-Free languages

Slides:



Advertisements
Similar presentations
PDAs Accept Context-Free Languages
Advertisements

Fall 2003Costas Busch - RPI1 Properties of Context-Free languages.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Prof. Busch - LSU1 Properties of Context-Free languages.
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.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
Courtesy Costas Busch - RPI1 Positive Properties of Context-Free languages.
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular 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.
Fall 2003Costas Busch - RPI1 Decidable Problems of Regular 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.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2006Costas Busch - RPI1 The Chomsky Hierarchy.
Finite Automata Costas Busch - RPI.
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
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)
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Fall 2003Costas Busch - RPI1 Linear Grammars Grammars with at most one variable at the right side of a production Examples:
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
Regular Expressions Costas Busch - LSU.
Costas Busch - LSU1 Properties of Context-Free languages.
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 - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
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
Linear Bounded Automata LBAs
NPDAs Accept Context-Free Languages
Formal Language & Automata Theory
Pushdown Automata PDAs
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
Single Final State for NFA
Undecidable Problems (unsolvable problems)
DPDA Deterministic PDA
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
The Post Correspondence Problem
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
Non-regular languages
Decidable Problems of Regular Languages
DPDA Deterministic PDA
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
… NPDAs continued.
Chapter 1 Regular Language
NFAs accept the Regular Languages
The Chomsky Hierarchy Costas Busch - LSU.
Presentation transcript:

Properties of Context-Free languages Fall 2003 Costas Busch - RPI

Union Context-free languages are closed under: Union is context free Fall 2003 Costas Busch - RPI

Example Language Grammar Union Fall 2003 Costas Busch - RPI

For context-free languages with context-free grammars In general: For context-free languages with context-free grammars and start variables The grammar of the union has new start variable and additional production Fall 2003 Costas Busch - RPI

Concatenation Context-free languages are closed under: Concatenation is context free is context free is context-free Fall 2003 Costas Busch - RPI

Example Language Grammar Concatenation Fall 2003 Costas Busch - RPI

For context-free languages with context-free grammars In general: For context-free languages with context-free grammars and start variables The grammar of the concatenation has new start variable and additional production Fall 2003 Costas Busch - RPI

Star Operation Context-free languages are closed under: Star-operation is context free is context-free Fall 2003 Costas Busch - RPI

Example Language Grammar Star Operation Fall 2003 Costas Busch - RPI

For context-free language with context-free grammar and start variable In general: For context-free language with context-free grammar and start variable The grammar of the star operation has new start variable and additional production Fall 2003 Costas Busch - RPI

Negative Properties of Context-Free Languages Fall 2003 Costas Busch - RPI

Intersection Context-free languages are not closed under: intersection is context free is context free not necessarily context-free Fall 2003 Costas Busch - RPI

Example Context-free: Context-free: Intersection NOT context-free Fall 2003 Costas Busch - RPI

Complement Context-free languages are not closed under: complement is context free not necessarily context-free Fall 2003 Costas Busch - RPI

Example Context-free: Context-free: Complement NOT context-free Fall 2003 Costas Busch - RPI

Intersection of Context-free languages and Regular Languages Fall 2003 Costas Busch - RPI

a context-free language and a regular language The intersection of a context-free language and a regular language is a context-free language context free regular context-free Fall 2003 Costas Busch - RPI

Construct a new NPDA machine that accepts DFA for NPDA for regular context-free Construct a new NPDA machine that accepts simulates in parallel and Fall 2003 Costas Busch - RPI

NPDA DFA transition transition NPDA transition Fall 2003 Costas Busch - RPI

NPDA DFA transition NPDA transition Fall 2003 Costas Busch - RPI

NPDA DFA initial state initial state NPDA Initial state Fall 2003 Costas Busch - RPI

NPDA DFA final state final states NPDA final states Fall 2003 Costas Busch - RPI

Example: context-free NPDA Fall 2003 Costas Busch - RPI

regular DFA Fall 2003 Costas Busch - RPI

context-free Automaton for: NPDA Fall 2003 Costas Busch - RPI

simulates in parallel and In General: simulates in parallel and accepts string if and only if accepts string and accepts string Fall 2003 Costas Busch - RPI

Therefore: is NPDA is context-free is context-free Fall 2003 Costas Busch - RPI

Applications of Regular Closure Fall 2003 Costas Busch - RPI

a context-free language and a regular language The intersection of a context-free language and a regular language is a context-free language Regular Closure context free regular context-free Fall 2003 Costas Busch - RPI

An Application of Regular Closure Prove that: is context-free Fall 2003 Costas Busch - RPI

We know: is context-free Fall 2003 Costas Busch - RPI

We also know: is regular is regular Fall 2003 Costas Busch - RPI

context-free regular context-free is context-free (regular closure) Fall 2003 Costas Busch - RPI

Another Application of Regular Closure Prove that: is not context-free Fall 2003 Costas Busch - RPI

Impossible!!! If is context-free Then context-free regular (regular closure) Then context-free regular context-free Impossible!!! Therefore, is not context free Fall 2003 Costas Busch - RPI