Isomorphic grammar Created 2026-09-24 Updated 2026-09-24
Two grammars over a common terminal alphabet are isomorphic when a bijection between their nonterminal alphabets maps one start symbol to the other and maps their productions bijectively after being extended to fix every terminal symbol. Isomorphic grammars are equivalent.
Take
where
This grammar is in Weak Chomsky normal form. In the original grammar, occurs only in and has the sole production . Thus every use of
is replaced in by , while every later production is unchanged. Conversely, the ternary production can always be expanded into those two original steps. Therefore is equivalent to in the sense of an equivalent grammar.
Two formal grammars over the same terminal alphabet are equivalent when they generate the same language:
The first grammar generates
because adds two 's and terminates the derivation.
In the second grammar, is a nonproductive nonterminal: every right-hand side of a -production still contains a . Consequently the branch never yields a terminal word. Every terminal derivation from instead uses repeatedly and ends with , so
The grammars are therefore equivalent, although they are not isomorphic.
The grammars are isomorphic. The bijection
maps every production of to the corresponding production of . They are therefore equivalent. Notice that in the first grammar and in the second are unreachable; the isomorphism also preserves this irrelevant component.