I've searched and searched and can't find a similar CFG. I've got this language:
$$L=\{a^nb^mc^rd^t:n+m=r+t\}$$
Basically, I have to have the same amount of $a$'s and $b$'s as I have $c$'s and $d$'s. I've gotten close, but the production rules I've come up with don't take into consideration the order. i.e. $badc$ is not a valid string in the language. The $a$'s must come before the $b$'s and the $c$'s before the $d$'s.
Any help would be greatly appreciated.
PS Sorry I don't know how to use the math formatting.