a^n b^n as an LR Language #
This file proves that the context-free grammar cfg_anbn for {a^n b^n} is
LR(0), and hence that the language is LR.
Main results #
cfg_anbn_isLRk_zero— the grammarcfg_anbnis LR(0)anbn_is_LRk_zero—{a^n b^n}is generated by an LR(0) grammaranbn_is_LR—{a^n b^n}is an LR language
Rightmost sentential forms of cfg_anbn #
The grammar cfg_anbn has rules S → aSb and S → ε with a single
nonterminal (). Every sentential form has at most one nonterminal,
so every derivation step is automatically rightmost. The reachable
rightmost forms are exactly aⁿ S bⁿ and aⁿ bⁿ.