-
Notifications
You must be signed in to change notification settings - Fork 108
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
Runtime checks #1452
Draft
cedihegi
wants to merge
49
commits into
viperproject:master
Choose a base branch
from
cedihegi:runtime-checks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Runtime checks #1452
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
Where to insert them is still an issue
- when there was a pledge and a postcondition, the runtime check for the postcondition would be skipped - also created template to find difference between mir_promoted and elaborated
We now manually clone old values instead of running a store function.
expiration locations of pledges are now figured out automatically and inserted, without using user annotations. Dead code elimination now works using only the encoder, and no longer modifying the MIR before verification.
+ lots of small fixes + remove clippy warnings + make no_std configurable
cedihegi
force-pushed
the
runtime-checks
branch
from
September 10, 2023 09:53
9e0effe
to
f4aa968
Compare
- some new test cases - only 1 configuration flag regarding runtime checks
cedihegi
force-pushed
the
runtime-checks
branch
from
September 22, 2023 16:06
6142c78
to
5cfb19a
Compare
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.
The PR of my Master's thesis: Contract Checking at Runtime in a Rust Verifier.
Runtime checks:
prusti_assume!
,prusti_assert!
,body_invariant!
snap()
and others will break the results of these checks.How to use them (for now):
#[insert_runtime_check]
attribute, or set environment variablePRUSTI_RUNTIME_CHECK_ALL_CONTRACTS
(which causes ast-rewriter to generate executable check methods for each contract).PRUSTI_INSERT_RUNTIME_CHECKS
(which will lead to insertion of calls to previously mentioned check methods into the MIR).prusti_rustc
setPRUSTI_FULL_COMPILATION
, or with cargo-prusti setPRUSTI_CARGO_COMMAND=run
Some examples can be found in prusti-tests/tests/runtime_checks/.
Mir optimizations:
2 kinds of optimizations based on verification results:
To use: set variable
PRUSTI_REMOVE_DEAD_CODE
.Examples: prusti-tests/tests/mir_optimizations