def _apply_infix(self, right, function): if _env().enable_infix_notation: mgr = _mgr() if is_python_boolean(right): right = mgr.Bool(right) elif is_python_integer(right): ty = self.get_type() if ty.is_real_type(): right = mgr.Real(right) else: right = mgr.Int(right) elif is_python_rational(right): right = mgr.Real(right) return function(self, right) else: raise Exception("Cannot use infix notation")
def _apply_infix(self, right, function, bv_function=None): if _env().enable_infix_notation: mgr = _mgr() # BVs # Default bv_function to function if bv_function is None: bv_function = function if _is_bv(self): if is_python_integer(right): right = mgr.BV(right, width=self.bv_width()) return bv_function(self, right) # Boolean, Integer and Arithmetic if is_python_boolean(right): right = mgr.Bool(right) elif is_python_integer(right): ty = self.get_type() if ty.is_real_type(): right = mgr.Real(right) else: right = mgr.Int(right) elif is_python_rational(right): right = mgr.Real(right) return function(self, right) else: raise Exception("Cannot use infix notation")