-
Notifications
You must be signed in to change notification settings - Fork 100
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
Generate contracts of dependencies as assertions #3802
Merged
carolynzech
merged 19 commits into
model-checking:main
from
carolynzech:contracts-as-assertions
Jan 9, 2025
Merged
Generate contracts of dependencies as assertions #3802
carolynzech
merged 19 commits into
model-checking:main
from
carolynzech:contracts-as-assertions
Jan 9, 2025
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
carolynzech
commented
Jan 2, 2025
zhassan-aws
reviewed
Jan 2, 2025
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.
Nice, thanks!
Only a few comments.
tests/expected/function-contract/as-assertions/assert-postconditions.rs
Outdated
Show resolved
Hide resolved
celinval
reviewed
Jan 2, 2025
carolynzech
commented
Jan 2, 2025
tests/expected/function-contract/as-assertions/assert-postconditions.rs
Outdated
Show resolved
Hide resolved
carolynzech
commented
Jan 2, 2025
tests/expected/function-contract/as-assertions/assert-preconditions.rs
Outdated
Show resolved
Hide resolved
carolynzech
commented
Jan 7, 2025
carolynzech
commented
Jan 7, 2025
zhassan-aws
approved these changes
Jan 8, 2025
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.
Thanks!
carolynzech
changed the title
Add an option to generate contracts as assertions
Generate contracts of dependencies as assertions
Jan 9, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 11, 2025
## What's Changed * Package Docker release step: ensure compiler is installed by @tautschnig in #3789 * Improve `--jobs` UI by @carolynzech in #3790 * Update kissat to v4.0.1 by @remi-delmas-3000 in #3791 * Automatic cargo update to 2024-12-23 by @github-actions in #3792 * Bump tests/perf/s2n-quic from `0b3f892` to `a54686e` by @dependabot in #3793 * Upgrade toolchain to nightly-2024-12-18 by @zhassan-aws in #3794 * Automatic cargo update to 2024-12-30 by @github-actions in #3800 * fix: clippy by @ShoyuVanilla in #3806 * Update dependencies (02.01.2025). by @remi-delmas-3000 in #3809 * Update charon submodule by @zhassan-aws in #3801 * Upgrade toolchain to 2024-12-19 by @zhassan-aws in #3810 * Automatic cargo update to 2025-01-06 by @github-actions in #3812 * Bump tests/perf/s2n-quic from `a54686e` to `ac52a48` by @dependabot in #3813 * Generate contracts of dependencies as assertions by @carolynzech in #3802 * Fix hanging command in `std-analysis.sh` by @carolynzech in #3818 * Add UB checks for ptr_offset_from* intrinsics by @celinval in #3757 * Toolchain update 06-01-2025 by @remi-delmas-3000 in #3814 * Automatic toolchain upgrade to nightly-2025-01-07 by @github-actions in #3820 * Include manifest-path when checking if packages are in the workspace by @qinheping in #3819 ## New Contributors * @ShoyuVanilla made their first contribution in #3806 **Full Changelog**: kani-0.57.0...kani-0.58.0 --------- Co-authored-by: Celina G. Val <[email protected]>
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.
Generates contract clauses of dependencies as assertions, with an option
--no-assert-contracts
to disable it. This works by adding a new contract mode that outputs the original body of the function with its contract clauses asserted. During theFunctionWithContractPass
, we use this closure, unless--no-assert-contracts
was passed, in which case we use the regular body.I'm omitting a description of why this is useful from the PR description--there's one in the module documentation, and I want that to be a self-contained explanation (i.e., if something is unclear, I want to fix it there).
(Also did a minor bit of cleanup, renaming
ClosureType
toContractMode
and movingsplit_for_remembers
to the shared module since it has contract-specific logic.)Resolves #3326
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.