source:
CIVL/examples/analysis/abs.c@
bb03188
| Last change on this file since bb03188 was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 382 bytes | |
| Rev | Line | |
|---|---|---|
| [b1b88d8] | 1 | #include <stdlib.h> |
| [9570bc1] | 2 | #include <civlc.cvh> |
| [b1b88d8] | 3 | |
| [e4cc4f5] | 4 | $input int k; |
| [9570bc1] | 5 | $input int x; |
| 6 | $input int y; | |
| 7 | $input int z; | |
| 8 | $assume(x<0); | |
| 9 | $assume(y>0); | |
| [e4cc4f5] | 10 | $assume(k!=0); |
| [b1b88d8] | 11 | void main(){ |
| 12 | int a = 9; | |
| 13 | ||
| [cbea8be] | 14 | a=abs(0); |
| 15 | a=abs(x); // x<0 | |
| 16 | a=abs(y); // y>0 | |
| 17 | a=abs(z); | |
| 18 | a=abs(k); // k!=0 | |
| 19 | a=abs(x*y*z); | |
| [e4cc4f5] | 20 | a=abs(x*y*k); |
| [cbea8be] | 21 | a=abs(x*y); |
| [9570bc1] | 22 | $assert(x*y<=0); |
| 23 | ||
| [cbea8be] | 24 | a=abs(y%2-1); |
| 25 | a=abs(y%2-2); | |
| [b1b88d8] | 26 | } |
Note:
See TracBrowser
for help on using the repository browser.
