1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | #include <civlc.cvh>
|
|---|
| 2 |
|
|---|
| 3 | typedef struct Point{
|
|---|
| 4 | double x;
|
|---|
| 5 | double y;
|
|---|
| 6 | } Point;
|
|---|
| 7 |
|
|---|
| 8 | typedef 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 |
|
|---|
| 22 | void 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 |
|
|---|
| 36 | int call(int f(int), int arg){
|
|---|
| 37 | return f(arg);
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | int sum(int n){
|
|---|
| 41 | int result=0;
|
|---|
| 42 |
|
|---|
| 43 | for(int i=1; i<=n; i++)
|
|---|
| 44 | result+=i;
|
|---|
| 45 | return result;
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | void main(){
|
|---|
| 49 | int (*k)(int)=∑
|
|---|
| 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.