3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
omitting constructor, simplifying operator definitions, omitting incorrect type annotations
This commit is contained in:
Nikolaj Bjorner 2023-11-28 13:26:10 -08:00
parent 69f9640fdf
commit f90b10a0c8

View file

@ -1571,6 +1571,9 @@ class BoolRef(ExprRef):
def sort(self): def sort(self):
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):
return If(self, 1, 0) + If(other, 1, 0)
def __rmul__(self, other): def __rmul__(self, other):
return self * other return self * other
@ -1585,6 +1588,17 @@ class BoolRef(ExprRef):
other = If(other, 1, 0) other = If(other, 1, 0)
return If(self, other, 0) return If(self, other, 0)
def __and__(self, other):
return And(self, other)
def __or__(self, other):
return Or(self, other)
def __invert__(self):
return Not(self)
def is_bool(a): def is_bool(a):
"""Return `True` if `a` is a Z3 Boolean expression. """Return `True` if `a` is a Z3 Boolean expression.