I am reading the book "Discrete Mathematics and Its Applications" written by Kenneth Rosen. I've encountered some troubles.
When it introduced the type-2 of phrase-structure grammar to me, it just told me the productions should only have the form A → γ, where A is a single symbol that is not a terminal symbol. So what about γ and can it have the production S → λ without any restriction?
Second, it showed me an example, it constructed a grammar G=(V,T,S,P) to generate the set {0n1n2n∣ n = 0,1,2,3,…}, where V = {0,1,2,S,A,B,C}; T = {0,1,2}; starting state S; and productions P={S → C, C → 0CAB, S → , BA → AB, 0A → 01, 1A → 11, 1B → 12, 2B → 22}. And it told me such grammar G is a context-sensitive grammar, that is, type 1 grammar. I think it is wrong. First, I think the productions P is incorrect, the term S → should be C → λ, or the term C → 0CAB should be C → 0SAB, otherwise the nonterminal C would always exist. And then, the grammar would not be type 1 grammar, because γ in αAβ→αγβ cannot be empty and S→λ allowed only if S never appear on the right-hand of any production. Am I right?