+ return Polyhedron(inequalities=[(self - other)._toint() - 1])
+
+
+class Constant(Expression):
+
+ def __new__(cls, numerator=0, denominator=None):
+ self = object().__new__(cls)
+ if denominator is None:
+ if isinstance(numerator, numbers.Rational):
+ self._constant = numerator
+ elif isinstance(numerator, Constant):
+ self._constant = numerator.constant
+ else:
+ raise TypeError('constant must be a rational number or a Constant instance')
+ else:
+ self._constant = Fraction(numerator, denominator)
+ self._coefficients = {}
+ self._symbols = ()
+ self._dimension = 0
+ return self
+
+ def isconstant(self):
+ return True
+
+ def __bool__(self):
+ return bool(self.constant)
+
+ def __repr__(self):
+ return '{}({!r})'.format(self.__class__.__name__, self._constant)
+
+
+class Symbol(Expression):
+
+ def __new__(cls, name):
+ if isinstance(name, Symbol):
+ name = name.name
+ elif not isinstance(name, str):
+ raise TypeError('name must be a string or a Symbol instance')
+ self = object().__new__(cls)
+ self._coefficients = {name: 1}
+ self._constant = 0
+ self._symbols = tuple(name)
+ self._name = name
+ self._dimension = 1
+ return self