-
Notifications
You must be signed in to change notification settings - Fork 62
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
Make lifetimesThatCouldProve more precise #1667
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… overlaps with another permission that is already held; fixed a bug in the logic for proving lcurrent permissions to avoid a lifetime containment cycle
…at too many lifetimes are ended
…the type being used for a function when it is type-checked at debug level
…uld actually return permissions that are useful in proving the RHS are considered as ones that could be ended in the current implication; also added a topological sort to lifetimesThatCouldProve, so child lifetimes are returned before their parents
…eturned by a lifetime is in a contained eq permission of a permission we currently hold on a variable on the right
eddywestbrook
added
the
subsystem: heapster
Issues specifically related to memory verification using Heapster
label
May 18, 2022
m-yac
approved these changes
May 18, 2022
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.
LGTM. I like the comments you added to lifetimesThatCouldProve
and proveVarAtomicImpl
!
m-yac
added
the
PR: ready to merge
Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
label
May 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
PR: ready to merge
Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
subsystem: heapster
Issues specifically related to memory verification using Heapster
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main focus of this PR is to make the
lifetimesThatCouldProve
function more precise. The goal oflifetimesThatCouldProve
is to determine all the lifetimes that might need to be ended in order to prove a given goal in the implication prover. The implication prover then tries ending each of these in turn to see which ones need to be ended in order to succeed.The old approach to
lifetimesThatCouldProve
was to simply test if ending a lifetimel
would give back permissions on any variablex
that we are trying to prove permissions for. The old version of this function turned out to have three problems:l
in cases where the specific permissions forx
given back by endingl
wasn't actually needed, giving too many false positives; andy
for which we currently have permissions likex:ptr((W,0) |-> eq(y))
whose permissions we do need to prove permissions onx
.This PR addresses these problems by redefining
lifetimesThatCouldProve
to take these issues into account.As part of this changes, this PR also makes the following changes:
extImplState
,withExtVarsM
, and related functions no longer need aKnownRepr TypeRepr a
for the type of the new evars added to the state, but now instead only need a `TypeRepr a;SomeMbPerm
andMbRangeForLLVMType
types now only need aCruCtx
instead of aKnownCruCtx
;recombinePerm
was commented out; and