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] Problem with loop invariant
- Subject: [Frama-c-discuss] Problem with loop invariant
- From: hollas at informatik.htw-dresden.de (Boris Hollas)
- Date: Wed, 23 Jun 2010 15:00:42 +0200
- In-reply-to: <4C1F2AF5.3000604@inria.fr>
- References: <1276795121.1681.16.camel@iti27> <4C1F2AF5.3000604@inria.fr>
Now, the code verifies. However, there are two points that I can't explain: - The loop invariant can be proved, but not the assertion at the end of the loop body. But the latter should follow from the loop invariant because wp(internal.msgnum++, \forall integer x; 0 <= x < internal.msgnum * BUFFSIZE ==> tosend->data[x] == received->data[x];) = \forall integer x; 0 <= x < (internal.msgnum+1) * BUFFSIZE ==> tosend->data[x] == received->data[x]; where wp(S,P) is the weakest precondition of S wrt P. - If the assertion is omitted, the loop invariant can't be proved. Does it nonetheless cause the prover to find the right goals? /*@ loop variant MSGCOUNT - internal.msgnum; loop invariant 0 <= internal.msgnum && \forall integer x; 0 <= x < internal.msgnum * BUFFSIZE ==> tosend->data[x] == received->data[x]; */ for (internal.msgnum = 0;internal.msgnum < MSGCOUNT; internal.msgnum++) { sreadi(msg_send,tosend,internal.msgnum); abpRound(msg_send,msg_receive,&channel,&internal); swritei(received,msg_receive,internal.msgnum); //@ assert \forall integer x; 0 <= x < (internal.msgnum+1) * BUFFSIZE ==> tosend->data[x] == received->data[x]; } -- Regards, Boris
- Follow-Ups:
- [Frama-c-discuss] Problem with loop invariant
- From: n.rousset at laposte.net (n.rousset at laposte.net)
- [Frama-c-discuss] Problem with loop invariant
- References:
- [Frama-c-discuss] Problem with loop invariant
- From: hollas at informatik.htw-dresden.de (Boris Hollas)
- [Frama-c-discuss] Problem with loop invariant
- From: Claude.Marche at inria.fr (Claude Marche)
- [Frama-c-discuss] Problem with loop invariant
- Prev by Date: [Frama-c-discuss] Frama-C
- Next by Date: [Frama-c-discuss] Proving the correctness of shifting operations
- Previous by thread: [Frama-c-discuss] Problem with loop invariant
- Next by thread: [Frama-c-discuss] Problem with loop invariant
- Index(es):