Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner authored and hgvk94 committed Mar 27, 2023
1 parent 6061b36 commit 72ad970
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/api/python/z3/z3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1559,13 +1559,15 @@ def __rmul__(self, other):
def __mul__(self, other):
"""Create the Z3 expression `self * other`.
"""
if other == 1:
if isinstance(other, int) and other == 1:
return self
if other == 0:
return 0
if isinstance(other, int) and other == 0:
return
if isinstance(other, BoolRef):
other = If(other, 1, 0)
return If(self, other, 0)


def is_bool(a):
"""Return `True` if `a` is a Z3 Boolean expression.
Expand Down

0 comments on commit 72ad970

Please sign in to comment.