All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2018

Consider to be any regular language and L , L 1 2 be any two context-free languages. Which one of the following is correct?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. L₁ − R is context free

Explanation

CFLs are not closed under complement or intersection, but L₁ − R = L₁ ∩ R̄ is a CFL intersected with a regular set, which is context free.

More Theory of Computation and Compilers questions