14
$\begingroup$

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?

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

1 Answer 1

21
$\begingroup$

$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.

$\endgroup$
3
  • 2
    $\begingroup$ Brute-force, but valid. $\endgroup$
    – Raphael
    Commented May 25, 2012 at 22:51
  • $\begingroup$ $L' = L$, actually... $\endgroup$
    – vonbrand
    Commented Nov 30, 2016 at 1:48
  • $\begingroup$ @vonbrand ... actually not. $\endgroup$ Commented Oct 8, 2020 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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