polynomial.ldivide(poly)

polynomial//poly

A polynomial which denotes the left-quotient of both polynomials. Makes more sense when the labels can be words. Beware that the notation lhs // rhs is somewhat misleading, and corresponds to lhs \ rhs, i.e. lhs is the divisor, and rhs the dividend.

Preconditions:

  • the division is valid

See also:

Examples

In [1]:
import sys
import vcsn
ctx = vcsn.context('law, q')
poly = lambda p: ctx.polynomial(p)
poly('ab') // poly('abc')
Out[1]:
$\mathit{c}$

The division must be valid.

In [2]:
try:
    poly('c') // poly('abc')
except RuntimeError as e:
    print(e, file=sys.stderr)
{abc}*: ldivide: invalid arguments: c, abc
In [3]:
poly('a+b') // poly('aa+ab+ba+bb')
Out[3]:
$\mathit{a} \oplus \mathit{b}$
In [4]:
poly('<2>\e') // poly('a+<2>b')
Out[4]:
$\left\langle \frac{1}{2}\right\rangle \mathit{a} \oplus \mathit{b}$