| 1 |
[kernel] Parsing contract.i (no preprocessing) |
| 2 |
[rte:annot] annotating function f |
| 3 |
[rte:annot] annotating function main |
| 4 |
/* Generated by Frama-C */ |
| 5 |
/*@ ensures \result ≡ -\old(x); |
| 6 |
|
| 7 |
behavior pos: |
| 8 |
assumes x ≥ 0; |
| 9 |
ensures \result ≤ 0; |
| 10 |
assigns *y; |
| 11 |
|
| 12 |
behavior neg: |
| 13 |
assumes x < 0; |
| 14 |
ensures \result > 0; |
| 15 |
assigns \nothing; |
| 16 |
*/ |
| 17 |
int f(int x, int *y) |
| 18 |
{ |
| 19 |
int __retres; |
| 20 |
if (x >= 0) |
| 21 |
/*@ assert rte: mem_access: \valid(y); */ |
| 22 |
*y = x; |
| 23 |
/*@ assert rte: signed_overflow: -2147483647 ≤ x; */ |
| 24 |
__retres = - x; |
| 25 |
return __retres; |
| 26 |
} |
| 27 |
|
| 28 |
int main(void) |
| 29 |
{ |
| 30 |
int __retres; |
| 31 |
int a; |
| 32 |
int b; |
| 33 |
int c; |
| 34 |
a = 5; |
| 35 |
b = f(a,& c); |
| 36 |
/*@ assert rte: signed_overflow: -2147483648 ≤ b + c; */ |
| 37 |
/*@ assert rte: signed_overflow: b + c ≤ 2147483647; */ |
| 38 |
__retres = b + c; |
| 39 |
return __retres; |
| 40 |
} |
| 41 |
|
| 42 |
|