A variable-based grammar is a tuple
where and are disjoint finite sets of terminals and variables, , and each production has with at least one variable in .
Choose a new start variable . The concatenation grammar is
Indeed, its derivations first produce a word from and a word from in their original order, so .
For the regular concatenation grammar, let
Then define
If and are regular, every nonterminal rule retained from is right-linear, and each replaced terminal rule is also right-linear. A regular derivation in uses exactly one terminal rule, at its final step; the replacement transfers control to , after which a word of is generated. Hence
Let
Both are regular grammars and their variable sets are disjoint. Their ordinary concatenation grammar adds a new rule
This rule has two variables on its right-hand side, so it is not right-linear. Thus this is an explicit instance in which the concatenation grammar need not be regular.
Take
and
These are variable based and have disjoint variable sets. They satisfy
In , however, both terminal productions of are replaced:
Consequently its only terminal derivation is
so
This realizes the failure of the regular concatenation construction for a nonregular grammar: two different terminal productions introduce two copies of .

Articles by others on the same topic (0)

There are currently no matching articles.