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] Jessie - static variable
- Subject: [Frama-c-discuss] Jessie - static variable
- From: Claude.Marche at inria.fr (Claude Marche)
- Date: Sun, 17 Feb 2013 21:47:50 +0100
- In-reply-to: <CAEtoXR1pJfHHoWB-0DDMqyO2U-qW3FfuftjxPbeguVeTStUBtQ@mail.gmail.com>
- References: <CAEtoXR1pJfHHoWB-0DDMqyO2U-qW3FfuftjxPbeguVeTStUBtQ@mail.gmail.com>
Hi, On 02/17/2013 01:35 PM, Rovedy Aparecida Busquim e Silva wrote: > 2) After the safety verification, I have tried to do the functional > verification. I have written a pos-condition that test the static > variable average like that: > > @ ensures (average > 5.0) ==> (G_E[A].G_Ativo == TRUE); > > But when I have tried to run, I have received this message: > xx.c:19:[kernel] user error: unbound logic variable average in annotation. > > Is it wrong to use the "average" static variable in a pos-condition? Yes it is: the post-condition is supposed to be visible to the caller of your function, but the "average" variable is not visible. My simple advice: do not try anything complicated with invariants. Use ghost variables instead. e.g //@ ghost float visible_average; /*@ ensures (visible_average > 5.0) ==> (G_E[9].G_Ativo == 1); */ void calc() { ... average = add / 3.0; //@ ghost visible_average = average; ... }
- Follow-Ups:
- [Frama-c-discuss] Jessie - static variable
- From: rovedy at ig.com.br (Rovedy Aparecida Busquim e Silva)
- [Frama-c-discuss] Jessie - static variable
- References:
- [Frama-c-discuss] Jessie - static variable
- From: rovedy at ig.com.br (Rovedy Aparecida Busquim e Silva)
- [Frama-c-discuss] Jessie - static variable
- Prev by Date: [Frama-c-discuss] Jessie - static variable
- Next by Date: [Frama-c-discuss] Jessie - static variable
- Previous by thread: [Frama-c-discuss] Jessie - static variable
- Next by thread: [Frama-c-discuss] Jessie - static variable
- Index(es):