A well defined theorem called the pumping lemma has been formed to check the non-regularity of a programming language. However, this lemma doesn't show if a language is regular. Some other simple techniques can also be used to check the non-regularity of a language.
Pumping lemma states that for any regular language
These given rules mean that if a particular string of a language is pumped, that is, if a part v of the string is repeated i number of times, it still remains a part of the language.
The lemma gives a result in the form of a contradiction. We suppose that a given instance (string) of a language is regular, and we contradict our supposition because the pumped string will not be a part of the language.
Let's look at an example of this:
Let
Take
We divide x in such a way that
Taking i = 0:
Since the string is not a part of the language, we can say that our initial supposition is wrong and that the language
Let's look at another example:
Taking
Taking i = 2:
Again, we see that the string is not a part of the language, so we can say that our initial supposition is wrong and that the language
e.g.
e.g.
e.g.