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
- Consider the following problems : (i) Whether a finite state automaton halts on all inputs ? (ii) Whether a given context free language is…
- Which of the following problems is decidable for recursive languages L?
- Consider the grammar G: S → A | B, A → a | c, B → b | c, with non-terminals {S, A, B} and terminals {a, b, c}. S₁: LR(1) can parse all stri…
- The grammar S → (S) | SS | ε is not suitable for predictive parsing because the grammar is
- Two finite state machines are said to be equivalent if they :
- The finite state machine given in figure below recognizes :