Closure properties!

269 Views Asked by At

If $L_{1}$ is a context-free language and $L_{2}$ a regular one,use the closure properties and explain if the language $L_{2}-L_{1}$ is also context-free or not.How can I do this?

1

There are 1 best solutions below

6
On BEST ANSWER

If you insist on the order $L_2 - L_1$ where $L_1$ is context-free, then it suffices to consider the special case $L_2=\Sigma^*$ to find an example where the difference of the two languages is not context-free.

If the order is the other way $L_1 - L_2$ then rewriting into $L_1 \cap (\Sigma^* - L_2)$ makes it possible to apply the fact that CFL are closed under intersection with regular languages.