-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat: add SMT-LIB overflow on addition for bitvectors (uadd_overflow
,sadd_overflow
, uadd_overflow_eq
,sadd_overflow_eq
) and support theorems
#6628
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
changelog-library |
What are your plans for adding theorems about these? |
Ideally supporting them in bvdecide - although there are some proofs missing (they're taking me more time than I expected), so I'll draft the PR for now and open it when the proofs are done! |
Okay! I'm happy with these definitions, and checked them against the reference, so I'm happy to click merge as soon as we're sure they are going to be used. |
not_overflow
,uadd_overflow
,sadd_overflow
,umul_overflow
,smul_overflow
)uadd_overflow
,sadd_overflow
, uadd_overflow_eq
,sadd_overflow_eq
)
Co-authored-by: Tobias Grosser <[email protected]>
Co-authored-by: Tobias Grosser <[email protected]>
Co-authored-by: Alex Keizer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to go from my side.
Co-authored-by: Tobias Grosser <[email protected]>
awaiting-review |
This PR adds SMT-LIB operators to detect overflow (
uadd_overflow
,sadd_overflow
), according to the definitions here, and the theorems proving equivalence of such definitions with theBitVec
library functions (uadd_overflow_eq
,sadd_overflow_eq
). Support theorems for these proofs aretoInt_lt, le_toInt, toInd_add_toInt_lt_two_pow, neg_two_pow_le_toInd_add_toInt, bmod_two_pow_neg_iff, emod_eq_add_self_emo
. A few theorems (emod_eq_add_self_emod
,Nat.cast_pow
,Nat.cast_ofNat
) were also pulled from Mathlib.