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
S->Abb
A->aAb|lambda
for n>m-1
S->aaA
A->aAb|lambda
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 grammergrammar for it$L$.