Prove that this language is not regular (using Pumping Lemma)

In summary, the language CRYPT is not regular because there exists a word in the language that cannot be pumped using the pumping lemma. This is due to the fact that the grammar allows for any nonempty prefix of the function name for SIMPLESUB, VIGENERE, and LOCTRAN, which can be used to construct a word longer than the pumping length.
  • #1
Mr10k
Homework Statement
Let CRYPT be the language of cryptographic expressions of this type that can be generated by the following grammar.

S → E
S → ε
E → E + E
E → E − E
E → SIMPLESUB(E, STRING)
E → VIGENERE(E, STRING)
E → LOCTRAN(E, DIGITS)
E → STRING

In this grammar, the non-terminals are S and E. Treat SIMPLESUB, VIGENERE, LOCTRAN, STRING and DIGITS as just single tokens. For SIMPLESUB, VIGENERE, and LOCTRAN, we allow any nonempty prefix of the function name as well as the full name; e.g., S, Si, Sim, . . . , SimpleSu, SimpleSub are all acceptable lexemes for the token SIMPLESUB.

Prove that CRYPT is not regular.

An example of an input string could be:

Vigenere(LocTran(triantiwontigongolope,3201),bunyip) + muldjewangk

The attempt at a solution


So where I am confused here is that when using the pumping lemma to form a word such that w = xyz, there needs to be a case where w = xyiz cannot be pumped into CRYPT. The reason why it is confusing is because any STRING is part of CRYPT as stated by the expression E → STRING, so how can I find a word such that by using the pumping lemma I can prove that CRYPT is not regular?
 
Physics news on Phys.org
  • #2


You are correct that any STRING is part of CRYPT, which means that any word in the language can be pumped. However, this does not necessarily mean that the language is regular.

To prove that CRYPT is not regular, you can use the pumping lemma to show that there exists a word in the language that cannot be pumped. This word will have a length that is greater than the pumping length (p) of the language, and therefore cannot be pumped into CRYPT.

To find such a word, you can use the fact that the grammar allows for any nonempty prefix of the function name for SIMPLESUB, VIGENERE, and LOCTRAN. This means that you can construct a word that is longer than p by repeatedly adding prefixes of these function names to the beginning of the word.

For example, the word Vigenere(LocTran(triantiwontigongolope,3201),bunyip) + muldjewangk has a length of 64, which is greater than p. Therefore, this word cannot be pumped into CRYPT, and the language is not regular.
 

What is the Pumping Lemma?

The Pumping Lemma is a tool used to prove that a language is not regular. It states that if a language is regular, then there exists a constant p such that any string in the language with a length of at least p can be split into three parts, x, y, and z, where y is non-empty and the concatenation of x and y can be pumped to create additional strings in the language.

How do I use the Pumping Lemma to prove a language is not regular?

To use the Pumping Lemma, you must assume that the language in question is regular and then use the lemma to find a contradiction. This is typically done by choosing a string in the language that is longer than p and showing that it cannot be pumped according to the conditions of the lemma, therefore proving that the language is not regular.

What are the main steps in using the Pumping Lemma to prove a language is not regular?

The main steps are as follows:

  • Assume the language is regular.
  • Choose a string in the language that is longer than p.
  • Split the string into x, y, and z according to the conditions of the lemma.
  • Show that the pumped string is not in the language, leading to a contradiction.
  • Conclude that the language is not regular.

Can the Pumping Lemma be used to prove that a language is regular?

No, the Pumping Lemma can only be used to prove that a language is not regular. It is not a sufficient condition for proving regularity.

Are there any limitations to using the Pumping Lemma?

Yes, the Pumping Lemma can only be used to prove that a language is not regular. It cannot be used to prove that a language is regular or to compare the regularity of two languages. It also does not work for all types of languages, such as context-sensitive or context-free languages.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Programming and Computer Science
Replies
9
Views
7K
  • Programming and Computer Science
Replies
13
Views
3K
  • STEM Academic Advising
Replies
13
Views
2K
Back
Top