The only difference is that the indices 6 and 7 should be interchanged. The following classes of grammars are obtained by gradually increasing the restrictions that the production rules have to obey. If S is in P, then S does not appear in the right-hand side of any production rule. A language is said to be a Type 1 language if there exists a Type 1 grammar that generates the language. The grammar can be modified to be of Type 1 by replacing its production rules with the following ones.
E is assumed to be a new nonterminal symbol.
A language is said to be a Type 2 language if there exists a Type 2 grammar that generates the language. The grammar of Example 1.2.7 is not a Type 1 grammar, and therefore also not a Type 2 grammar. The grammar can be modified to be a Type 2 grammar, by replacing its production rules with the following ones. E is assumed to be a new nonterminal symbol. A language is said to be a Type 3 language if there exists a Type 3 grammar that generates the language.