I was wondering: is there an algorithm to decompose any regular expression, provided it doesn't use complementation, into one or more regular expressions which don't use Kleene star (only catenation and union).

Right now I'm reading On the Decomposition of Finite Languages by A. Mateescu, A. Salomaa and S. Yu, but this paper doesn't seem to discuss this problem, but that's where I get the idea.


No. If the regular expression encodes an infinite language, then there is no way to decompose it that way. Without the Kleene star, regular expressions can only express finite languages.

I realize this is a rather trivial answer, and it begs the next question: what if we are promised that the language is finite? In that case, the answer is yes. Here are two ways to see that the answer is yes:

Approach #1: Since the language is regular, we can find a DFA that recognizes it -- let's choose the minimal DFA. Since the language is finite, this DFA will not have any loops in it. Now if you apply the standard algorithm for converting a DFA to a regular expression, the result is a star-free regular expression. In fact, you get out only a single regular expression.

Approach #2: If the language is finite, then you can enumerate all of the words in the language, say $L=\{w_1,w_2,\dots,w_n\}$. Therefore $w_1 + w_2 + \dots + w_n$ is a regular expression for $L$.

Credit: The answer for the case where the language is finite is due to @J.E. Pin.

  • $\begingroup$ Oh, that's right, of course that'd be trivial. Should I edit the question to make it relate to only finite languages or ask a different question? Even if unintentionally, this feels like it could be a valid question on its own. $\endgroup$ – wvxvw Sep 21 '15 at 16:33
  • $\begingroup$ @D.W. Given a regular expression for your language, you can compute its minimal DFA. Assuming your language is finite, applying the standard conversion DFA to regular expressions will give you a star-free regular expression. Moreover, if $L = \{u_1, \dotsm, u_n\}$, then $u_1 + \dotsm + u_n$ is a star-free regular expression for $L$. $\endgroup$ – J.-E. Pin Sep 21 '15 at 17:01
  • $\begingroup$ Just a side remark. The question becomes much more interesting if you allow complementation... $\endgroup$ – J.-E. Pin Sep 21 '15 at 17:02
  • $\begingroup$ @J.-E.Pin, thank you! I've added this to my answer. $\endgroup$ – D.W. Sep 21 '15 at 17:18
  • $\begingroup$ @wvxvw, I've edited my answer to answer both variants (thanks to J.-E. Pin's observations). So, no need to edit the question or post a new one. $\endgroup$ – D.W. Sep 21 '15 at 17:19

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.