--- layout: fc_discuss_archives title: Message 130 from Frama-C-discuss on September 2013 ---
Hi, You may give a look to the ACSL reference manual, to the notions of behaviors/assumes. The following is an example of what the Interp_Tab_1s spec could look like. /*@ requires \valid (Ptr+(0 .. 1)); requires Itab == 0 || Itab == 1; behavior Itab_false: assumes Itab != 1; requires \forall integer j; 0 <= j < 3 ==> \valid (Ptr[0]+ j); requires \valid (Interp+(0 .. 2)); assigns Interp[0..2]; ensures \forall integer j; 0 <= j < 3 ==> \abs ((Interp[j]) - (*(Ptr[0]+ j))) < BOUND; behavior Itab_true: assumes Itab == 1; requires \forall integer j; 0 <= j < 2 ==> \valid (Ptr[1]+ j); requires \valid (Interp+(0 .. 1)); assigns Interp[0..1]; ensures \forall integer j; 0 <= j < 2 ==> \abs ((Interp[j]) - (*(Ptr[1]+ j))) < BOUND; complete behaviors Itab_false,Itab_true; disjoint behaviors Itab_false,Itab_true; */ HTH, D. De : frama-c-discuss-bounces at lists.gforge.inria.fr [mailto:frama-c-discuss-bounces at lists.gforge.inria.fr] De la part de Rovedy Aparecida Busquim e Silva Envoy? : mardi 24 septembre 2013 21:54 ? : Frama-C public discussion Cc : Nanci; Luciana Akemi Objet : [Frama-c-discuss] Assigns clause Hi, We have a doubt related to assigns clause. All VCs of the attached function were proved. We wrote an assigns clause to the Interp array taking in account three elements: assigns Interp[0..2]; However, we would like to write a more precise assigns clause for the Interp array that has two or three elements according to Itab value. In the requires and ensures clauses the Itab value was considered, for example: requires Itab != 1 ==> \valid_range (Interp,0,2); requires Itab == 1 ==> \valid_range (Interp,0,1); How to write the assigns clause for the Interp array taking in account the Itab value? Best regards, Nanci, Rovedy e Luciana -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20130925/07fc4516/attachment-0001.html>