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] WP + assign clause
- Subject: [Frama-c-discuss] WP + assign clause
- From: arnaud.dieumegard at enseeiht.fr (Arnaud Dieumegard)
- Date: Tue, 3 May 2011 13:59:54 +0200
- In-reply-to: <4DBFEA63.2030707@cea.fr>
- References: <BANLkTikng4_KNMhMNadM=S5i+krAO0Dj+A@mail.gmail.com> <7210DC5B-1E3A-4ED5-93E3-0F4C4992C1FB@enseeiht.fr> <4DBFEA63.2030707@cea.fr>
Hi, Thanks for the answer. It's all good now. Best regards Arnaud On May 3, 2011, at 1:43 PM, Zaynah Dargaye wrote: > Hi, > Your loop assign claus is incomplete, index is also modify in the loop body: > > loop assign v1[0..index-1], index ; > > Best > > On 02/05/2011 18:24, Arnaud Dieumegard wrote: >> >> Hi everyone, >> >> I'm working on some simple examples but I can't prove the following: >> >> double v1[2]; >> double v2[2]; >> >> int index; >> >> /*@ requires \valid_range(v1, 0, 1) && \valid_range(v2, 0, 1); >> assigns v1[0..1]; >> ensures \forall integer n; 0 <= n < 2 ==> >> v1[n] == v2[n]; >> */ >> void fun(void){ >> >> //Link invariant from output to Inv >> /*@ loop invariant 0 <= index <= 2; >> loop assigns v1[0..index-1]; >> loop invariant \forall integer n; 0 <= n < index ==> >> v1[n] == v2[n]; >> loop variant 2-index; >> */ >> for(index=0; index <2; ++index){ >> v1[index] = v2[index]; >> } >> } >> >> Here is the result of the analysis: >> >> >> >> >> Does anyone knows why the assign clause is not good ? >> Everything works fine without the assign clauses. >> >> Arnaud >> >> >> _______________________________________________ >> Frama-c-discuss mailing list >> Frama-c-discuss at lists.gforge.inria.fr >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/frama-c-discuss > > _______________________________________________ > Frama-c-discuss mailing list > Frama-c-discuss at lists.gforge.inria.fr > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/frama-c-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20110503/adcfd02d/attachment.htm>
- References:
- [Frama-c-discuss] WP + assign clause
- From: arnaud.dieumegard at enseeiht.fr (Arnaud Dieumegard)
- [Frama-c-discuss] WP + assign clause
- From: lea-zaynah.dargaye at cea.fr (Zaynah Dargaye)
- [Frama-c-discuss] WP + assign clause
- Prev by Date: [Frama-c-discuss] WP + assign clause
- Next by Date: [Frama-c-discuss] Unroll_Loop
- Previous by thread: [Frama-c-discuss] WP + assign clause
- Next by thread: [Frama-c-discuss] Support Formatcil module
- Index(es):