polynomial.add(poly)

polynomial + poly

A polynomial which denotes the sum (or disjunction) of both polynomials.

Preconditions:

  • None

See also:

Examples

In [1]:
import vcsn
ctx = vcsn.context('lal_char, q')
poly = lambda p: ctx.polynomial(p)
poly('a+b') + poly('a+b')
Out[1]:
$\left\langle 2\right\rangle a \oplus \left\langle 2\right\rangle b$
In [2]:
poly('<2>a') + poly('<3>a')
Out[2]:
$\left\langle 5\right\rangle a$
In [3]:
poly('<2>a') + poly('<3>a') + poly('<-5>a')
Out[3]:
$\emptyset$
In [4]:
poly('<2>a') + poly('\z')
Out[4]:
$\left\langle 2\right\rangle a$