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.
The grammars are non-equivalent. In the first grammar, terminal derivations without give
After applying any number of times while and remain adjacent, the production also gives
Hence, in particular, and .
In the second grammar, the fixed terminals in prevent and from ever becoming adjacent, so can never be used. The remaining productions give exactly
Thus , proving that the generated languages differ.
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.

Articles by others on the same topic (0)

There are currently no matching articles.