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: Benjamin.MONATE at cea.fr (MONATE Benjamin 205998)
- Date: Fri, 18 Mar 2011 09:04:51 +0100
- In-reply-to: <20110318085524.250310szb86owkj4@webmail.supelec.fr>
- References: <20110318085524.250310szb86owkj4@webmail.supelec.fr>
Hi, As g is recursive, you have to prove its termination. You may add a decrease clause to the specification of g. Cheers Benjamin Monate CEA LIST Head of Software Safety Laboratory Le 18 mars 2011 ? 08:55, "Romain Jobredeaux" <Romain.Jobredeaux at supelec.fr> a ?crit : > 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; > > } > > > > > _______________________________________________ > Frama-c-discuss mailing list > Frama-c-discuss at lists.gforge.inria.fr > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/frama-c-discuss
- References:
- [Frama-c-discuss] small question
- From: Romain.Jobredeaux at supelec.fr (Romain Jobredeaux)
- [Frama-c-discuss] small question
- Prev by Date: [Frama-c-discuss] small question
- Next by Date: [Frama-c-discuss] Frama-c-discuss Digest, Vol 34, Issue 12
- Previous by thread: [Frama-c-discuss] small question
- Next by thread: [Frama-c-discuss] How to see non-ACSL comments in Frama-C AST?
- Index(es):