source: CIVL/examples/contracts/extendQuant.c

main
Last change on this file 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
Line 
1//#include<mpi.h>
2#include<civlc.cvh>
3#include<stdio.h>
4
5/*@
6 @ ensures \result == 2*x;
7 @*/
8$atomic_f int g(int x){
9 return 2*x;
10}
11
12/*@
13 @ requires x==0 && y>x && y<=4;
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;
21 printf("x=%d, y=%d, result=%d\n", x, y, r);
22 return r;
23}
Note: See TracBrowser for help on using the repository browser.