-
Notifications
You must be signed in to change notification settings - Fork 63
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
[saw-core-coq] Check bitvector lemmas for < 4 bits #1495
Conversation
- replace `Preorder_isBvslt`, `Preorder_isBvult` with `Transitive_isBvslt`, `Transitive_isBvult` - fix precondition of `isBvsle_suc_r` - add preconditions to `bvNeg_msb`
Yeah, that's more or less what I had in mind. It's a touch disappointing it starts to slow down too much beyond 4 bits, but that is probably enough to catch most of the problematic corner cases and such. |
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.
Looks good! I think size-3 or 4 bitvectors should be fine for the types of lemmas you have here. If you really did want to scale to larger dimensions, I could suggest 2 things... (1) instead of dependent destruction, just enumerate all the n-digit bitvectors. I'm not sure if this would be faster but it's a possibility; (2) use something like quickchick (https://github.com/QuickChick/QuickChick) to randomly test inputs at larger dimensions, instead of enumerating all of them.
Thanks Rob and Jen. I got the Heapster examples working again with these new lemmas, so this should be ready to merge now. Note that I updated all the checks to only go up to 3 bits, for the sake of performance (checking If this idea ends up being more permanent, we should definitely look into implementing your suggestions @jpaykin. |
7665e7f
to
91825b0
Compare
Inspired by @robdockins' comment in #1236, this PR adds the axiom:
and uses it instead of
Admitted
to ensure that the bitvector propositions inSAWCoreBitvectors.v
at least work for inputs with less than four bits. In the process, this PR fixes a few incorrect bitvector propositions (namely,Preorder_isBvslt
,Preorder_isBvult
,isBvsle_suc_r
, andbvNeg_msb
).This is quick way to gain some confidence in the existing lemmas, not a long-term solution. To reinforce that, the tactic
holds_for_bits_up_to_4
, which tries to prove a lemma using the above axiom, prints out a warning each time it is used.This PR also fixes the definition of
shiftR
, as noticed in #1236.This is a draft because I still need to either fix or remove
bvslt_bvSub_r
andbvslt_bvSub_l
, and have yet to update the heapster example proofs.