A variable-based grammar is a tuplewhere 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 isIndeed, its derivations first produce a word from and a word from in their original order, so .
For the regular concatenation grammar, letThen defineIf 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
LetBoth are regular grammars and their variable sets are disjoint. Their ordinary concatenation grammar adds a new ruleThis 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.
TakeandThese are variable based and have disjoint variable sets. They satisfyIn , however, both terminal productions of are replaced:Consequently its only terminal derivation issoThis 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
There are currently no matching articles.