CFG Derivation


ㅁ sequence of replacements of structure names by layouts on RHS, starting from the **start nonterminal**
Replacement by grammar and transition order determines derivation type
$$w_0 \Longrightarrow^* w_n \,\,\,where \,\, w\in\{V\cup U\}^*$$
Is called a derivation in G of `math: w_n \, from \,\, w_0` with derivation length n - so w is Sentential Form
- Since CFG has ambiguity(make logical error) in derivation order (so we can pre-detect by syntax error)


### Left-most derivation
Always replace(terminalize) left-most variable
### Right-most derivation
Always replace right-most variable
- make different Parse tree


> Top-down approach
> 1. left-recursive grammar - can occur infinite recursive → so make prime and divide to right-recursive
> 2. right-recursive grammar






