Determine if a language is context free

早过忘川 提交于 2019-12-13 22:30:55

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/28688168/determine-if-a-language-is-context-free

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!