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] annotations and value analysis


  • Subject: [Frama-c-discuss] annotations and value analysis
  • From: stephane.duprat at atosorigin.com (Stéphane Duprat)
  • Date: Thu, 21 Jan 2010 12:34:11 +0100

Hi,

I have some questions about the use of annotations in the value analysis
of Frama-c.
First, I know that value analysis doesn't handle all annotations for
different reasons (for ex. requires \valid(p+10) and I exclude theses
annotations for this subject.
Here is a small stub function :

        /*@
          @ requires 0<=cmd<5;
          @ ensures  0<=\result<200;
          @*/
        int get_index(int /* in */ cmd)
        {
          int v = cmd;
          int ret = (unsigned int)Frama_C_interval(0,1000);
          return ret;
        }


My questions are :
  1/ does requires are checked by the value analysis considering the
calling context ?
  2/ does requires are hypothesis for the body of the function ?
  3/ does the ensures are checked by the value analysis ?
  4/ does the ensures of a called function are taken into account for
the analysis of the caller ?
Using the tool, I would answer yes for all except for 4/. But I prefer
asking you.

Ensures could be usefull to define a minimal semantic for function with
just a declaration (and without any definition of stub).

thx a lot,

St?phane




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20100121/50e2cc94/attachment.htm