-1

Lets say you have a language L and you want to determine if it is context free. Context free languages intersected with regular languages are context free. Is that enough to prove that L is context free?

Meaning,

L intersect P = T Where P is a regular language and T is context free. Does this imply that L is context free?

John Smith
  • 99
  • 1
  • 2
  • 13

1 Answers1

0

No, your statement is not true. Consider the following counter-example:

L = {0n1n2n | n > 0}, P = T = Ø. Clearly we have L ∩ P = L ∩ Ø = Ø = T, and Ø is both regular and context-free.

Note it is well-known that L is not context-free (see example on p.12 for a sketch proof by pumping lemma).

chiwangc
  • 3,566
  • 16
  • 26
  • 32
  • @JohnSmith `L` can be proved to be non context-free by pumping lemma (see the link for reference), `Ø` can be recognised by the empty regular expression, so it is regular. And all regular languages are context-free, so `Ø` is also context-free – chiwangc Feb 24 '15 at 04:56