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 plugin report incorrect
- Subject: [Frama-c-discuss] WP plugin report incorrect
- From: christoph.rauch at fau.de (Christoph Rauch)
- Date: Mon, 5 Oct 2015 17:56:21 +0200
- In-reply-to: <D82B01FA-6460-454C-B887-03944A9C8DB9@cea.fr>
- References: <38272817-D681-4152-8464-3EE0DFCF151B@fau.de> <3B6C70AF-1455-4ED4-9969-93C95C830A41@cea.fr> <06B92218-9DD5-43DF-9F07-538F2A049223@fau.de> <D82B01FA-6460-454C-B887-03944A9C8DB9@cea.fr>
> On 05 Oct 2015, at 17:32, Loïc Correnson <loic.correnson at cea.fr> wrote: > > Your function *is* doing something, and the post-condition is exactly your loop invariant with (i == end), hence it finally holds. > L. But shouldnât WP be unable to prove the loop invariant if the loop body is empty? The `swap(a+i, a+i)â effectively does nothing, you can just comment it out. You can go even further and remove everything inside the loop, leaving us with: /*@ @ requires end >= start >= 0; @ requires \valid(a+(start..end-1)); @ assigns a[start..end-1]; @ ensures \forall integer m; (start <= m < end) ==> a[m] <= a[end-1]; @ ensures Permut{Old,Here}(a, start, end-1); @*/ void bub_max(int* a, int start, int end) { /*@ @ loop assigns i, a[start..end-1]; @ loop invariant \forall integer m; (start <= m <= i) ==> a[m] <= a[i]; @*/ for (int i = start; i < end-1; i++) { // do nothing } which still verifies. If I completely remove the loop and thus the invariant, it doesnât verify. How can it possibly prove the loop invariant? As far as I understand the semantics of the loop invariant, this should not hold. -- Christoph
- Follow-Ups:
- [Frama-c-discuss] WP plugin report incorrect
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] WP plugin report incorrect
- References:
- [Frama-c-discuss] WP plugin report incorrect
- From: christoph.rauch at fau.de (Christoph Rauch)
- [Frama-c-discuss] WP plugin report incorrect
- From: loic.correnson at cea.fr (Loïc Correnson)
- [Frama-c-discuss] WP plugin report incorrect
- From: christoph.rauch at fau.de (Christoph Rauch)
- [Frama-c-discuss] WP plugin report incorrect
- From: loic.correnson at cea.fr (Loïc Correnson)
- [Frama-c-discuss] WP plugin report incorrect
- Prev by Date: [Frama-c-discuss] WP plugin report incorrect
- Next by Date: [Frama-c-discuss] WP plugin report incorrect
- Previous by thread: [Frama-c-discuss] WP plugin report incorrect
- Next by thread: [Frama-c-discuss] WP plugin report incorrect
- Index(es):