I need help deciding whether a given language is regular, contextual, or non-contextual. The answer is a fairly brief, informal explanation, so there is no need to use the pumping lemma.
Suppose I have the following lanugages:
L1 = { w β {a, b, c, d}* |
This is my decision:
L1 = L2 β© L3 β© L4 where L2 =
For L2, you can build DFA, because L2 does not need infinite memory, so L2 is regular. For L3, the same reasoning as above. And for L4, we can build a DFA that simply does not accept "abc", therefore, regular.
L1 is regular since regular languages ββare closed with respect to β©.
For L2, we can divide the language into:
L2 = L3 β© L4 where L3 =
We know that DFA can be built for L3, so L3 is regular. L4 has no context, because we can build a PDA where the stack is used to count the numbers a: s and b: s.
L2, therefore, has no context, because β© ordinary language and context-free language lead to context-free language.
For L3, we see that it is not contextual, because we are limited to 1 stack and to perform more than one comparison we need more stacks.
Are my reasoning rights? I have an exam soon and need to know if I have an idea.
Thank you in advance