Published: 2021-12-22
Extending Regex Derivatives to Context Free Grammars or Simpler Context Free Grammars Explained. We show that Context Free Grammars are really just recursive regular expressions, which means we only need to introduce a lookup or link operator to regular expressions to get Context Free Grammars. Brzozowski's derivatives for regular expressions can be extended with new operators such as AND, NOT and interleave, but also a lookup operator which is used for Context Free Grammars. We also introduce simplification rules and show how to apply them using an example. We explain what Smart constructors are and show how to use them to optimize the application of simplification rules. We give a tutorial on Memoization, which is used as an optimization strategy to lazily build a Deterministic Finite Automaton (DFA). We do all this using a Raga from Indian Classical Music as an example. We give a small introduction to Indian classical music and how it compares to western music.
References: