automaton.star(algo="auto")

Build an automaton whose behavior is the Kleene star of that of the input automaton.

The algorithm has to be one of these:

  • "deterministic": deterministic star.
  • "general": general star, no additional preconditions.
  • "standard": standard star.
  • "auto": default parameter, same as "standard" if parameters fit the standard preconditions, "general" otherwise.

Preconditions:

  • "standard": automaton has to be standard.

Postconditions:

  • "deterministic": the result automaton is deterministic.
  • "general": the context of the result automaton is nullable.
  • "standard": the result automaton is standard.

Caveat:

See also:

In [1]:
import vcsn

Examples

The following automaton will serve as input.

In [2]:
a = vcsn.Q.expression('a+ab').standard()
a
Out[2]:
%3 I0 0 0 I0->0 F1 F5 1 1 0->1 a 3 3 0->3 a 1->F1 5 5 3->5 b 5->F5

General

In [3]:
a.star("general")
Out[3]:
%3 I4 4 4 I4->4 F4 0 0 1 1 0->1 a 2 2 0->2 a 1->4 ε 3 3 2->3 b 3->4 ε 4->F4 4->0 ε

Standard

In [4]:
a.star("standard")
Out[4]:
%3 I0 0 0 I0->0 F0 F1 F3 0->F0 1 1 0->1 a 2 2 0->2 a 1->F1 1->1 a 1->2 a 3 3 2->3 b 3->F3 3->1 a 3->2 a

Deterministic

In [5]:
a.star("deterministic")
Out[5]:
%3 I0 0 0 I0->0 F0 F1 F2 0->F0 1 1 0->1 a 1->F1 1->1 a 2 2 1->2 b 2->F2 2->1 a