Сложение многочленов с коэффициентами-многочленами
(setq px1
(make-instance 'polynom
:var 'x
:terms (list (make-term
:order 2
:coeff (make-instance 'polynom
:var 'y
:terms (list (make-term :order 1
:coeff 1)
(make-term :order 0
:coeff 1))))
(make-term
:order 1
:coeff (make-instance 'polynom
:var 'y
:terms (list (make-term :order 2
:coeff 1)
(make-term :order 0
:coeff 1)))))))
(setq px2
(make-instance 'polynom
:var 'x
:terms (list (make-term
:order 1
:coeff (make-instance 'polynom
:var 'y
:terms (list (make-term :order 1
:coeff 1)
(make-term :order 0
:coeff -2))))
(make-term
:coeff 0
:coeff (make-instance 'polynom
:var 'y
:terms (list (make-term :order 3
:coeff 1)
(make-term :order 0
:coeff 7)))))))
(add2 px1 px2)
[МЧ (X) +[МЧ (Y) +1Y+1]X^2+[МЧ (Y) +1Y^2+1Y-1]X]
(mul2 px1 px2)
;=> ОШИБКА - не хватает методов mul2 умножения на число