1
$\begingroup$

i am asking myself the following question:

Assuming: A and B are context-free languages, then A - B (difference) must also be context-free language, right? but I do not know how to prove it.

$\endgroup$
4
$\begingroup$

The complement of a context-free language $L$ is not necessarily context-free, but it is the difference between two context-free languages ($\Sigma^* - L$). (Here $\Sigma$ is the alphabet of $L$.)

See, for example, Is the complement of { ww | ... } context-free? for an example of a context-free language whose complement is not context-free.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.