You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contract & Harnesses for byte_sub, offset, map_addr and with_addr (#107)
### **Description**
This PR includes contracts and proof harnesses for the four APIs,
`offset` ,` byte_sub`, `map_addr`, and `with_addr` which are part of the
NonNull library in Rust.
### **Changes Overview:**
Covered APIs:
NonNull::offset: Adds an offset to a pointer
NonNull::byte_sub: Calculates an offset from a pointer in bytes.
NonNull:: map_addr: Creates a new pointer by mapping self's address to a
new one
NonNull::with_addr: Creates a new pointer with the given address
Proof harness:
non_null_check_offset
non_null_check_byte_sub
non_null_check_map_addr
non_null_check_with_addr
### **Revalidation**
To revalidate the verification results, run kani verify-std -Z
unstable-options "path/to/library" -Z function-contracts -Z
mem-predicates --harness ptr::non_null::verify. This will run all four
harnesses in the module. All default checks should pass:
```
VERIFICATION:- SUCCESSFUL
Verification Time: 0.57787573s
Complete - 6 successfully verified harnesses, 0 failures, 6 total.
```
Towards issue #53
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
---------
Co-authored-by: Carolyn Zech <[email protected]>
Co-authored-by: Zyad Hassan <[email protected]>
Co-authored-by: Michael Tautschnig <[email protected]>
0 commit comments