Repository navigation
Contracts & Harnesses for byte_add, byte_offset, and byte_offset_from - #103
Conversation
byte_add, byte_offset, and byte_offset_from
|
Thanks for your suggestion @zhassan-aws! I've updated the code in the latest commit based on your comments. I’d appreciate it if you could take a look when you have a chance. |
69d7751 to
505f90b
Compare
|
Hi @zhassan-aws , thanks for the review and suggestions. I have updated the code based on the comments, fix the unnecessary assume proof harness, using |
celinval
left a comment
There was a problem hiding this comment.
Please replace kani::requires and kani::ensures by safety::requires and safety::ensures. Thanks!
celinval
left a comment
There was a problem hiding this comment.
Looks good. Can you please add harnesses for the dangling pointers cases?
|
@danielhumanmod could you resolve the conflicts? |
Hi @feliperodri , I have solved the conflicts in latest commit, thanks for reminding that |
…nmod/verify-rust-std into daniel/byte_operation
|
Thanks for the clarification @zhassan-aws ! I have updated the code based on the comments, appreciate any further or review that might need @zhassan-aws @celinval |
Description:
This PR introduces function contracts and proof harness for the NonNull pointer in the Rust core library. Specifically, it verifies three new APIs—
byte_offset,byte_add, andbyte_offset_fromwith Kani. These changes enhance the functionality of pointer arithmetic and verification for NonNull pointers.Changes Overview:
Covered APIs:
NonNull::byte_add: Adds a specified byte offset to a pointer.NonNull::byte_offset: Allows calculating an offset from a pointer in bytes.NonNull::byte_offset_from: Calculates the distance between two pointers in bytes.Proof harness:
non_null_byte_add_proofnon_null_byte_offset_proofnon_null_byte_offset_from_proofTowards #53
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.