440 likes | 623 Views
Context-free Languages. ReviewA language is context-free if it can be generated by a context-free grammar (cfg) or recognized by a pushdown automaton (pda)A context-free grammar is one in which every production is of the form: X ? w that is, of the form in which the left-hand side is a single
E N D
1. Finishing up context-free languages Review
properties of cfls
material covered in Chapters 5-8
2. Context-free Languages Review
A language is context-free if it can be generated by a context-free grammar (cfg) or recognized by a pushdown automaton (pda)
A context-free grammar is one in which every production is of the form: X ? wthat is, of the form in which the left-hand side is a single variable and the right-hand side is any string of variables and terminals.
3. Context-free Languages Review
a cfg production X ? xXy generates from the center and produces an equal number of xs and ys
the cfg productions X ? xY, Y ? xYy will generate more xs than ys.
the cfg productions X ? aXa | bXb generates palindromic strings.
x ? y is the same as x > y or x < y
4. Context-free Languages Review
Derivation trees
Derivations
Left-most and right-most derivations
Ambiguity (grammars)
Inherent Ambiguity (languages)
{anbmcm} ? {anbncm} is INHERENTLY AMBIGUOUS!
There has to be at least two ways to generate abc since it could be in the language because the b's equal the c's, or because the a's equal the b's
5. Context-free Languages Review ? rules (X ? ?) unit rules useless productions