source: CIVL/examples/contracts/extendQuant.c@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 365 bytes
RevLine 
[bfafee3]1//#include<mpi.h>
2#include<civlc.cvh>
[e84bca3]3#include<stdio.h>
[bfafee3]4
5/*@
6 @ ensures \result == 2*x;
7 @*/
8$atomic_f int g(int x){
9 return 2*x;
10}
11
12/*@
[e84bca3]13 @ requires x==0 && y>x && y<=4;
[bfafee3]14 @ ensures \result==\sum(x,y, \lambda int i; 2*i);
15 @*/
16int f(int x, int y){
17 int r=0;
18
19 for(int i=x; i<=y; i++)
20 r+=i*2;
[e84bca3]21 printf("x=%d, y=%d, result=%d\n", x, y, r);
[bfafee3]22 return r;
23}
Note: See TracBrowser for help on using the repository browser.