recategorized by
1,025 views
0 votes
0 votes

Consider $R$ to be any regular language and $L_1$, $L_2$ be any two context-free languages. Which of the following is correct?

  1. $\overline{L_1}$ is context free
  2. $\overline{(L_1 \cup L_2)} – R$ is context free
  3. $L_1 \cap L_2$ is context free
  4. $L_1 – R$ is context free
recategorized by

2 Answers

2 votes
2 votes

$1.\; \bar{L_1}$  is context free.

$\bullet$ CFLs are not closed under complementation.(DCFL are closed)

So first one is not correct.

$2.\; L_1- R$   is context free.

it can also be written as $L1\cap\bar{R}$  

$\bullet$ regular languages are closed under complementation.

$\bullet$ CFL are closed under intersection with regular language.

So $L_1-R$ is context free.

$3.\;\overline{(L_1UL_2)}-R\;$   is context free.

$\implies (\bar{L_1}\cap\bar{L_2})-R$  

$\bullet$ CFLs are not closed under complementation and moreover not closed under intersection.

So statement 3 is not correct.

only (2) is correct.

1 votes
1 votes

Basic Points :-

  1. CFL is not closed under Intersection
  2. CFL is not closed under complementation
  3. CFL is closed under union
  4. CFL is closed under Intersection with Regular Language
  5. Regular Language is closed under complementation

 $\overline{L_1}$ where L$_1$ is CFL ===> as per point 2, it is not always correct.

$\overline{L_1 \cup L_2}$ where L$_1$ and L$_2$ are CFL ==> L$_1 \cup L_2$ is CFL ==> $\overline{L_1 \cup L_2}$ is not CFL always.

$L_1 \cap L_2$ is not always CFL as per point 1.

$L_1 - R = L_1 \cap \overline{R}  = L_1 \cap R $ ===> always true as per point 4

ref : https://gatecse.in/closure-property-of-language-families/

Related questions

1 votes
1 votes
3 answers
1