weight.add(w)

weight + w

A weight which denotes the sum of both weights.

Examples

In [1]:
import vcsn
w1 = vcsn.Z.weight('3')
w2 = vcsn.Z.weight('-7')
w1.add(w2)
Out[1]:
$-4$
In [2]:
w3 = vcsn.B.weight('1')
w3 + w3
Out[2]:
$\top$
In [3]:
w4 = vcsn.Q.weight('5/12')
w5 = vcsn.Q.weight('4/3')
w4 + w5
Out[3]:
$\frac{7}{4}$