0

i have a problem with an exercise:

L = {an bm cp | 1 <= n <= m <= p}

Is it possible write a grammar for that exercise ?

I do not understand how to solve it :( please help me

apaderno
  • 28,547
  • 16
  • 75
  • 90
egos
  • 35
  • 5

1 Answers1

0

The language meets the conditions of the context-free pumping lemma (for any string in the language, you can choose to pump the c's, and the resulting string remains in the language), but that's not sufficient to prove that the language is context-free.

Ogden's lemma should work, though. For a sufficiently long input string, you can choose the "distinguished positions" to be all a's, which forces the a's to be pumped, and eventually the string will be "pumped out of the language" when the number of a's exceeds the number of b's or c's.

Jim Lewis
  • 43,505
  • 7
  • 82
  • 96
  • 1
    Can you write the grammar of this Language, please ? – egos Feb 23 '14 at 12:58
  • That sounds too much like real work, and for what purpose? Consider the language of base-10 numerals that are divisible by three. It's a regular set, therefore there exists a regular expression that recognizes it, but it is surprisingly complicated to write down, and doesn't give you any real insight into the properties of the language. Grammars are good for understanding context-free languages, but when you get to the complexity level of context-sensitive and above, as in this case, you're probably better off trying to construct an appropriate automaton, rather than a grammar. – Jim Lewis Feb 23 '14 at 17:42