-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signed-subtraction overflow: invalid unsat result #7011
Comments
@aehyvari Based on the commit history, I think you're the right one to look at this.. |
Hi @aehyvari Did you get a chance to look at this? The fix isn't terribly urgent, but I'd like to confirm that this is a z3 issue and not some misunderstanding on my part. Thanks.. |
HI @LeventErkok , I agree, this is a bug. |
Added comments to the legacy versions exposed over the API to make it easier to develop a fix. |
I think the bug is here:
That is, the check should call Making this change fixes the benchmark I quoted above. I'm not sure if there are other places that might have used the incorrect call as well. In fact, now that SMTLib doesn't really distinguish overflow from underflow, it might be best to merge these implementations and have just one version to simplify internal usage? |
the function name mk_bvsub_overflow seems misaligned with the semantics of bvssubo ? |
Yes, that aligns with what there is in the legacy API for the under-overflow semantics. |
For this benchmark:
z3 says:
This is incorrect.
s0
is-3
,s1
is2
, and their difference is-5
, which underflows 3-bit signed bit-vector values.The result should be
sat
instead.The text was updated successfully, but these errors were encountered: