您对泵引理并不完全清楚。
泵引理说了什么:
正式定义:常规语言的泵送引理 http://en.wikipedia.org/wiki/Pumping_lemma_for_regular_languages#Formal_statement
Let L
成为常规语言。那么存在一个整数p
≥ 1
仅取决于L
这样每个字符串w
in L
至少长度p
(p
被称为"pumping length"
)可以写成w
= xyz
(i.e., w
可以分为三个子串),满足以下条件:
-
|
y
| ≥ 1
-
|
xy
| ≤
p
- for all
i
≥ 0
, xy
i
z
∈
L
但这个声明说的是:
如果一种语言确实是常规语言,那么一定有some way生成(pump) 新字符串来自all 足够大的字符串.
Sufficiently large string means, a string in language that is of the length ≥ P.
So it may not be possible to generate new string from small strings even if language is Regular Language
Some way means, if language is really a regular and our choice of w
is correct. Then there should be at lest one way to break w
in three parts xyz
such that by repeating(pumping) y
for any number of times we can generate new strings in the language.
correct choice of w
means: w
in language and sufficiently large ≥ P
note:在第二点中,即使你打破了,也有可能w
正确进入xyz
根据正式定义,仍然有一些新生成的字符串不是语言中的。正如你所做的那样.
在这种情况下,您将重试其他一些可能的选择y
.
在你选择的字符串中w
= "0000“你可以打破w
这样y = 00
。而有了这样的选择y
您总是会在语言中找到一个新生成的字符串,即“偶数个零”
One mistake you are doing in your proof that you are doing for a specific string 0000. You should proof for all w
≥ P. So still your proof is incomplete
阅读我的这个答案在常规语言的抽取引理的背景下 https://stackoverflow.com/questions/11832371/to-make-sure-pumping-lemma-for-infinite-regular-languages-only/13539823#13539823
在那个答案中,我已经解释过打破w
into xyz
和泵送y
means 查找循环部分并重复循环部分以生成新字符串在语言中。
当我们证明某种语言是正规的;那么实际上我们不知道循环部分在哪里,因此我们尝试满足泵引理规则 1,2 和 3 的所有可能选择。
泵引理说,如果语言是规则的且无限的,那么 DFA 中一定有一个循环,并且语言中每个足够大的字符串都经过循环部分(根据鸽巢原理 http://en.wikipedia.org/wiki/Pigeonhole_principle)的 DFA(因此y
不能为空。这是上面正式定义中的规则 1)。
想想,循环可以在初始位置或结束位置等等x
and z
可以是空字符串。
但实际上我们不知道循环在 DFA 中落在哪里,所以我们尝试了所有可能的方法。
证明一种语言是正规的: 你要证明这一点all足够长的字符串