A formal grammar is said to be linear if each of its productions has the form , where is a non-terminal, and is a word over containing no more than one occurrence of a non-terminal. In other words, a production in has one of the following forms:
(the empty word)
, where is a terminal word (over the set of terminal symbols ), or
, where are terminal words, and is a non-terminal symbol (in ).
A langauge generated by a linear grammar is called a linear language.
Furthermore, every regular language is linear, since any production of a regular grammar has one of the above three forms, except in the last form. The converse is also not true. For example, the language is known to be not regular (apply the pumping lemma), but it is linear, generated by the following productions , .
It can be shown that a language is linear iff it can be generated by a 1-turn pushdown automaton (once it starts popping, it never pushes again).
As we have seen above, a regular grammar is a more restricted form of a linear grammar. Various restrictions may be placed on a linear grammar :
is right linear if is the third form above (so a regular grammar is also known as a right linear grammar)
is strong right linear if it is right linear, and there are no productions of the second form
is left linear if in the third form above
is strong left linear if it is left linear, and there are no productions of the second form
However, it can be shown that all of the restricted types of linear grammars mentioned above are equivalent, in the sense that a language generated by one restricted type can be generated by all other restricted types.
Remark. Subfamilies of the family of linear languages can be formed by putting restrictions on the linear grammars. In some cases, the subfamily formed properly sits between the family of regular languages and the family of linear languages. Here are some examples: let be a linear grammar,
is minimal if , and there is exactly one production of the form , where such that occurs in no other productions. Therefore, if is another production of , then , and does not occur in .
is even if every production having the third form above () has the property that (same length). It can be shown that every regular language can be generated by an even linear grammar, and that the converse is not true.
is deterministic if every production has the form , where , and is either the empty word , or in . Furthermore, every corresponds to at most one production.
- 1 S. Ginsburg, The Mathematical Theory of Context-Free Languages, McGraw-Hill, New York (1966).
- 2 H.R. Lewis, C.H. Papadimitriou, Elements of the Theory of Computation. Prentice-Hall, Englewood Cliffs, New Jersey (1981).
- 3 J.E. Hopcroft, J.D. Ullman, Formal Languages and Their Relation to Automata, Addison-Wesley, (1969).
|Date of creation||2013-03-22 18:55:55|
|Last modified on||2013-03-22 18:55:55|
|Last modified by||CWoo (3771)|
|Synonym||strong left linear|
|Synonym||strong right linear|
|Defines||minimal linear grammar|
|Defines||even linear grammar|
|Defines||deterministic linear grammar|