Skip to content

Commit

Permalink
fix #7012
Browse files Browse the repository at this point in the history
omitting constructor, simplifying operator definitions, omitting incorrect type annotations
  • Loading branch information
NikolajBjorner committed Nov 28, 2023
1 parent 69f9640 commit f90b10a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api/python/z3/z3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,9 @@ class BoolRef(ExprRef):
def sort(self):
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):
return self * other

Expand All @@ -1584,6 +1587,17 @@ def __mul__(self, other):
if isinstance(other, BoolRef):
other = If(other, 1, 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):
Expand Down

0 comments on commit f90b10a

Please sign in to comment.