Computes the (accessible part of the) determinization of an automaton.
Preconditions:
Postconditions:
Caveats:
See also:
import vcsn
Ladybird is a well known example that shows the exponential growth on the number of resulting states.
lady4 = vcsn.context('lal_char(abc), b').ladybird(4)
lady4
lady4d = lady4.determinize()
lady4d
The resulting automaton has states labeled with subsets of the input automaton set of states.
If the input automaton has an empty accessible part (i.e., it has no initial state), then the output is empty (which is genuinely displayed as nothing below).
%%automaton a
context = "lal_char(a), b"
0 -> 1 a
a.determinize()
The algorithm we use requires a division operator. The following example has weights in $\mathbb{Q}$.
a = vcsn.automaton('''digraph
{
vcsn_context = "lal_char(abcd), q"
I0 -> 0 [label = "<2>"]
0 -> 1 [label = "<2>a"]
0 -> 2 [label = "<3>a"]
1 -> 1 [label = "<3>b"]
1 -> 3 [label = "<5>c"]
2 -> 2 [label = "<3>b"]
2 -> 3 [label = "<3>d"]
3 -> F3
}''')
a
d = a.determinize()
d
Which is obviously deterministic. Of course they are equivalent:
a.is_equivalent(d)
The next example works in $\mathbb{Z}_{\min}$, which features a division: the usual subtraction.
a = vcsn.automaton('''digraph
{
vcsn_context = "lal_char(abcd), zmin"
I0 -> 0
0 -> 1 [label = "<1>a"]
0 -> 2 [label = "<2>a"]
1 -> 1 [label = "<3>b"]
1 -> 3 [label = "<5>c"]
2 -> 2 [label = "<3>b"]
2 -> 3 [label = "<6>d"]
3 -> F3
}''')
a
d = a.determinize()
d
Of course, they are equivalent. However we cannot use is_equivalent
here.
a.shortest(10)
d.shortest(10)