expression.split()

Split an expression into a polynomial of rational expressions, i.e., when an expression is actually a sum of expressions, breaks it in smaller expressions.

See also:

Examples

In [1]:
import vcsn
e = vcsn.Q.expression('a* + <3>ab + a*', 'associative')
e
Out[1]:
${a}^{*} + \left\langle 3 \right\rangle \,a \, b + {a}^{*}$
In [2]:
e.split()
Out[2]:
$\left\langle 2\right\rangle {a}^{*} \oplus \left\langle 3\right\rangle a \, b$

Note that the weights (2 and 3) are on the level of the polynomial: the expressions are $a^*$ and $ab$.