-
Notifications
You must be signed in to change notification settings - Fork 77
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
Simplify relational witness invariants #1630
base: master
Are you sure you want to change the base?
Conversation
By moving terms and constant to other side.
Other Apron domans output equalities.
Are transformation such as avoid negation on both sides actually sound in the presence of overflows? |
If anything, I think it should avoid overflows. The constraint from Apron is on mathematical integers, so Above I described a bunch of small simplifications based on invariants I've seen and how they would look nicer. I started out trying to implement such simplifications, but eventually realized that the following algorithm pretty much does it all: put all terms with positive coefficients on one side and all of the ones with negative coefficients to the other (while removing the negation). So it's just a comparison between two sums. We're still casting everything to |
I think @DrMichaelPetter ran into some such issues when trying to assert constraints from his 2-variable domain, where doing some of these innocuous transformations lead to unsoundnesses. Maybe he can elaborate himself in the Gobcon today. |
|
Simplifications
0 - x >= 0
→-x >= 0
.-10 + x >= 0
→x >= 10
.TODO
-x >= -5
→5 >= x
.-x + y >= 0
→y - x >= 0
.x >= 0 && -x >= 0
→x == 0
.x + 5 = 0
→x = -5
(only happens if one side is default 0).