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: jobredeaux at gatech.edu (Jobredeaux, Romain J)
  • Date: Tue, 18 Feb 2014 16:13:48 -0500 (EST)
  • In-reply-to: <1814476995.9770569.1392757979195.JavaMail.root@mail.gatech.edu>

Hi all,

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 ...
void foo (...)
{

...

for nominal:
    \requires ...
    \ensures ...

for non_nominal:
    \requires ...
    \ensures ...
{
/*code block the local contract applies to*/
}

...

}

My reading of the grammar is that this is currently impossible. Is there any easy way around
that?

Thanks in advance,

Romain Jobredeaux