@@ -87,3 +87,64 @@ All proofs must automatically ensure the absence of the following undefined beha
8787
8888Note: All solutions to verification challenges need to satisfy the criteria established in the [ challenge book] ( ../general-rules.md )
8989in addition to the ones listed above.
90+
91+ ## Verification Summary
92+
93+ All 13 Part A unsafe functions and all 30 Part B safe abstractions have been verified using Kani.
94+
95+ ### Part A: Safety Contracts (` #[requires] ` /` #[ensures] ` with ` #[kani::proof_for_contract] ` )
96+
97+ All unsafe functions have ` #[requires] ` contracts formalizing their safety preconditions, verified by ` #[kani::proof_for_contract] ` harnesses:
98+
99+ | Function | Contract | Harness |
100+ | ----------| ----------| ---------|
101+ | ` push_unchecked ` | ` self.len < self.capacity() ` | ` check_push_unchecked ` |
102+ | ` buffer_read ` | ` off < self.capacity() ` | ` check_buffer_read ` |
103+ | ` buffer_write ` | ` off < self.capacity() ` | ` check_buffer_write ` |
104+ | ` buffer_range ` | ` range.start <= range.end && range.end <= self.capacity() ` | ` check_buffer_range ` |
105+ | ` copy ` | ` len <= cap && src <= cap - len && dst <= cap - len ` | ` check_copy ` |
106+ | ` copy_nonoverlapping ` | Same as ` copy ` + non-overlap | ` check_copy_nonoverlapping ` |
107+ | ` wrap_copy ` | ` min(diff, cap - diff) + len <= cap ` | ` check_wrap_copy ` |
108+ | ` copy_slice ` | ` src.len() <= cap && dst < cap ` | ` check_copy_slice ` |
109+ | ` write_iter ` | ` dst < self.capacity() ` | ` check_write_iter ` |
110+ | ` write_iter_wrapping ` | ` dst < cap && len <= cap ` | ` check_write_iter_wrapping ` |
111+ | ` handle_capacity_increase ` | ` old_cap <= cap && len <= old_cap ` | ` check_handle_capacity_increase ` |
112+ | ` from_contiguous_raw_parts_in ` | ` init.start <= init.end <= capacity ` | ` check_from_contiguous_raw_parts_in ` |
113+ | ` abort_shrink ` | ` target_cap <= cap && len <= target_cap && old_head < cap ` | ` check_abort_shrink ` |
114+ | ` rotate_left_inner ` | ` mid <= self.len() / 2 ` | ` check_rotate_left_inner ` |
115+ | ` rotate_right_inner ` | ` k <= self.len() / 2 ` | ` check_rotate_right_inner ` |
116+
117+ ### Part B: UB Absence Proofs (` #[kani::proof] ` )
118+
119+ All safe abstractions verified with ` #[kani::proof] ` harnesses proving no undefined behavior:
120+
121+ | Function | Harness |
122+ | ----------| ---------|
123+ | ` get ` | ` check_get ` |
124+ | ` get_mut ` | ` check_get_mut ` |
125+ | ` swap ` | ` check_swap ` |
126+ | ` reserve_exact ` | ` check_reserve_exact ` |
127+ | ` reserve ` | ` check_reserve ` |
128+ | ` try_reserve_exact ` | ` check_try_reserve_exact ` |
129+ | ` try_reserve ` | ` check_try_reserve ` |
130+ | ` shrink_to ` | ` check_shrink_to ` |
131+ | ` truncate ` | ` check_truncate ` |
132+ | ` as_slices ` | ` check_as_slices ` |
133+ | ` as_mut_slices ` | ` check_as_mut_slices ` |
134+ | ` range ` | ` check_range ` |
135+ | ` range_mut ` | ` check_range_mut ` |
136+ | ` drain ` | ` check_drain ` |
137+ | ` pop_front ` | ` check_pop_front ` |
138+ | ` pop_back ` | ` check_pop_back ` |
139+ | ` push_front ` | ` check_push_front ` |
140+ | ` push_back ` | ` check_push_back ` |
141+ | ` insert ` | ` check_insert ` |
142+ | ` remove ` | ` check_remove ` |
143+ | ` split_off ` | ` check_split_off ` |
144+ | ` append ` | ` check_append ` |
145+ | ` retain_mut ` | ` check_retain_mut ` |
146+ | ` grow ` | ` check_grow ` |
147+ | ` resize_with ` | ` check_resize_with ` |
148+ | ` make_contiguous ` | ` check_make_contiguous ` |
149+ | ` rotate_left ` | ` check_rotate_left ` |
150+ | ` rotate_right ` | ` check_rotate_right ` |
0 commit comments