The algorithm constructs a nondeterministic automaton accepting the set of words described by a rational expression. The number of states of the automaton is proportional to the size of the expression.

The main steps of the algorithm starting from a regular expression E are as follows:

- Transform the expression E into a new expression E’ where each symbol appears at most once
- Construct an automaton A’ accepting all the words described by E’
- Transform A’ into an automaton A accepting all the words described by E by replacing the sustituted symbols by the first ones.

## Step 1 : unique symbol

The first step of the algorithm is to separate all the symbols in the expression. Each occurrence of the same symbol is numbered (or rename all the symbols). The expression E = (ab + b) * becomes, for example, E’ = (ab_{0} + b_{1})^{*}.

Let’s take a longer example: E = (a + b)*(abb + ε). After renaming we have the following expression: (x_{1} + x_{2})*(x_{3}x_{4}x_{5} + ε).

We must now define the group First containing the symbols that can start a word. The group Last containing the symbols that can finish the word. And a group Next countaining the symbols that can be suffix of another symbol.

In your example:

- First = {x
_{1},x_{2},x_{3}} - Last= {x
_{1},x_{2},x_{5}} - Next :

## Step 2 : building the automaton

Let E’ be a regular expression where all the symbols are different. An automaton A’ is constructed as follows.

- The set of states is Q = {i} ∪ {a: appears in E’}
- The initial state is the state i
- The final states are Last(E’) to which we add i if ε ∈ E’
- The transitions are (i, a, a) if a ∈ First(E’) or (a, b, b) if (a, b) ∈ Next(E’)

For (x_{1} + x_{2})*(x_{3}x_{4}x_{5} + ε), state i is linked to states x_{1},x_{2},x_{3}.

The Next table are use for (a,b,b) expressions. For example for the first raw: (x_{1},x_{1},x_{1}), (x_{1},x_{2},x_{2}), (x_{1},x_{3},x_{3}).

Then, we add terminal sates {x_{1},x_{2},x_{5}}:

Then, the unique symbols are substituted to the real ones