Definition (Chomsky hierarchy)
Let $G = (Σ, N, P, S)$ be a grammar. A rewrite rule $α\to β$ is of
-
type 0 if $α\in N^+$;
-
type 1 (non-contracting) if $|β| \geq |α|$ and $α\in N^+$;
-
type 2 if $α\in N$ and $|β|\geq 1$;
-
type 3 if it is a terminal rule $A \to a$ or a nonterminal rule $A \to aB$ (for some $A,B\in N$ and $a\in Σ$).
Let $\mathsf{Q}$ be one of these properties.
A grammar is called $\mathsf{Q}$ if all of its rewrite rules are $\mathsf{Q}$.
A language is called $\mathsf{Q}$ if it is produced by a grammar that is $\mathsf{Q}$. This is the Chomsky hierarchy.