(self, symbol)
return And(left, right)
Rewrite an interval in terms of inequalities and logic operators.
Rewrite an interval in terms of inequalities and logic operators.
Rewrite an interval in terms of inequalities and logic operators .
def as_relational(self, symbol):
        """Rewrite an interval in terms of inequalities and logic operators. """
        other = sympify(symbol)
        if self.right_open:
            right = other < self.end
        else:
            right = other <= self.end
        if right == True:
            if self.left_open:
                return other > self.start
            else:
                return other >= self.start
        if self.left_open:
            left = self.start < other
        else:
            left = self.start <= other
        return And(left, right)
def as_relational ( self , symbol ) : other = sympify ( symbol ) if self . right_open : right = other < self . end else : right = other <= self . end if right == True : if self . left_open : return other > self . start else : return other >= self . start if self . left_open : left = self . start < other else : left = self . start <= other return And ( left , right )