0

I am studying Formal Languages and Automata Theory, and I have a question about a problem inside the book that is not answered in it. the question is:

Is this language Context Free, Regular or Context Sensitive?

L={a^i b^j c^k|i<=j or j<=i , j=k}

a_m
  • 11
  • 3

2 Answers2

0

It's context-free. It can be specified with the following CFG:

S -> AX
A -> aA
A -> epsilon
X -> bXc
X -> epsilon

The A state accepts as many as as you need. X generates b and c in equal quantity. Therefore this CFG specifies the language L.

Welbog
  • 59,154
  • 9
  • 110
  • 123
-1

It's context sensitive.

Not Regular : We have to remember the number of occurences of b or c which finite state machine can't.

Not context free as if we apply pumping lemma you will see we have more b's than c's after pushing b for a string like a^{2}b^{2} b^{n-4}b^{2}c^{n}.

So it is context sensitive.

user2736738
  • 30,591
  • 5
  • 42
  • 56
  • ohh yes...actually some people say that it is DFCL because there is only one comparison j=k and it doesn't matter if i is equal to j or not – a_m Dec 29 '16 at 20:03
  • @a_m.: Really if you think well enough you will see that it is context sensitive. You can try reading a book relaly. My answer is correct. – user2736738 Dec 29 '16 at 20:12
  • @a_m.: applied this https://en.wikipedia.org/wiki/Pumping_lemma_for_context-free_languages – user2736738 Dec 29 '16 at 20:14
  • @a_m.: you understand? – user2736738 Dec 29 '16 at 20:45
  • The language is really not context-free. The application of the pumping lemma, however, is much more complicated than @coderredoc explains. The lemma only proves something, if for ALL POSSIBLE factorizations the pumping leads out of the language, not just for one example factorization. Therefore a careful case analysis is needed here. In the example string one could pump b in oe factor, c in the other, and stay in the language. – Peter Leupold Jan 17 '17 at 11:58