Can this grammar be simplified? So, I have a book here, which has an example for context sensitive grammar, and the grammar is the famous $0^n1^n2^n$ , and it has:

$$ \begin{align}
S  &amp;\rightarrow 0BS2 \mid 012 \\
B0 &amp;\rightarrow 0B \\
B1 &amp;\rightarrow 11 \\
\end{align} $$

I agree that the above works, but what is wrong with just saying:
$S\rightarrow 0S12 |\epsilon$

The above also generators the same number of $0$s as $1$s and $2$s.
Your grammar will generate:
$S\rightarrow 0S12\rightarrow 00S1212\rightarrow 001212$ which is not in the required language.