Whether the automaton has twins property.
Preconditions:
See also:
import vcsn
Consider the following $\mathbb{Q}$ automaton:
a = vcsn.context('lal_char(ab), q').ratexp('(ab)*+(ab)*').standard()
a
State $1$ and $4$ are siblings: they can be reached from $0$ with label "a" and there are two cycles in them with the same label "ba". Since the weights of these cycles equals $1$ (in $\mathbb{Q}$), they are twins. This automaton has two sibling states only and they are twins so it has twins property.
a.has_twins_property()
Conversely, the following automaton does not have the twins property because state $1$ and state $4$ are siblings but they are not twins because the weight of two cycles are different ($1$ != $2$).
a = vcsn.context('lal_char(abc), q').ratexp('(<2>ab)*+(ab)*').standard()
a
a.has_twins_property()
When the automaton has not any sibling, it has twins property.
a = vcsn.context("lal_char(abc), b").ratexp("(aa)*+(ab)*").standard()
a
a.has_twins_property()
In tropical semiring ($\mathbb{Z}_{\text{min}}$), an automaton is determinizable iff the automaton has twins property.
%%automaton a dot
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 [label = "<0>"]
}
This automaton has twins property because two sibling states $1$ and $2$ are twins, so it is determinizable (in $\mathbb{Z}_{\text{min}}$).
a.determinize()
Twins property can also work in $Z$ as bellow:
%%automaton a dot
digraph {
vcsn_context = "lal_char(abcd), z"
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.has_twins_property()
Or with a tuple of weightset as $\mathbb{Z} \times \mathbb{Z}_\text{min}$, for example:
%%automaton a dot
digraph {
vcsn_context = "lal_char(abc), lat<z,zmin>"
I0 -> 0
0 -> 1 [label = "<(1, 3)>a"]
0 -> 2 [label = "<(1, 5)>a"]
1 -> 3 [label = "<(4, 8)>b"]
3 -> F3
2 -> 4 [label = "<(6, 4)>b"]
4 -> F4
3 -> 1 [label = "<(9, 3)>a"]
4 -> 2 [label = "<(6, 7)>a"]
}
a.has_twins_property()