Whether this expression is equivalent to exp
, i.e., whether they accept the same words with the same weights.
Preconditions:
Algorithm:
See also:
In [1]:
import vcsn
In [2]:
b = vcsn.context('lal_char, b')
r1 = b.expression('a')
r2 = b.expression('b')
r1.is_equivalent(r2)
Out[2]:
In [3]:
r1 = b.expression('a')
r2 = b.expression('a+a')
r1.is_equivalent(r2)
Out[3]:
In [4]:
z = vcsn.context('lal_char, z')
r1 = z.expression('<42>a')
r2 = z.expression('<51>a')
r1.is_equivalent(r2)
Out[4]:
In [5]:
r1 = z.expression('<42>a+<9>a')
r2 = z.expression('<51>a')
r1.is_equivalent(r2)
Out[5]:
In [6]:
q = vcsn.context('lal_char, q')
z.expression('[abc]*').is_equivalent(q.expression('[abc]*'))
Out[6]:
In [7]:
z.expression('<42>[abc]*').is_equivalent(q.expression('<51>[abc]*'))
Out[7]: