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. This is used to implement "breaking derivatives/expansions".
See also:
References:
split
as "breaking" an expression, noted $B(\mathsf{E})$. It was renamed split
in Vcsn to avoid clashes with the break
keyword in both C++ and Python.import vcsn
qexp = vcsn.Q.expression
e = qexp('a* + <3>ab + a*', 'associative')
e
e.split()
Note that the weights (2 and 3) are on the level of the polynomial: the expressions are $a^*$ and $ab$.
It also distributes when the top-level is a multiplication, or a conjunction, whose first term is a sum.
e = qexp('(a+b)(a+b)')
e
e.split()
e = qexp(r'a?b?c?')
e
e.split()