Positive Properties of ContextFree languages 1 Contextfree languages
- Slides: 38
Positive Properties of Context-Free languages 1
Context-free languages are closed under: Union is context free is context-free 2
Union Example: Union grammar: 3
In general: Take any two context-free grammars with start variables The union grammar has start variable and is context-free 4
Context-free languages are closed under: Concatenation is context free is context-free 5
Concatenation Example: Concatenation grammar: 6
In general: Take any two context-free grammars with start variables The concatenation grammar has start variable and is context-free 7
Context-free languages are closed under: is context free Star-operation is context-free 8
Star operation Example: Star grammar: 9
In general: Take any context-free grammars with start variable The concatenation grammar has start variable and is context-free 10
Negative Properties of Context-Free Languages 11
Context-free languages intersection are not closed under: is context free not necessarily context-free 12
Counter Example: Context-free: NOT context-free 13
Context-free languages complement are not closed under: is context free not necessarily context-free 14
Counter Example: Context-free: NOT context-free 15
Intersection of Context-free languages and Regular Languages 16
The intersection of a context-free language and a regular language is a context-free language context free regular context-free 17
Machine NPDA for DFA for context-free regular Construct a new NPDA machine that accepts simulates in parallel and 18
NPDA DFA transition NPDA transition 19
NPDA DFA initial state NPDA Initial state 20
NPDA DFA final states NPDA final states 21
simulates in parallel accepts string and if and only if accepts string and accepts string 22
Therefore: is context-free (since is NPDA) is context-free 23
Example Applications of Regular Closure Prove that: is context-free 24
We know: is context-free 25
We also know: is regular 26
is context-free is regular is context-free 27
Another application Prove that: is not context-free 28
is context-free If Then context-free Therefore, regular Is context-free Impossible!!! is not context free 29
Decidable Properties of Context-Free Languages 30
Membership Question: for grammar find if string 31
Membership Question: for grammar find if string Membership Algorithms: Parsers Exhaustive search parser CYK parsing algorithm 32
Empty Language Question: for grammar find if 33
Empty Language Question: for grammar find if Algorithm: Remove useless variables Check if start variable is useless 34
Infinite Language Question: for grammar find if is infinite 35
Infinite Language Question: for grammar find if is infinite Algorithm: • Remove useless variables • Remove unit and lambda productions • Create the dependency graph for variables • If there is a loop in the dependency graph the language is infinite 36
Example: Dependency graph infinite 37
38
- Decision properties of regular languages
- Decision properties of regular language
- Closure properties of context free languages
- Properties of regular languages
- Closure under union
- Decision properties of context free languages
- Closure properties of regular languages
- The intersection of a cfl and a regular language
- Decision properties of regular languages
- Decision properties of regular languages
- Decision properties of context free languages
- Positive + positive equals
- Positive practice positive outcomes
- Mannitol fermentation
- Chemical and physical properties
- Extensive properties and intensive properties
- Fisker frits fisker friske fisk
- European day of languages quiz
- Cxc it
- If programming languages were cars
- Iat 265
- Epostl descriptors
- Decidable languages
- Xkcd coding
- Why do people preserve local languages
- Languages 意味
- Languages for life and work
- Translators and facilities of languages
- Languages of nepal
- Low level programming language
- Language tool
- Introduction to scripting languages
- Real time programming language
- Formal relational query languages
- Roman achievements that are still used today
- Love language score
- Database languages
- Cornell programming languages
- Languages in the philippines