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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

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

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.

5 participants