标签:
some books describe pumping lemma as this:
Let L be a regular language. Then there exists an integer p ≥ 1 depending only on L such that every string w in L of length at least p (p is called the "pumping length"[4]) can be written as w = xyz (i.e., w can be divided into three substrings), satisfying the following conditions:
- |y| ≥ 1;
- |xy| ≤ p
- for all i ≥ 0, xyiz ∈ L
Copied from Wikipedia.
However, please note that actually pumping lemma can only be used for infinite regular language.
Some people on stackoverflow also answers this problem:
"You are right - we cannot allow "pumping" words of a finite L. The thing you are missing is that the lemma says there exists a number p, but does not tell us the number.
All words longer than p can be pumped, by the lemma. For a finite L, it happens so that p is larger than the length of the longest word in L. Thus, the lemma only holds vacuously, and cannot be applied to any word in L, i.e., any word in L does not satisfy the condition of "having length at least p" as the lemma requires.
A corollary: if L has pumping length p, and there exists some word w∈L of length at least p, then L is infinite."
pumping lemma for finite regular language?
标签:
原文地址:http://www.cnblogs.com/miaoz/p/4304630.html