Prove that $L=\{a^nb^nc^md^m \mid m,n >=0\}$ is context free language

4.9k Views Asked by At

I'm trying to write the grammar of this language, in order to prove that it is CFL but I'm stuck because m or n could be 0. The language is:

$L=\{a^nb^nc^md^m \mid m,n >=0\}$ .

If they were necessarily bigger than 0 then I would write:

S-> aSbT | epsilon

T -> cTd | epsilon

Can someone help me please?

1

There are 1 best solutions below

0
On BEST ANSWER

S -> NM

N -> aNb | epsilon

M -> cMd | epsilon