source:
CIVL/examples/contracts/extendQuant.c@
b1e6b3b
| Last change on this file since b1e6b3b was bfafee3, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 294 bytes | |
| Rev | Line | |
|---|---|---|
| [bfafee3] | 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.
