--- layout: fc_discuss_archives title: Message 35 from Frama-C-discuss on January 2009 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] bug with loop invariant, wrong loop invariant gets proven




Claude March? wrote:
> third loop: no problem. Beware that your "rewriting" of the loop has the 
> effect that the invariant is now posed after incrementation of i. Which 
> makes things different! No bug here.

To make things clearer: a proper rewriting of

while(++i != length) {}

would be

while(true) {
    i++;
    if (i == length) break;
}




-- 
Claude March?                          | tel: +33 1 72 92 59 69
INRIA Saclay - ?le-de-France           | mobile: +33 6 33 14 57 93
Parc Orsay Universit?                  | fax: +33 1 74 85 42 29
4, rue Jacques Monod - B?timent N      | http://www.lri.fr/~marche/
F-91893 ORSAY Cedex                    |