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] Functions in Predicates


  • Subject: [Frama-c-discuss] Functions in Predicates
  • From: michaelschausten at googlemail.com (Michael Schausten)
  • Date: Tue, 24 Aug 2010 10:42:51 +0200

Hello,

is there a possibility to create more complex predicates using complete 
functions? I have a function that returns a boolean value depending on 2 
variables


bool func1(int x, int y) {
  bool result;
  //...
  //...
  return result;
}

/*@ predicate is_correct(int x, int y) = (func1(x,y));
*/
/*@ requires is_correct(x,y);
  @ ensures (\result == 1);
*/
int func2 (int x, int y) {
  // do something, that depends on x and y
  return 1;
}

However, it does not work like this. What am I doing wrong, or is it 
maybe not possible to use C-functions in predicates?


Sincereley,