3
$\begingroup$

I understand that a regular language can be specified by either regular or non-regular grammars. What is an example of a non-regular grammar for a regular language?

$\endgroup$
3
  • $\begingroup$ Is it worthwhile to add an example to the Wikipedia article? $\endgroup$ Feb 2 '15 at 22:19
  • $\begingroup$ I'll offer that as an extra credit opportunity to my students. :-) $\endgroup$ Feb 3 '15 at 0:17
  • $\begingroup$ hey how can we tell that if the grammar is regular or not? $\endgroup$
    – Kaushal28
    Sep 21 '16 at 15:51
5
$\begingroup$

Regular Language L = {aab}

Non-regular grammar

S -> aAb

A -> a

$\endgroup$
2
  • $\begingroup$ hey how can we tell that if the grammar is regular or not? $\endgroup$
    – Kaushal28
    Sep 21 '16 at 15:49
  • $\begingroup$ I want to modify the question: Is there a regular language having "infinite strings" which can be generated by a non regular grammar? $\endgroup$
    – Ayush
    Jan 11 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.