automaton.cominimize(algo="auto")

Cominimize an automaton. Calling aut.cominimize() is equivalent aut.transpose().minimize().transpose().

Arguments:

  • algo the algorithm to perform the minimization (see minimization for details).

See also:

Examples

In [1]:
import vcsn
In [2]:
%%automaton -s a
context = "lal_char(abc), z"
$ -> 0
$ -> 1
0 -> 2 <4>a
1 -> 3 a
2 -> 2 a
3 -> 3 a
2 -> 4 <3>a
3 -> 4 <4>a
4 -> $
%3 I0 0 0 I0->0 I1 1 1 I1->1 F4 2 2 0->2 ⟨4⟩a 3 3 1->3 a 2->2 a 4 4 2->4 ⟨3⟩a 3->3 a 3->4 ⟨4⟩a 4->F4
In [3]:
a1 = a.cominimize()
a1
Out[3]:
%3 I0 0 0, 1 I0->0 F3 1 2 0->1 ⟨4⟩a 2 3 0->2 a 1->1 a 3 4 1->3 ⟨3⟩a 2->2 a 2->3 ⟨4⟩a 3->F3
In [4]:
a2 = a.transpose().minimize().transpose()
a2
Out[4]:
%3 I0 0 0, 1 I0->0 F3 1 2 0->1 ⟨4⟩a 2 3 0->2 a 1->1 a 3 4 1->3 ⟨3⟩a 2->2 a 2->3 ⟨4⟩a 3->F3
In [5]:
a1 == a2
Out[5]:
True

Although based on two transpositions, the cominimized automaton has the same type as the forward minimization, and does not include the transpose_automaton decorator.

In [6]:
a1.type()
Out[6]:
'partition_automaton<mutable_automaton<context<letterset<char_letters>, z>>>'
In [7]:
a2.type()
Out[7]:
'partition_automaton<mutable_automaton<context<letterset<char_letters>, z>>>'