Simplification of Context-Free Grammars
Before a grammar can be put into a standard shape, clear out the dead rules, the empty rules and the rules that only rename.
What this unit covers
Unit 4: Formal Grammars and Context-Free Languages
- 1 Formal Grammars and the Chomsky HierarchyAutomata check sentences; grammars write them, and four kinds of grammar sort every language into a ladder. · 21 min
- 2 Context-Free Grammars, Derivations and Parse TreesThe same sentence can be built in many orders, but a parse tree records only what was built, not when. · 15 min
- 3 Ambiguity in Context-Free GrammarsAn expression grammar that gives 2 + 3 × 4 two parse trees leaves the order of operations undecided, and one extra level of variables settles it. · 15 min
- 4 Simplification of Context-Free GrammarsBefore a grammar can be put into a standard shape, clear out the dead rules, the empty rules and the rules that only rename. · 15 min
- 5 Normal Forms: Chomsky Normal Form and Greibach Normal FormEvery context-free grammar can be rewritten so that each rule has the same tidy shape, and tidy shapes make proofs and parsers simple. · 21 min