--- layout: fc_discuss_archives title: Message 8 from Frama-C-discuss on January 2010 ---
The updated Why version 2.23 seems to be working well with Frama-C+Jessie plug-in once loops are annotated with loop variants. In the modified binary_search example, alt-ergo can prove all the VCs, and CVC3 can prove most of them in reasonable time. That's great! Surprisingly (to me), Gappa 0.12.3 cannot handle most of the VCs, even ones that I would *think* Gappa could handle. Instead, I get "?" markings for most VCs when using gwhy. Have I mis-installed something? Is this a problem in the mapping to Gappa by Jessie or Why? Or, is this a limitation of Gappa itself? If it's a Gappa limitation, is there an easy way to recover what is sent to Gappa (other than creating a stub for the "gappa" program) so that I can submit a bug report to the Gappa developers? Below is the modified binary_search.c file I use, which I process using: frama-c -jessie binary_search.c Thanks. --- David A. Wheeler =================== Modified binary_search.c ================================= /* Not really necessary, but a useful test for lemmas: */ /*@ lemma mean: \forall integer x, y; x <= y ==> x <= (x+y)/2 <= y; */ //@ requires n >= 0 && \valid_range(t,0,n-1); int binary_search(int* t, int n, int v) { int l = 0, u = n-1, p = -1; /*@ loop invariant 0 <= l && u <= n-1; @ loop variant u-l; */ while (l <= u ) { int m = l + (u - l) / 2; // NOTE this is changed for bounded calculation if (t[m] < v) l = m + 1; else if (t[m] > v) u = m - 1; else { p = m; break; } } return p; }