Pumping lemma for context-free languages
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Pumping lemma for context-free languages
The pumping lemma for context-free languages, also known as the Bar-Hillel lemma, is a lemma that gives a property that all context-free languages have. Its primary use is to prove a language is not context-free. The pumping lemma for context-free languages cannot be used to prove that any arbitrary non-context-free language is not context-free. In some cases the more generalized Ogden's lemma must be used.
Formal statementIf a language L is context-free, then there exists some integer p > 0 such that any string s in L with |s| ? p (where p is a pumping length) can be written as
with substrings u, v, x, y and z, such that |vxy| ? p, |vy| ? 1, and
Informal statement and explanationThe pumping lemma for context-free languages (called just "the pumping lemma" from now on) describes a property that all context-free languages are guaranteed to have. The property is a property of all strings in the language that are of length at least p, where p is a constant -- called the pumping length -- that varies between context-free languages. Say s is a string of length at least p that is in the language. The pumping lemma states that s can be split into five substrings, s = uvxyz, where vy is non-empty and the length of vxy is at most p, such that repeating v and y any (and the same) number of times in s produces a string that is still in the language (it's possible and often useful to repeat zero times, which removes v and y from the string). This process of "pumping in" additional copies of v and y is what gives the pumping lemma its name. Note that finite languages (which are regular and hence context-free) obey the pumping lemma trivially by having p equal to the maximum string length in L plus one. The pumping lemma is often used to prove languages non-context-free by showing that some string s in the language of length at least p does not have the properties outlined above, i.e. that it cannot be "pumped" without producing some strings that are not in the language. Use of lemmaThe pumping lemma for context-free languages can be used to show that certain languages are NOT context-free. We can show that the language L = {ajbjcj, j>0} is NOT context-free.
See alsoReferences
cs:Lemma o vkládání de:Pumping-Lemma he:??? ?????? ????? ??????? ???? hr:Svojstvo napuhavanja za kontekstno neovisne jezike it:Pumping lemma per i linguaggi liberi dal contesto ja:??????????? ko:?? ?? mk:??????? ???? ?? ????????? ???????? ????????? pl:Lemat o pompowaniu dla j?zyków bezkontekstowych zh:??? fr:Lemme de l'étoile Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement