Find CSG for $L = \{a^ib^jc^k \mid 0 \leq i \leq j \leq k\}$ I am trying to find a context sensitive grammar for the type-1 language 

$L = \{a^ib^jc^k \mid 0 \leq i \leq j \leq k\}$

I can construct the first part with

\begin{align*}
S &amp;\to aSbB \mid B \mid \epsilon\\
B &amp;\to bB \mid \epsilon\\
\end{align*}

but how do I continue from there? I tried

\begin{align*}
S &amp;\to aSbBcC \mid B \mid \epsilon\\
B &amp;\to bBcC \mid \epsilon\\
CB &amp;\to BC \\
C &amp;\to cC
\end{align*}
but this does not seem to work e.g. $S \to aSbBC \to aaSbBCbBC \to aabBCbBC$
$$
\begin{align*}
S &amp;\to XABS' \mid XBS' \mid XS' \mid XAB \mid XB \mid X \mid \epsilon \\
S' &amp;\to ABCS' \mid BCS' \mid CS' \mid C \\ \\
BA &amp; \to AB \\
CA &amp; \to AC \\
CB &amp; \to BC \\ \\
XA &amp;\to aX \\
X &amp;\to Y \\
YB &amp;\to bY\\
Y &amp;\to Z \\
ZC &amp;\to cZ \\
Z &amp;\to c
\end{align*}
$$

For the intuition behind this construction see this question.