/** * This is a translation of a Pthread program from * the Pthread benchmarks of SV-COMP 2014. * https://svn.sosy-lab.org/software/sv-benchmarks/tags/svcomp14/ * * Command line execution: * civl verify -inputSIZE=8 stack_false.cvl -min */ #include #include "pthread.cvh" #include #include #include $input int SIZE; _Bool TRUE = 1; _Bool FALSE = 0; int OVERFLOW = -1; int UNDERFLOW = -2; int top = 0; unsigned int arr[SIZE]; pthread_mutex_t m; _Bool flag=$false; void error(void) { $assert($false); } void inc_top(void) { top++; } void dec_top(void) { top--; } int get_top(void) { return top; } int stack_empty(void) { (top==0) ? TRUE : FALSE; } int push(unsigned int *stack, int x) { if (top==SIZE) { printf("stack overflow\n"); return OVERFLOW; } else { stack[get_top()] = x; inc_top(); } return 0; } int pop(unsigned int *stack) { if (get_top()==0) { printf("stack underflow\n"); return UNDERFLOW; } else { dec_top(); return stack[get_top()]; } return 0; } void *t1(void*arg) { int i; unsigned int tmp; for(i=0; i