The Gateway to Computer Science Excellence
+2 votes

Suppose that L is Context free and R is Regular.

  • $A$)  $L – R$ is necessarily Context free
  • $B$)  $R – L$ is necessarily Context free

Which of the above statement/s is/are true?

in Theory of Computation by
retagged by | 161 views
is it only $A$ ?
Yes, and 2nd one is false for CFL and even RE but not for others.

A) True

B) False ( not necessarily), because CFL is not closed under complementation. R-L = R INTERSECTION L'
if L is DCFL , then B) is also true.

As DCFL closed under complement
@kapil u meant R-L is not R.E when L is RE right ? and true when L is recursive right ?
If possible pease support ur answer with an example. It'll be helpful indeed. :)

1 Answer

+1 vote
1) It's closure property. CFL is closed under Regular difference (Even every language is closed under regular difference).

2) R-L is not any standard thing , we have to do calculations to know about this so we can't say anything.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,315 questions
60,416 answers
95,215 users