Last active
August 17, 2018 09:50
-
-
Save chkl/2fc864b6f0782f49cc10c62df3fbc499 to your computer and use it in GitHub Desktop.
program for which the octagon domain is less precise than integer domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int __VERIFIER_nondet_int(); | |
extern void __VERIFIER_error() __attribute__((noreturn)); | |
void __VERIFIER_assert(int cond) { | |
if (!cond) { | |
ERROR: __VERIFIER_error(); | |
} | |
} | |
int main() | |
{ | |
int q = 0; | |
int method_id; | |
unsigned int this_expect = 0; | |
unsigned int this_buffer_empty = 0; | |
while (1) | |
{ | |
int P1 = __VERIFIER_nondet_int(); | |
int P3 = __VERIFIER_nondet_int(); | |
int P4 = __VERIFIER_nondet_int(); | |
int P6 = __VERIFIER_nondet_int(); | |
if (q == 0) | |
{ | |
if (__VERIFIER_nondet_int()) | |
{ | |
method_id = 1; | |
q = 1; | |
this_expect = 0; | |
this_buffer_empty = 1; | |
continue; | |
} | |
continue; | |
} | |
if (q == 1) | |
{ | |
if (__VERIFIER_nondet_int()) | |
{ | |
if (!(P1 % 2 != 0 % 2)) | |
{ | |
method_id = 2; | |
if (P1 % 2 != this_expect % 2 && this_buffer_empty == 1 && !(P1 % 2 != 0 % 2) || this_buffer_empty != 1 && !(P1 % 2 != 0 % 2)) | |
{ | |
; | |
} | |
q = 3; | |
this_expect = this_expect + 1; | |
this_buffer_empty = 1 - this_buffer_empty; | |
} | |
continue; | |
} | |
if (__VERIFIER_nondet_int()) | |
{ | |
if (!(P1 != (0 + 1 - 1) % 2)) | |
{ | |
method_id = 3; | |
if (P3 == (this_expect - 1) % 2 && this_buffer_empty != 1 && !(P3 != (0 + 1 - 1) % 2)) | |
{ | |
; | |
} | |
q = 2; | |
break; | |
} | |
continue; | |
} | |
if (__VERIFIER_nondet_int()) | |
{ | |
if (P1 % 2 != 0 % 2 && (P1 % 2 != (0 + 1) % 2 && P1 % 2 != 0 % 2)) | |
{ | |
method_id = 4; | |
if (P4 % 2 == this_expect % 2 && this_buffer_empty == 1 && P4 % 2 != 0 % 2 && (P4 % 2 != 0 % 2 && (P4 % 2 != (0 + 1) % 2 && P4 % 2 != 0 % 2))) | |
{ | |
; | |
} | |
q = 2; | |
break; | |
} | |
continue; | |
} | |
if (__VERIFIER_nondet_int()) | |
{ | |
if (P1 % 2 != 0 % 2 && !(P1 % 2 != (0 + 1) % 2 && P1 % 2 != 0 % 2)) | |
{ | |
method_id = 5; | |
if (P6 % 2 == this_expect % 2 && this_buffer_empty == 1 && P6 % 2 != 0 % 2 && (P6 % 2 != 0 % 2 && !(P6 % 2 != (0 + 1) % 2 && P6 % 2 != 0 % 2))) | |
{ | |
; | |
} | |
q = 2; | |
break; | |
} | |
continue; | |
} | |
/* do not remove this */ | |
if (__VERIFIER_nondet_int()) | |
{ | |
continue; | |
} | |
continue; | |
} | |
__VERIFIER_assert(q != 1); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment