diff options
Diffstat (limited to '')
-rw-r--r-- | mdpoly/algebra.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mdpoly/algebra.py b/mdpoly/algebra.py index a9fc806..a2d2325 100644 --- a/mdpoly/algebra.py +++ b/mdpoly/algebra.py @@ -77,7 +77,7 @@ class ExprWithRepr(Expr, HasRepr, Protocol): """ Expression that has a representation """ -class ReducibleExpr(HasRepr, Protocol): +class ReducibleExpr(ExprWithRepr, Protocol): """ Reducible Expression Algebraic expression that can be written in terms of other (existing) @@ -187,7 +187,7 @@ class Add(Expr, HasRepr): return f"({self.left} + {self.right})" -class Sub(Expr, ReducibleExpr): +class Sub(ReducibleExpr): """ Generic subtraction operator (no type check) """ @property @@ -200,7 +200,7 @@ class Sub(Expr, ReducibleExpr): def reduce(self) -> ExprWithRepr: """ See :py:meth:`mdpoly.algebra.ReducibleExpr.reduce`. """ # return self.left + (-1 * self.right) - return Add(self.left, Mul(self._constant(value=-1), self.right)) + return Add(self.left, Mul(Const(value=-1), self.right)) def __repr__(self) -> str: return f"({self.left} - {self.right})" @@ -242,7 +242,7 @@ class Mul(Expr, HasRepr): return f"({self.left} * {self.right})" -class Exp(Expr, ReducibleExpr): +class Exp(ReducibleExpr): """ Generic exponentiation (no type check). """ @property @@ -334,7 +334,7 @@ class PolyMul(Mul, PolyRingAlgebra): @binary_operator(PolyRingAlgebra, PolyRingAlgebra) -class PolyDiv(Expr, ReducibleExpr, PolyRingAlgebra): +class PolyDiv(ReducibleExpr, PolyRingAlgebra): """ Division of scalar polynomial by scalar. """ def reduce(self) -> ExprWithRepr: |