上下文无关语言问题(泵引理)
我知道这与编程没有直接关系,但我想知道是否有人知道如何将泵引理应用于以下证明:
表明L={(a^n)(b^n)(c^m) : n!=m}不是上下文无关语言
我对应用泵引理非常有信心,但是这真的让我很恼火。你怎么认为?
I know this isn't directly related to programming, but I was wondering if anyone know how to apply the pumping lemma to the following proof:
Show that L={(a^n)(b^n)(c^m) : n!=m} is not a context free language
I'm pretty confident with applying pumping lemmas, but this one is really irking me. What do you think?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:我完全把你引入了错误的轨道。当我自己没有完全解决问题而试图提供帮助时,就会发生这种情况。
奥格登引理
假设 L 是上下文无关的。根据奥格登引理,存在一个具有以下属性的整数 p:
给定 L 中至少 p 个符号长的字符串 w,其中至少 p 个这些符号被“标记”,w 可以表示为 uvxyz,它满足:
这是奥格登引理。现在,令 q 为可被每个不大于 p 的正整数整除的整数。令 w = ap+q bp+q cp。标记每个 c。根据#2,u 或v 必须至少包含一个c。如果 u 或 v 包含任何其他符号,则 #4 失败,因此 u 和 v 必须仅包含 c。但是当 i = q/|uv| 时#4 失败。我们知道 q 可以被 |uv| 整除因为p> |紫外线| > 0,q 可被所有小于 p 的正整数整除。
请注意,当您标记所有符号时,奥格登引理将变成泵送引理。
泵引理
假设 L 是上下文无关的。根据泵引理,存在长度 p(不一定与上面的 p 相同),使得 L 中的任何字符串 w 都可以表示为 uvxyz,其中
u vi x yi z 在 L中, n或m<名词假设p=2。
假设m>2。名词(请注意,Λ 表示空字符串。)
假设 n >米。
这证明 L 中的任何字符串都没有使用泵引理提供反例来假设 L 是上下文无关语言(即使它是上下文敏感的)。
Edit: I was totally leading you down the wrong track. That's what happens when I try to help out when I haven't completely solved the problem myself.
Ogden's Lemma
Suppose L is context free. By Ogden's lemma, there exists an integer p that has the following properties:
Given a string w in L at least p symbols long, where at least p of those symbols are "marked", w can be represented as uvxyz, which satisfy:
That's Ogden's lemma. Now, let q be an integer divisible by every positive integer no greater than p. Let w = ap+q bp+q cp. Mark every c. By #2, u or v must contain at least one c. If either u or v contains any other symbol, then #4 fails, so u and v must contain only c. But then #4 fails when i = q/|uv|. We know q is divisible by |uv| because p > |uv| > 0, and q is divisible by all positive integers less than p.
Note that Ogden's lemma turns into the pumping lemma when you mark all symbols.
Pumping Lemma
Suppose L is context free. By the pumping lemma, there is a length p (not necessarily the same p as above) such that any string w in L can be represented as uvxyz, where
Given a string w in L, either m > n or m < n. Suppose p = 2.
Suppose that m > n. (Note that Λ denotes the empty string.)
Suppose that n > m.
This demonstrates that no string from L provides a counterexample using the pumping lemma to the supposition that L is a context free language (even though it is context sensitive).