Consider the following language over Σ= {a,b,c,d)
L is Non-regular, On context free language (because if the string starts with a single
a
then after it the number of b,c,d should be equal and in that order.),
L , though, Not Regular and Non context free language, satisfies Pumping lemma of
Regular languages.
And Pumping Length will work for it.
Let’s write L as Union of two languages A,B i.e.
localid="1662033940796" and
B={ a i w |w∈{b, c,d}∗∧i≠1}
Let P=10 be the pumping lemma constant, so now pick any string s from L of
length , there will be two cases here:
s is chosen from B , then we can pick the first two symbols from s to pump.
s is chosen from A , then we can pick the first symbol i.e. a , to pump.
Hence, L satisfies the pumping lemma condition of Regular languages. So, it will
also satisfy the pumping lemma condition of context free languages.
But, L is non context free language.
So, A Non context free language may satisfy both the pumping lemma conditions
(of Regular and context free language).