// S : tags c sym todo $TAGS // S : expect --result valid // S : cc -o test.bc $CC_OPT $file // S : verify --symbolic --solver $solver --sequential -o nofail:malloc -o ignore:control $V_OPT test.bc // N : V : CC_OPT : V_OPT : TAGS : RESULT // V : big.100000 : -DSIZE=100000 : : big : valid // V : big.10000 : -DSIZE=10000 : : big : valid // V : small.100 : -DSIZE=100 : : big : valid // V : small.10 : -DSIZE=10 : : : valid // V : big.1000 : -DSIZE=1000 : : big : valid /* Benchmark used to verify Chimdyalwar, Bharti, et al. "VeriAbs: Verification by abstraction (competition contribution)." International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, Berlin, Heidelberg, 2017.*/ extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern void __VERIFIER_assume(int); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } unsigned int __VERIFIER_nondet_uint(); int main() { unsigned int array[SIZE]; unsigned int index1; unsigned int index2; unsigned int loop_entered = 0; index1 = __VERIFIER_nondet_uint(); __VERIFIER_assume(index1 < SIZE); index2 = __VERIFIER_nondet_uint(); __VERIFIER_assume(index2 < SIZE); while (index1 < index2) { __VERIFIER_assert((index1 < SIZE) && (index2 < SIZE)); __VERIFIER_assume(array[index1] == array[index2]); index1++; index2--; loop_entered = 1; } if (loop_entered) { while (index2 < index1) { __VERIFIER_assert(array[index1] == array[index2]); index2++; index1--; } } }