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] small question


  • Subject: [Frama-c-discuss] small question
  • From: Romain.Jobredeaux at supelec.fr (Romain Jobredeaux)
  • Date: Fri, 18 Mar 2011 08:55:24 +0100

Hi all,

Trying the jessie plugin on this relatively straightforward program  
and annotations, I get a safety condition "0<0" on g and don't really  
understand where it comes from...

Can you help me out ?

Romain Jobredeaux

#include <stdio.h>
#include <stdint.h>


/*@ requires x >= 0;
   @ requires x < 10;
   @ ensures \result == x * ( x + 1 ) / 2; */
int g ( uint8_t x )
{

   if ( x == 0 )
     return 0;
   else
     return x + g ( x - 1 );

}


/*@ ensures \result == 36; */
int main ()
{

   int i = g ( 8 );

   return i;

}