Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] z3 failure


  • Subject: [Frama-c-discuss] z3 failure
  • From: siegel at udel.edu (Stephen Siegel)
  • Date: Sun, 6 Oct 2013 17:06:46 -0400

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++;
  }
}