One parse tree can be recorded unambiguously by the nested expression
Every internal node uses one of the given productions, and the leaves read from left to right are
Equivalently, the corresponding leftmost grammar derivation is
Hence the required word is generated by the grammar.
For the formal grammar ,
Thus contains exactly the finite terminal words reachable from the start symbol by a finite grammar derivation.
We prove the claim by induction on the length of the grammar derivation from . At length zero the sentential form is , which has the required form.
Suppose the current sentential form is . Because is terminal, the only symbol to which a production can apply is . A production produces
again a terminal word followed by one variable. A production produces the terminal word . Once a completely terminal word is reached, no further production can apply. The induction proves the sentential form of a right-linear regular grammar: every reachable is either or .
Production rule 2026-09-29
A production rule specifies a permitted replacement during a grammar derivation. In a context-free grammar it has the form , with one nonterminal on the left.