source:
CIVL/mods/dev.civl.com/examples/analysis/abs.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 382 bytes | |
| Line | |
|---|---|
| 1 | #include <stdlib.h> |
| 2 | #include <civlc.cvh> |
| 3 | |
| 4 | $input int k; |
| 5 | $input int x; |
| 6 | $input int y; |
| 7 | $input int z; |
| 8 | $assume(x<0); |
| 9 | $assume(y>0); |
| 10 | $assume(k!=0); |
| 11 | void main(){ |
| 12 | int a = 9; |
| 13 | |
| 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); |
| 20 | a=abs(x*y*k); |
| 21 | a=abs(x*y); |
| 22 | $assert(x*y<=0); |
| 23 | |
| 24 | a=abs(y%2-1); |
| 25 | a=abs(y%2-2); |
| 26 | } |
Note:
See TracBrowser
for help on using the repository browser.
