Smoke Detection Plugin#762
Merged
Merged
Conversation
marcoeilers
requested changes
Jan 4, 2024
marcoeilers
left a comment
Contributor
There was a problem hiding this comment.
I have one major comment or question and a bunch of smaller suggestions.
efb5e4e to
3f0198a
Compare
marcoeilers
approved these changes
Jan 8, 2024
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.
Adds the option to automatically detect contradictions in specifications (we call this smoke detection), which lead to the verifier being able to prove anything (even
false). This is done by insertingrefute falseat various locations in the code; if one of them fails, the specification is unsound. More specifically, theserefutestatements are addedgotostatement andassumeandinhalestatement (for more fine-grained error reporting; in theory, this would not be necessary).In order to avoid false positives, this pull request also introduces the
unreachablestatement, which is used to mark pieces of code as not reachable. As a result, norefute falsestatements are inserted inside of an unreachable branch. To illustrate the problem, consider the following example:Here, the smoke detection plugin would raise an error because
falsecan be proven inside of the body of theifstatement. However, since the precondition requires thataistrue, the body of theifstatement is not reachable. Hence, in order to avoid getting the error, one can add anunreachablestatement inside of theifbranch:The
unreachablestatement marks the current branch in the control flow as not reachable. This holds until the next join point - in this case, until the end of the body of theifbranch. When verifying this example with smoke detection enabled, the plugin reports no errors.Smoke detection is disabled by default and can be enabled by providing the option
--enableSmokeDetection.