I know that there are non-regular languages, so that $L^*$ is regular, but all examples I can find are context-sensitive but not context free.

In case there are none how do you prove it?

  • 1
    $\begingroup$ Can be answered with the same techniques as cs.stackexchange.com/questions/1549 $\endgroup$ – sdcvvc May 25 '12 at 20:54
  • 2
    $\begingroup$ Hint: all languages which contain the alphabet have a very simple Kleene closure. $\endgroup$ – Raphael Dec 15 '14 at 22:58

$L = \{a^n b^n \mid n\in\mathbb{N}\}$ is context-free but not regular (classical example). So is $L' = \{a^n b^n \mid n\in\mathbb{N}\} \cup \{a,b\}$.

$L'^\ast = \{a,b\}^\ast$ is regular.

  • 2
    $\begingroup$ Brute-force, but valid. $\endgroup$ – Raphael May 25 '12 at 22:51
  • $\begingroup$ $L' = L$, actually... $\endgroup$ – vonbrand Nov 30 '16 at 1:48
  • $\begingroup$ @vonbrand ... actually not. $\endgroup$ – Rick Decker Oct 8 '20 at 19:00

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.