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

Harnesses verifying slice types for add, sub and offset #179

Merged
merged 39 commits into from
Dec 10, 2024

Conversation

szlee118
Copy link

Towards #76

Changes

Contracts Added:

  • Added contracts for <*mut T>::add, <*mut T>::sub, and <*mut T>::offset operations for raw pointers to slices.

Proofs Implemented:

  • Added proofs for the above contracts, verifying safety for the following slice pointee types using arrays:
  • All integer types (i8, i16, i32, etc.).
  • Tuples (composite types) (e.g., (i8, i8), (i32, f64, bool)).
  • Unit type (()).

Macro Definitions:

  • Introduced macros to simplify and automate harness generation:
  • One macro for add and sub operations on slices.
  • Another macro for offset operations on slices.

Array-Based Implementation for Slice Verification:

  • Arrays are used as a proxy for slices (as slices do not have a known length at compile time) to enable proper bounds checking and assumptions during verification.

This should be merged after another PR for dependency issues.

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

xsxszab and others added 25 commits October 7, 2024 12:44
implemented integer type proof for contract for fn add, sub and offset
Combines macros for different types.
…allocation api, modified their proof for harness accordingly
@szlee118 szlee118 requested a review from a team as a code owner November 22, 2024 19:58
@szlee118 szlee118 changed the title Verify/ptr mut slice types Verify/ptr mut slice types(add, sub and offset) Nov 22, 2024
@szlee118 szlee118 changed the title Verify/ptr mut slice types(add, sub and offset) Harnesses verifying slice types for add, sub and offset Nov 22, 2024
@szlee118
Copy link
Author

@feliperodri FYI

@szlee118
Copy link
Author

@tautschnig @feliperodri conflict resolved.

Copy link

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

It seems there are still some conflicts. Could you check if the conflicts were successfully solved?

library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
@szlee118
Copy link
Author

szlee118 commented Dec 2, 2024

It seems there are still some conflicts. Could you check if the conflicts were successfully solved?

It has been solved successfully.

library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mut_ptr.rs Outdated Show resolved Hide resolved
@feliperodri
Copy link

@tautschnig @carolynzech could you do another round of review here? We need one more approval before merging it.

@feliperodri feliperodri enabled auto-merge (squash) December 10, 2024 14:50
@carolynzech carolynzech disabled auto-merge December 10, 2024 15:13
@tautschnig tautschnig merged commit b6552b8 into model-checking:main Dec 10, 2024
8 checks passed
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.

7 participants