上下文无关语言问题(泵引理)

发布于 2024-08-28 13:58:09 字数 169 浏览 8 评论 0原文

我知道这与编程没有直接关系,但我想知道是否有人知道如何将泵引理应用于以下证明:

表明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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清醇 2024-09-04 13:58:09

编辑:我完全把你引入了错误的轨道。当我自己没有完全解决问题而试图提供帮助时,就会发生这种情况。

奥格登引理

假设 L 是上下文无关的。根据奥格登引理,存在一个具有以下属性的整数 p:

给定 L 中至少 p 个符号长的字符串 w,其中至少 p 个这些符号被“标记”,w 可以表示为 uvxyz,它满足:

  1. x至少有一个标记符号,
  2. 要么 u 和 v 都有标记符号,要么 y 和 z 都有标记符号,
  3. vxy 最多有 p 个标记符号,并且
  4. u vi x yi z 在 L 中,因为 i >= 0

这是奥格登引理。现在,令 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,其中

  1. |vxy| <= p,
  2. |vy| >= 1,并且
  3. 因为 i >= 0。

u vi x yi z 在 L中, n或m<名词假设p=2。

假设m>2。名词(请注意,Λ 表示空字符串。)

  • 设 u = an bn cm-1
  • 设 v = c
  • 设 x = Λ
  • 设 y = Λ
  • 设 z = Λ

假设 n >米。

  • 设 u = an-1
  • 设 v = a
  • 设 x = Λ
  • 设 y = b
  • 设 z = bn-1 cm

这证明 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:

  1. x has at least one marked symbol,
  2. either u and v both have marked symbols or y and z both have marked symbols,
  3. vxy has at most p marked symbols, and
  4. u vi x yi z is in L for i >= 0

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

  1. |vxy| <= p,
  2. |vy| >= 1, and
  3. u vi x yi z is in L for i >= 0.

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

  • Let u = an bn cm-1
  • Let v = c
  • Let x = Λ
  • Let y = Λ
  • Let z = Λ

Suppose that n > m.

  • Let u = an-1
  • Let v = a
  • Let x = Λ
  • Let y = b
  • Let z = bn-1 cm

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文