source: CIVL/examples/compare/adder/adder_spec.cvl@ 5c27aa5

1.23 2.0 main test-branch
Last change on this file since 5c27aa5 was 1efcf3a, checked in by Ziqing Luo <ziqing@…>, 12 years ago

a compare example using adder_par.cvl and adder_spec.cvl

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

  • Property mode set to 100644
File size: 875 bytes
Line 
1/*****************************************
2 * SOURCE: adder_spec.c by vsl@udel
3 * The source program is included in FEVS
4 * vsl.cis.udel.edu/fevs
5 * FILE: adder_spec.cvl
6 * DESCRIPTION: This a manually translated
7 * CIVL program which is based on "adder_spec.c"
8 * This program sums all elements of an array
9 * up.
10 *
11 * AUTHOR: Ziqing Luo
12 * COMMANS: civl verify adder_spec.cvl
13 * -inputNB=10
14 * or
15 * make civl_spec
16 *****************************************/
17
18#include<stdio.h>
19#include<civlc.h>
20$input int NPROCS; /* useless input variables for civl compare */
21$input int NPROCSB;
22$input int N;
23$input int NB;
24$input double a[N];
25$output double SUM;
26$assume 0 < N && N < NB;
27
28void main() {
29 double result = 0.0;
30 int n = N;
31 int i;
32
33 for (i=0; i<n; i++) result += a[i];
34 SUM = result;
35 printf("%lf\n",result);
36}
Note: See TracBrowser for help on using the repository browser.