prusti-dev icon indicating copy to clipboard operation
prusti-dev copied to clipboard

Example that fails with more complete exhale

Open fpoli opened this issue 3 years ago • 4 comments

The following program:

  • does not verify in Prusti,
  • verifies if the parameter b is commented out,
  • alternatively, it verifies if PRUSTI_USE_MORE_COMPLETE_EXHALE is false.
use prusti_contracts::*;

const N : usize = 2;
const M : usize = 4;

#[requires(forall(|i:usize| i < N ==> (a[i] < M)))]
fn f(a : &[usize; N]
    , b: &[usize; N] // succeeds if this is commented
)
{
    let mut c: [usize; M] = [0; M];
    let mut i: usize = 0;
    while i < N {
        body_invariant!(i < N);
        body_invariant!(a[i] < M);
        let j = a[i];
        c[j] = 0;
        i = i + 1;
    }
}

fn main(){}

fpoli avatar Jun 24 '21 15:06 fpoli

Thanks! I suspect that we can generate a similar issue for Silicon just by setting up similar predicates at the Viper level. I assume this behaviour is not expected with the flag set.

alexanderjsummers avatar Jun 24 '21 15:06 alexanderjsummers

This looks like a well-known incompleteness in the more complete exhale.

vakaras avatar Jun 24 '21 16:06 vakaras

@vakaras ah thanks - is there an issue to link to?

alexanderjsummers avatar Jun 24 '21 16:06 alexanderjsummers

@vakaras ah thanks - is there an issue to link to?

https://github.com/viperproject/silicon/issues/387

vakaras avatar Jun 24 '21 16:06 vakaras