In [1]:
import vcsn
def aut(e):
return vcsn.context('lal_char, b').expression(e, 'binary').standard()
a1 = aut('a*+b*'); a1
Out[1]:
In [2]:
a2 = aut('b*+a*'); a2
Out[2]:
In [3]:
a1.is_isomorphic(a2), a1 == a2
Out[3]:
The automata must be accessible, but coaccessibility is not required.
In [4]:
%%automaton -s a1
$ -> 0
0 -> 1 a
In [5]:
%%automaton -s a2
$ -> 0
0 -> 1 b
In [6]:
a1.is_isomorphic(a1), a1.is_isomorphic(a2)
Out[6]:
Equivalent automata can be non isomorphic.
In [7]:
a1 = aut('a+a')
a2 = aut('a')
a1.is_isomorphic(a2), a1.is_equivalent(a2)
Out[7]:
In [8]:
def aut(e):
return vcsn.context('lal_char, z').expression(e, 'binary').standard()
a1 = aut('<2>a+<3>b')
a2 = aut('<3>b+<2>a')
a1.is_isomorphic(a2)
Out[8]:
In [9]:
a1 = aut('<2>a')
a2 = aut('a+a')
a1.is_isomorphic(a2)
Out[9]: