Forbidding function self-references in postconditions for functions without decreases clauses#711
Merged
Merged
Conversation
…creases clauses as part of the termination plugin
ArquintL
approved these changes
Jun 15, 2023
ArquintL
left a comment
Member
There was a problem hiding this comment.
looks good to me, I only have one smaller comment
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces PR #669.
As discussed with Peter and Alex, we
The intended effect is to prevent potentially unsound reasoning caused by self-references (see issues #668 and #525), which is surprising for many users. Now, when using such self-references, user are forced to either prove termination using decreases clauses (in which case our function encoding is sound), or make explicit that they are assuming termination or accepting that the function might not terminate (writing
decreases _ordecreases *).This new check is implemented in
beforeVerifyin the termination plugin, since it checks for the presence of decreases-clauses and therefore would not work without the termination plugin. That also means that frontends will not be affected by this change by default, unless they choose to invoke the termination plugin explicitly.The errors are reported as consistency errors and distinguish between the kind of function call: