--- layout: fc_discuss_archives title: Message 6 from Frama-C-discuss on October 2013 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] z3 failure



I have a very simple example (below) which I want to verify with frama-c + Jessie.  The VCs are discharged easily by Alt-Ergo, CVC3, and CVC4.  However they are not discharged by Z3.  This is surprising since Z3 is a very powerful prover.   I'm wondering if anyone has any idea what is going on, or how to look into it.

I am using Z3 4.3.1.  There are two VCs.  One, "copy_safety" is discharged by Z3 very quickly.  The other, "copy_ensures_default" runs forever. I've moved the timeout to 60 seconds, and it still times out.

BTW, this warning appears with both VCs:

WARNING: '=' cannot be used in patterns

Here is the program copy.c:

/*@
  @ requires n>=0 && \valid(a+(0..n-1)) && \valid(b+(0..n-1)) ;
  @ ensures \forall integer i ; 0 <= i < n ==> a[i] == b[i] ;
  @ assigns b[0..n-1] ; 
  @*/
void copy(int n, double a[], double b[]) {
  int i = 0;

  /*@
    @ loop invariant 0<=i<=n;
    @ loop invariant \forall integer j ; 0<=j<i ==> b[j] == a[j] ;
    @ loop variant n - i ;
    @*/
  while (i < n) {
    b[i] = a[i];
    i++;
  }
}