mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
Improve BoolRef addition (#7045)
This commit is contained in:
parent
7c81ee0890
commit
a9513c1998
|
@ -1572,7 +1572,12 @@ class BoolRef(ExprRef):
|
||||||
return BoolSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
|
return BoolSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
|
||||||
|
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
return If(self, 1, 0) + If(other, 1, 0)
|
if isinstance(other, BoolRef):
|
||||||
|
other = If(other, 1, 0)
|
||||||
|
return If(self, 1, 0) + other
|
||||||
|
|
||||||
|
def __radd__(self, other):
|
||||||
|
return self + other
|
||||||
|
|
||||||
def __rmul__(self, other):
|
def __rmul__(self, other):
|
||||||
return self * other
|
return self * other
|
||||||
|
|
Loading…
Reference in a new issue