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 - Verifiable annotations with some types but not others



Hello,

2012/7/6 Arnaud Dieumegard <arnaud.dieumegard at enseeiht.fr>:
> Sorry about that but I did a mistake on my last message.
> The correct clause was:
>
> requires \forall unsigned char n; 0 <= n < 2 ==> \valid_range(&b.val[n],0,1);
> or
> requires \forall unsigned char n; 0 <= n < 2 ==> \valid(&b.val[n]+(0..1));
>
> This still does the trick but I can't prove it.
>

First, just a remark: \valid_range is deprecated (use \valid and .. as
you did in the latter version of your requires).
More importantly, you shouldn't need this requirement: your argument
is a struct which contains an array,
so b.val is always a valid block of 4 doubles. In fact all annotations
are proved with Nitrogen and alt-ergo.
In addition, you cannot prove a requires clause directly: it leads to
a proof obligation on the callers of the function
(to ensure that they meet the requirements set up by the function).
Since there is no caller of init in your code, there's nothing to be
proved for the requires.

Best regards,
-- 
E tutto per oggi, a la prossima volta
Virgile