automaton.is_isomorphic(aut)

Whether this automaton isomorphic to aut, i.e., whether they are "the same graph."

Preconditions:

  • The labelsets of both automata are accessible

See also:

Examples

In [1]:
import vcsn
:0: FutureWarning: IPython widgets are experimental and may change in the future.

Boolean Automata

Automata are isomorphic if there is a bijection between their states.

In [2]:
b = vcsn.context('lal_char, b')
a1 = b.expression('a*+b*').standard(); a1
Out[2]:
%3 I0 0 0 I0->0 F0 F1 F3 0->F0 1 1 0->1 a 3 3 0->3 b 1->F1 1->1 a 3->F3 3->3 b
In [3]:
a2 = b.expression('b*+a*').standard(); a2
Out[3]:
%3 I0 0 0 I0->0 F0 F1 F3 0->F0 1 1 0->1 b 3 3 0->3 a 1->F1 1->1 b 3->F3 3->3 a
In [4]:
a1.is_isomorphic(a2)
Out[4]:
True

Equivalent automata can be non isomorphic.

In [5]:
a1 = b.expression('a+a').standard()
a2 = b.expression('a').standard()
a1.is_isomorphic(a2)
Out[5]:
False

Weighted Automata

In [6]:
z = vcsn.context('lal_char, z')
a1 = z.expression('<2>a+<3>b').standard()
a2 = z.expression('<3>b+<2>a').standard()
a1.is_isomorphic(a2)
Out[6]:
True
In [7]:
a1 = z.expression('<2>a').standard()
a2 = z.expression('a+a') .standard()
a1.is_isomorphic(a2)
Out[7]:
False