-
Notifications
You must be signed in to change notification settings - Fork 31
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 loop contracts and harness for Slice::partition_dedup_by
#130
base: main
Are you sure you want to change the base?
Conversation
We need to update Kani's branch to use loop-invariants. @carolynzech, can you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks
pub mod verify { | ||
use super::*; | ||
|
||
pub fn any_slice_of_array<T, const LENGTH: usize>(arr: &[T; LENGTH]) -> &[T] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this one?
|
||
#[kani::proof] | ||
pub fn check_partition_dedup_by() { | ||
const ARR_SIZE: usize = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
For function contracts, we currently have a workaround. We invoke That said, why does DFCC have that requirement? Can we remove that instead? |
We need to avoid having
free
be removed as unused function. This is because DFCC contract enforcement assumes that a definition forfree
exists. However, we cannot simply callfree
by addinglet _ = Box::new(10);
. We need an alternative workaround for the issue.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.