-
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
[Heapster] Improve widening for changing offsets #1467
Conversation
The coq proof for this seems to be stuck in an infinite loop. The CI says that it blew the stack. |
@eddywestbrook looks like the heapster-saw CI passes now. It was Coq type-checking that got stuck in an infinite loop 🤦♂️ |
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.
Overall this looks great, good job! Please address the one change I suggested.
|
||
-- FIXME: add cases to prove struct(es1)=struct(es2) | ||
|
||
-- Otherwise give up! | ||
_ -> proveEqFail e mb_e | ||
|
||
where -- If there is exactly one 'BVFactor' in a list of 'BVFactor's which is |
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.
Please put these two helper functions into Permissions.hs and make them top-level functions
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.
Done. I initially added them to the bitvector section but they depend on the definition of PartialSubst
, so I added them in a new section below that definition.
-- Prove e = L_1*y_1 + ... + L_k*y_k + N*z + M where z is an unset variable, | ||
-- each y_i is either a set variable with value e_i or an unbound variable | ||
-- with e_i = y_i, and e - (L_1*e_1 + ... + L_k*e_k + M) is divisible by N, | ||
-- by setting z = (e - (L_1*e_1 + ... + L_k*e_k + M))/N |
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.
Nice, I like this. At first I thought there were multiple potential solutions for z
, which would be problematic if we chose the wrong one, but you are right, this is a most general solution
This PR improves the way widening works in Heapster to be able to handle examples where a pointer into a block of memory is modified (e.g. incremented) over the course of a loop. For example:
This is in service of being able to handle this sha512 example
which this PR adds to theheapster-saw/examples
directory – though currently, only the function above (which mirrors the loop structure ofsha512_block_data_order
) has been verified.