-
Notifications
You must be signed in to change notification settings - Fork 90
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
How to check if a variable can be negative? #25
Comments
That looks like it should work, but it seems more accurate to set |
I'm not sure if this approach is correct, but this is how I try to infer ranges of singed variables: If you check the |
Can confirm that this approach is correct too. I have no idea what the performance looks like compared to the inequality method, but my suspicion is that z3 is more heavily optimized for inequalities than bit-extraction logic. I really wish we had someone on z3 to whom we can ask these questions, or at least someone with a background in SMT solving... |
For bit-vectors, it wouldn't surprise me if the bit-extraction logic was better, in terms of Z3 being able to come up with simpler constraints internally for the actual solve, but I'm definitely as clueless about the inner workings of SMT solvers as the average bear. |
Just open an issue on Z3Solver GitHub repo! |
Hi,
I'm trying to understand how to check if a number can be negative.
I write this piece of code but I'm note that it is correct:
The output was:
The goal is to check if b can be negative.
is it the proper way of doing it?
Thanks
The text was updated successfully, but these errors were encountered: