Skip to content

Commit

Permalink
Fix #6503
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Dec 26, 2022
1 parent fe80347 commit 8efaaaf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/api/python/z3/z3.py
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

This comment has been minimized.

Copy link
@LeventErkok

LeventErkok Dec 26, 2022

This return with no value seems problematic? Probably meant return 0

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 8efaaaf

Please sign in to comment.