source:
CIVL/examples/contracts/extendQuant.c@
9a12c0f
| Last change on this file since 9a12c0f was bfafee3, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 294 bytes | |
| Line | |
|---|---|
| 1 | //#include<mpi.h> |
| 2 | #include<civlc.cvh> |
| 3 | |
| 4 | /*@ |
| 5 | @ ensures \result == 2*x; |
| 6 | @*/ |
| 7 | $atomic_f int g(int x){ |
| 8 | return 2*x; |
| 9 | } |
| 10 | |
| 11 | /*@ |
| 12 | @ requires x==0 && y==3; |
| 13 | @ ensures \result==\sum(x,y, \lambda int i; 2*i); |
| 14 | @*/ |
| 15 | int f(int x, int y){ |
| 16 | int r=0; |
| 17 | |
| 18 | for(int i=x; i<=y; i++) |
| 19 | r+=i*2; |
| 20 | return r; |
| 21 | } |
Note:
See TracBrowser
for help on using the repository browser.
