I've a set of grammar rules like this:$$\begin{align*}&S \to AbB \\&A \to aA|\epsilon \\&B \to aB|bB|\epsilon\end{align*}$$The grammar generates the following words:$$\begin{gather*}AbB \to a^2AB \to a^3AB \to \cdots \to a^nAB \to a^nB \to \\\to a^nB \to a^nbB \to a^nb^2B \to \cdots \to a^nb^mB \to a^nb^m,\end{gather*}$$so if I did things right, $L(G) = a^n b^m$.I think that $G$ is a type 1 grammar.Now I need to design a more restrictive type of grammar that generates the same expression, and I'm stuck. Any help is much appreciated.My attempt according to the collapsar's answer: $$\begin{align*}&S \to aSA|b \\&A \to a|b \\&\end{align*}$$
Designing a different grammer that generates same expression
formal languages;formal grammars