(self, *args)
Utility function that handles both unary and binary minus
Utility function that handles both unary and binary minus
Utility function that handles both unary and binary minus
def _minus_or_uminus(self, *args):
        """Utility function that handles both unary and binary minus"""
        mgr = self.env.formula_manager
        if len(args) == 1:
            lty = self.env.stc.get_type(args[0])
            mult = None
            if lty == self.env.type_manager.INT():
                if args[0].is_int_constant():
                    return mgr.Int(-1 * args[0].constant_value())
                mult = mgr.Int(-1)
            else:
                if args[0].is_real_constant():
                    return mgr.Real(-1 * args[0].constant_value())
                mult = mgr.Real(-1)
            return mgr.Times(mult, args[0])
        else:
            assert len(args) == 2
            return self.Minus(args[0], args[1])
def _minus_or_uminus ( self , * args ) : mgr = self . env . formula_manager if len ( args ) == 1 : lty = self . env . stc . get_type ( args [ 0 ] ) mult = None if lty == self . env . type_manager . INT ( ) : if args [ 0 ] . is_int_constant ( ) : return mgr . Int ( - 1 * args [ 0 ] . constant_value ( ) ) mult = mgr . Int ( - 1 ) else : if args [ 0 ] . is_real_constant ( ) : return mgr . Real ( - 1 * args [ 0 ] . constant_value ( ) ) mult = mgr . Real ( - 1 ) return mgr . Times ( mult , args [ 0 ] ) else : assert len ( args ) == 2 return self . Minus ( args [ 0 ] , args [ 1 ] )