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(1), and hence that the language is LR.
Main results #
cfg_anbn_isLRk_one— the grammarcfg_anbnis LR(1)anbn_is_LRk_one—{a^n b^n}is generated by an LR(1) 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ⁿ.