# polynomial.split()¶

Split the expressions of a polynomial of rational expressions. In other words, when an expression is actually a sum of expressions, breaks it in smaller expressions, and return a polynomial of all these smaller expressions.

## Examples¶

In [1]:
import vcsn
c = vcsn.context('expressionset<lal, q>, q')
c

Out[1]:
$\mathsf{RatE}[\{\ldots\}\to\mathbb{Q}]\to\mathbb{Q}$

Beware that the following polynomial (admittedly badly displayed) is $\langle 2 \rangle \odot (a+b)$, not $\langle 2 \rangle \odot a \oplus b$: it contains a single expression, $a+b$.

In [2]:
p1 = c.polynomial('<2>a+b')
p1

Out[2]:
$\left\langle 2\right\rangle a + b$
In [3]:
p1.split()

Out[3]:
$\left\langle 2\right\rangle a \oplus \left\langle 2\right\rangle b$
In [4]:
p2 = c.polynomial('a+b(c+d)')
p2

Out[4]:
$a + b \, \left(c + d\right)$
In [5]:
p2.split()

Out[5]:
$a \oplus b \, \left(c + d\right)$
In [6]:
p1 + p2

Out[6]:
$\left\langle 2\right\rangle a + b \oplus a + b \, \left(c + d\right)$
In [7]:
(p1 + p2).split()

Out[7]:
$\left\langle 3\right\rangle a \oplus \left\langle 2\right\rangle b \oplus b \, \left(c + d\right)$