automaton
.star(algo = "auto")
Build an automaton that recognizes the Kleene star of the input automaton.
The algorithm has to be one of these:
"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:
"standard"
: the result automaton is standard."general"
: the context of the result automaton is nullable.See also:
In [1]:
import vcsn
This is what the general algorithm for star outputs, given an automaton A and s being a new state.
The transition from s to A represents each initial transition of A.
The transition from A to s represents each final transition of A.
In [2]:
%%automaton a
context = "lan_char, b"
$ -> s
s -> A \e
A -> s \e
s -> $
In [3]:
ctx = vcsn.context('lal_char, q')
aut = lambda e: ctx.expression(e).standard()
In [4]:
aut('a+b').star("standard")
Out[4]:
In [5]:
aut('a+b').star("general")
Out[5]: