cfg for l = {a^mb^nc^k:k = m× n}
我们可以为此语言编写CFG吗?我搜索了多个网站,但找不到任何答案。
Can we write CFG for this language? I searched multiple websites but I couldn't find any answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们可以证明,使用泵送引理的无上下文语言,这不是不含上下文的。
假设该语言是无上下文的。然后,我们可以用语言编写任何字符串w,因为w = uvxyz where | vxy | < = p,| vy | > 0,对于所有整数k> = 0,u(v^k)x(y^k)z也是语言中的字符串。
考虑字符串a^(2p)b^(3p)c^(6p^2)。这是我们语言的字符串,因为2p x 3p = 6p^2。现在,考虑放置子字符串VXY:
在所有五种可能的情况下,我们都认为平等在抽水时无法保持平等(选择k = 0),因此无法将其串泵向下。但是,语言不能无上下文。
We can prove this is not context-free using the pumping lemma for context-free languages, as follows.
Assume the language were context-free. Then we'd be able to write any string w in the language as w = uvxyz where |vxy| <= p, |vy| > 0 and for all integers k >= 0, u(v^k)x(y^k)z is also a string in the language.
Consider the string a^(2p) b^(3p) c^(6p^2). This is a string in our language since 2p x 3p = 6p^2. Now, consider the five cases for the placement of the substring vxy:
In all five possible cases we see the equality cannot be maintained while pumping down (choosing k = 0) and so our string cannot be pumped down. But then the language cannot be context-free.