Properties of ContextFree languages Costas Busch LSU 1
Properties of Context-Free languages Costas Busch - LSU 1
Union Context-free languages are closed under: Union is context free is context-free Costas Busch - LSU 2
Example Language Grammar Union Costas Busch - LSU 3
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 Costas Busch - LSU 4
Concatenation Context-free languages Concatenation are closed under: is context free is context-free Costas Busch - LSU 5
Example Language Grammar Concatenation Costas Busch - LSU 6
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 Costas Busch - LSU 7
Star Operation Context-free languages Star-operation are closed under: is context free is context-free Costas Busch - LSU 8
Example Language Grammar Star Operation Costas Busch - LSU 9
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 Costas Busch - LSU 10
Negative Properties of Context-Free Languages Costas Busch - LSU 11
Intersection Context-free languages intersection are not closed under: is context free Costas Busch - LSU not necessarily context-free 12
Example Context-free: Intersection NOT context-free Costas Busch - LSU 13
Complement Context-free languages complement are not closed under: is context free not necessarily context-free Costas Busch - LSU 14
Example Context-free: Complement NOT context-free Costas Busch - LSU 15
Intersection of Context-free languages and Regular Languages Costas Busch - LSU 16
The intersection of a context-free language and a regular language is a context-free language context free regular context-free Costas Busch - LSU 17
Machine NPDA for DFA for regular context-free Construct a new NPDA machine that accepts simulates in parallel Costas Busch - LSU and 18
NPDA DFA transition NPDA transition Costas Busch - LSU 19
NPDA DFA transition NPDA transition Costas Busch - LSU 20
NPDA DFA initial state NPDA Initial state Costas Busch - LSU 21
NPDA DFA final states NPDA final states Costas Busch - LSU 22
Example: context-free NPDA Costas Busch - LSU 23
regular DFA Costas Busch - LSU 24
context-free Automaton for: NPDA Costas Busch - LSU 25
In General: simulates in parallel accepts string and if and only if accepts string and accepts string Costas Busch - LSU 26
Therefore: is NPDA is context-free Costas Busch - LSU 27
Applications of Regular Closure Costas Busch - LSU 28
The intersection of a context-free language and a regular language is a context-free language Regular Closure context free regular context-free Costas Busch - LSU 29
An Application of Regular Closure Prove that: is context-free Costas Busch - LSU 30
We know: is context-free Costas Busch - LSU 31
We also know: is regular Costas Busch - LSU 32
context-free regular (regular closure) context-free is context-free Costas Busch - LSU 33
Another Application of Regular Closure Prove that: is not context-free Costas Busch - LSU 34
is context-free If (regular closure) Then context-free regular context-free Impossible!!! Therefore, is not context free Costas Busch - LSU 35
- Slides: 35