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] multiple behaviors in statement contracts
- Subject: [Frama-c-discuss] multiple behaviors in statement contracts
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- Date: Wed, 19 Feb 2014 15:18:30 +0100
- In-reply-to: <2007061713.9770822.1392758028377.JavaMail.root@mail.gatech.edu>
- References: <1814476995.9770569.1392757979195.JavaMail.root@mail.gatech.edu> <2007061713.9770822.1392758028377.JavaMail.root@mail.gatech.edu>
Hello, 2014-02-18 22:13 GMT+01:00 Jobredeaux, Romain J <jobredeaux at gatech.edu>: > I have a question on statement contracts. Am I correct in that a statement contract can > only be applied to one specific behavior, but not multiple ones? I would like > to write a local contract on a statement, but the contract should be different > for different behaviors, something like this: > > /*@ behavior nominal: > assumes ... > .... > @ behavior non_nominal: > assumes ... You're right, this is not possible. You can write several statement contracts in sequence, like that: /*@ behavior nominal: assumes x>=0; behavior non_nominal: assumes x < 0; */ int f(int x) { /*@ for nominal: ensures \true; */ /*@ for non_nominal: ensures \true; */ { return x; } } Note however that WP seems to ignore 'for behavior:' part of annotations. Best regards, -- E tutto per oggi, a la prossima volta Virgile
- Follow-Ups:
- [Frama-c-discuss] multiple behaviors in statement contracts
- From: jobredeaux at gatech.edu (Jobredeaux, Romain J)
- [Frama-c-discuss] multiple behaviors in statement contracts
- References:
- [Frama-c-discuss] multiple behaviors in statement contracts
- From: jobredeaux at gatech.edu (Jobredeaux, Romain J)
- [Frama-c-discuss] multiple behaviors in statement contracts
- Prev by Date: [Frama-c-discuss] Frama-c: WP issues with Alt-Ergo (but works with Z3)
- Next by Date: [Frama-c-discuss] Frama-c: WP issues with Alt-Ergo (but works with Z3)
- Previous by thread: [Frama-c-discuss] multiple behaviors in statement contracts
- Next by thread: [Frama-c-discuss] multiple behaviors in statement contracts
- Index(es):