简体   繁体   English

非常简单的正则表达式的抽取引理

[英]pumping lemma for very simple regular expression

Pumping lemma definition (from wiki) 抽引引理定义(来自Wiki)

Let L be a regular language. 令L为常规语言。 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 (ie, w can be divided into three substrings), satisfying the following conditions: 然后,存在一个仅依赖于L的整数p≥1,从而长度L中长度至少为p的每个字符串w(p称为“泵送长度” [4])可以写成w = xyz(即w可以是分为三个子字符串),满足以下条件:

|y| | y | ≥ 1; ≥1; |xy| | xy | ≤ p for all i ≥ 0, xyiz ∈ L 对于所有i≥0,≤p,xyiz∈L

Suppose I want to test regular expression 011 Since it is regular expressionm, there is string w for at least length p that satisfy w=xyz 假设我要测试正则表达式011,因为它是正则表达式m,所以至少有长度w满足w = xyz的字符串w

The number of this automata is 3, p should be >= 3 But only string that accept this automata is 011 So I pick 011 as w I can break up 3 part 011 = xyz but how can I break? 这个自动机的数目是3,p应该> = 3,但是只有接受该自动机的字符串是011,所以我选择011,因为w可以分解3个部分011 = xyz,但是如何分解? I cannot satisfy |y| 我不能满足| y | ≥ 1; ≥1; |xy| | xy | ≤ p for all i ≥ 0, xyiz ∈ L 对于所有i≥0,≤p,xyiz∈L

Since it is only accept 011 How can I pump? 由于只接受011我如何泵送? Where am I wrong 我哪里错了

Let p be 4. Then there are no strings w in L of length at least p , so any statement of the form "Every string w in L of length at least p […]" will be vacuously true . p是4.然后有没有串w的长度L的至少P,这样的形式“每列W的长度L的至少P [...]”将是任何声明空洞地真实 So the pumping lemma is satisfied. 因此,满足了抽奖引理。

Pumping lemma is generally applicable to infinite regular languages. 抽动引理通常适用于无限规则语言。 And is not used to prove L is regular It is used to prove L is not regular But it satisfies for all infinite regular languages 并不用来证明L是正规的用来证明L不是正规的,但是它满足所有无限的正规语言

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM