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] Proof conditions with simple pointer assignment
- Subject: [Frama-c-discuss] Proof conditions with simple pointer assignment
- From: Patrick.Baudin at cea.fr (BAUDIN Patrick)
- Date: Mon, 14 Dec 2009 12:51:54 +0100
- In-reply-to: <4B25F5A1.3040303@cea.fr>
- References: <4B2276E4.2090702@adelard.com> <4B25F5A1.3040303@cea.fr>
Sorry, I made a confusion since "p" is a formal parameter. Of course, these two clauses (assigns and ensures) hold. /*@ requires \valid(p); @ assigns *p; @ ensures *p == 1; */ void f(int *p) { *p = 1; } That specification is equivalent to : /*@ requires \valid(p); @ assigns *\old(p); @ ensures *\old(p) == 1; */ void f(int *p) { *p = 1; } Now let consider "q" a global variable : int * q ; This specification holds : /*@ requires \valid(q); @ assigns *\old(q); @ ensures *\old(q) == 1; */ void g(void) { *g = 1; } But without the use \old construction, something is required about separation to satisfy the ensures clauses. /*@ requires \valid(q) && something about separation @ assigns *q; @ ensures *q == 1; */ void g(void) { *g = 1; } Patrick Baudin. > > Hello, > Just from an ACSL point of view, the proof of the "assigns" > and "ensures" clauses of your spec requires locations "p" > and "*p" to be \separated. > Patrick Baudin. > > Consider the following spec, > > > > /*@ requries \valid(p); > > @ assigns *p; > > @ ensures *p == 1; > > */ > > void f(int *p) > > { > > *p = 1; > > }
- References:
- [Frama-c-discuss] Proof conditions with simple pointer assignment
- From: dak at adelard.com (Damien Karkinsky)
- [Frama-c-discuss] Proof conditions with simple pointer assignment
- From: Patrick.Baudin at cea.fr (BAUDIN Patrick)
- [Frama-c-discuss] Proof conditions with simple pointer assignment
- Prev by Date: [Frama-c-discuss] Proof conditions with simple pointer assignment
- Next by Date: [Frama-c-discuss] Proof conditions with simple pointer assignment
- Previous by thread: [Frama-c-discuss] Proof conditions with simple pointer assignment
- Next by thread: [Frama-c-discuss] relationship of separated and restrict qualifier
- Index(es):