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 a few intrinsics contracts #37

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

celinval
Copy link

Here are a few problems that I bumped into:

  1. Verification currently does not pass for write_bytes, copy and copy_nonoverlapping.
  2. The case where a pointer is dangling needed to be removed.
    • Kani cannot make assumptions on pointer validity (Add support for non-deterministic pointer kani#2300).
    • I don't know if exposing __CPROVER_is_fresh would be sound. From the documentation, it sounds like it will allocate fresh memory for each pointer. However, we would also like to cover the case where these pointers overlap.
  3. Actual intrinsics are very hard to verify with Kani. The cases we can verify are those that have wrappers around the actual intrinsic.

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

- This is not working due to a Kani limitation
The intrinsics `copy` and `copy_nonoverlapping` are untyped copies,
so they don't respect the validity requirements of `T`.
@rahulku
Copy link

rahulku commented Sep 13, 2024

is this waiting for something?

@celinval
Copy link
Author

Yes, I need to update the branch and tests.

# Conflicts:
#	library/core/src/intrinsics.rs
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.

2 participants