Skip to content
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

Add loop contracts and harness for small_slice_eq #122

Merged

Conversation

qinheping
Copy link

@qinheping qinheping commented Oct 19, 2024

Porting from https://github.com/model-checking/kani/blob/main/tests/expected/loop-contract/small_slice_eq.rs

The cbmc argument --object-bits 8 is needed to avoid running out of memory for the harness.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@qinheping qinheping requested a review from a team as a code owner October 19, 2024 05:14
@qinheping
Copy link
Author

The method small_slice_eq and the harness only runs for configuration target_arch = "x86_64" and target_feature = "sse2", and hence is not tested in the current CI checks.

Copy link

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also please add a contract to this function since it is unsafe?

library/core/src/str/pattern.rs Outdated Show resolved Hide resolved
library/core/src/str/pattern.rs Show resolved Hide resolved
@qinheping qinheping force-pushed the loop-contracts/small_slice_eq branch from 365d85c to d3ef481 Compare October 24, 2024 18:36
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Oct 29, 2024
Move `any_slice_from_array` to `kani_core` so that we can call them in
verify-rust-std (an example harness in
model-checking/verify-rust-std#122).

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
library/core/src/lib.rs Show resolved Hide resolved
library/core/src/str/pattern.rs Outdated Show resolved Hide resolved
library/core/src/str/pattern.rs Show resolved Hide resolved
library/core/src/str/pattern.rs Outdated Show resolved Hide resolved
library/core/src/str/pattern.rs Outdated Show resolved Hide resolved
library/core/src/str/pattern.rs Outdated Show resolved Hide resolved
qinheping and others added 3 commits November 8, 2024 15:46
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
library/core/src/str/pattern.rs Show resolved Hide resolved
library/core/src/str/pattern.rs Show resolved Hide resolved
library/core/src/str/pattern.rs Show resolved Hide resolved
@qinheping qinheping enabled auto-merge (squash) November 8, 2024 23:04
@qinheping qinheping merged commit 0c70dcd into model-checking:main Nov 8, 2024
12 checks passed
celinval added a commit that referenced this pull request Dec 6, 2024
In #148 and #122, we had to comment out a few harnesses due to the issue
model-checking/kani#3670. But now that the fix
has been pushed, we can enable them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants