[英]Would it be possible for a non-context-free language L to be context-free under iteration?
Language L is not a context-free language. 语言L不是无上下文的语言。
But could L* be a context-free language? 但L *可以是一种无语境的语言吗?
Yes, this is possible. 是的,这是可能的。 As an example, consider the alphabet Σ = {1} and let L be the language { 1 p |
例如,考虑字母表Σ= {1}并且让L为语言{1 p | p is a prime number }.
p是素数}。 You can prove that this language is not context-free by using the pumping lemma.
通过使用泵浦引理,您可以证明该语言不是无上下文的。
However, the language L* is the set of all strings except for 1. The reason for this is that 但是,语言L *是除1之外的所有字符串的集合。原因是这样
This language is indeed context-free, and you can prove that by writing a grammar for it. 这种语言确实没有上下文,你可以通过为它编写语法来证明。
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.