I am struggling to think of the context-free grammar that generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$, where $i$, $j$ and $m$ are natural numbers.
Also, in general, are there any good methods or ways of thinking that help one to think of context free grammars that generate a given language. Any tips are much appreciated, thanks.
EDIT: I've tried S →ABCD, A →aA | λ, B →bB | λ, C →ccC | λ, D →dD | λ
However, this doesn't allow for always generating twice the amount of c's as there are a's.