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] bug with loop invariant, wrong loop invariant gets proven



Hello again,

I would like to clarify something:

Given, that
while(++i != length)
 {}

is equivalent to the following:

and the loop invariant requires that i < length,
 /*@
     loop invariant 0 <= i < length;
 */
while(true) {
    i++;
    if (i == length) break;
}

Why is i allowed to become equal to length?

I remember the ACSL document state, that abnormal termination with a "break" 
it is not required that the loop invariant
holds.

That leaves only one question, are both loops truly equivalent.

Again, Thank you for your help.

Cheers

Christoph