generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issueT-UserTag user issues / requestsTag user issues / requests[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[E] PerformanceTrack performance improvement (Time / Memory / CPU)Track performance improvement (Time / Memory / CPU)
Description
I tried this code:
pub fn array_sum_fold(x : [usize;100]) -> usize {
x.iter().fold(0, |accumulator, current| accumulator + current)
}
pub fn array_sum_for(x : [usize;100]) -> usize {
let mut accumulator : usize = 0;
for i in 0..100 {
accumulator = x[i] + accumulator
}
accumulator
}
#[cfg(kani)]
mod proofs {
use super::*;
#[kani::proof]
fn array_sum_fold_proof() {
let x : [usize;100] = kani::any();
array_sum_fold(x);
}
#[kani::proof]
fn array_sum_for_proof() {
let x : [usize;100] = kani::any();
array_sum_for(x);
}
}using the following command line invocation:
$ cargo kani
with Kani version: 0.13.0
I expected to see this happen: Proof runtimes for the fold and for versions of array_sum complete in roughly the same time.
Instead, this happened: kani completed the for version quite quickly and then runs until eventually crashing (out of memory?) on the fold version.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issueT-UserTag user issues / requestsTag user issues / requests[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[E] PerformanceTrack performance improvement (Time / Memory / CPU)Track performance improvement (Time / Memory / CPU)