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] value analysis and annotated post-conditions



On Thu, Jul 28, 2016 at 4:05 PM, Pascal Cuoq <pascal.cuoq at gmail.com> wrote:

> Hello,
>
> On Thu, Jul 28, 2016 at 9:13 PM, Timothy E. Wang <zepeem at gmail.com> wrote:
>
>> A quick question. I am trying to get Value to take into account the
>> post-conditions that are part of the specifications of a library function.
>> I have a simple example below.  The output of the _sin function is
>> guaranteed to be within the interval [-1,1] but for some reason Value is
>> still returning [-MAX_FLOAT, MAX_FLOAT] for the variable y in the main
>> function. Any clue why this is happening?
>>
>>
> try this:
>
> /*@ requires \is_finite(x);
>
>   @ assigns \result \from x;
>
>   @ ensures \is_finite(\result);
>
>   @ ensures \result>=-1.0 && \result <=1.0;
>
> */
>
> double _sin(double x);
>

Thanks Pascal!


 _______________________________________________
Frama-c-discuss mailing list
Frama-c-discuss at lists.gforge.inria.fr
http://lists.gforge.inria.fr/mailman/listinfo/frama-c-discuss



-- 
Future planes will have one pilot and one dog in the cockpit. The pilot's
job will be to feed the dog. The dog's job will be to make sure the pilot
stays away from the instruments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20160729/88f51de2/attachment.html>