What is the grammar for language $L = \{ a^nb^m : n\neq m-1\}$?
I only know I have to write grammar for both $ n<m-1 $ and $ n>m-1 $, so this is what I wrote:
For $n<m-1$: \begin{align} &S\to Abb \\ &A\to aAb \mid \lambda \end{align}
For $n>m-1$: \begin{align} &S\to aaA \\ &A\to aAb \mid \lambda \end{align}
Yet I can not mix them and get a correct grammar for $L$.