Slightly more complete more complete exhale #795
Merged
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.
MCE introduces a fresh symbol for the result of a lookup or the snapshot returned by a consume. Sometimes, this causes trouble if the definition of the fresh symbol is, for example, hidden inside a quantifier, and thus the definition is needed to get the quantifier instantiation that contains the definition.
The MCE code (in
summarise
) already checks if it can syntactically find a chunk that definitely aliases the receiver we're looking for, and in that case, does not introduce a new symbol, but instead returns and additionally constrains the value of that chunk.Additionally, when consuming, MCE already uses the greedy algorithm (including SMT checks if needed) to check for known aliases. However, if one is found here, it is not used by the summarisation code mentioned above.
This PR makes two changes:
summarise
gets an additional parameter; if a client has already used the solver to check for known aliases, it can pass along the result here.summarise
uses the passed symbol instead of the fresh one in case one is passed.summarise
indicate that they have not used the solver to check for an alias before calling it, andsummarise
cannot find an alias syntactically using the existing check, thensummarise
itself will use the solver to check for a definite alias, and use its value if one is found.So an additional prover query is performed only for lookups (not for consumes, which already used the solver) without syntactic aliases, and only if no value is found in the cache.
This fixes an MCE incompleteness that @JonasAlaif mentioned in #387, and also fixes the last remaining MCE incompleteness mentioned in #557 (
quantifiedpermissions/sequences/mergesort.vpr
).