source: CIVL/examples/backend/printExpr.cvl@ 4b9cad3

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 4b9cad3 was 4b9cad3, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

minor correction

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

  • Property mode set to 100644
File size: 975 bytes
Line 
1#include <civlc.cvh>
2
3typedef struct Point{
4 double x;
5 double y;
6} Point;
7
8typedef struct Line{
9 Point start;
10 Point end;
11} Line;
12
13$input int x;
14$input int y;
15$input $proc p;
16$assume(p != $self);
17$input $scope sc;
18$assume(sc != $root);
19$proc p1;
20$abstract int random(int t);
21
22void structs(){
23 Point p0={0,0}, p1={1,1}, p2;
24 Line l0={p0, p1}, l1={p1,p2}, l2={p2, p0};
25 Line lines[3];
26
27 //$assume(y>=0 && y<3);
28 //lines[y]=l1;
29 p2.x=2;
30 p2.y=2;
31 lines[0]=l0;
32 lines[1]=l1;
33 lines[2]=l2;
34}
35
36int call(int f(int), int arg){
37 return f(arg);
38}
39
40int sum(int n){
41 int result=0;
42
43 for(int i=1; i<=n; i++)
44 result+=i;
45 return result;
46}
47
48void main(){
49 int (*k)(int)=&sum;
50 int A[10];
51 int*p;
52 int n;
53 _Bool b;
54
55 A[1]=8;
56 A[2]=9;
57 A[3]=7;
58 n=A[2];
59 $assume(0<=x && x<10);
60 A[x]=9;
61 n=A[x];
62 n=x+y;
63 b = x && y;
64 n=random(n);
65 structs();
66 p=(int*)$malloc($root, sizeof(int)*10);
67 call(k, 2);
68 p1=$spawn sum(1);
69 p[5]=5;
70 $wait(p1);
71 $free(p);
72}
Note: See TracBrowser for help on using the repository browser.