Prematurely terminating loops using cbat's --num-unroll flag results in UNSAT when SAT is expected. A minimal working example would be:
int foo(uint8_t i){
int k = 0;
while(k < 3){
k++;
}
return i;
}
I compiled this on gcc 5.4.0 with cc -O0 -g -Wall -Wpedantic -o main main.c. I invoked cbat with commit e13386c9173c15dbde22e13271e783e44b021e7d with bap on c93b5d8.
This is as expected, since an argument (RDI) of 5, when returned, makes RAX become 5.
However, when we change the num-unroll flag to 2 as in invocation 2, we would also expect RDI to be 5 in a SAT countermodel. However, this is not the observed behavior, as cbat returns UNSAT.
Prematurely terminating loops using cbat's
--num-unroll
flag results inUNSAT
whenSAT
is expected. A minimal working example would be:I compiled this on gcc 5.4.0 with
cc -O0 -g -Wall -Wpedantic -o main main.c
. I invoked cbat with commite13386c9173c15dbde22e13271e783e44b021e7d
with bap onc93b5d8
.The cbat invocations used are:
and
Invocation 1 returns with
This is as expected, since an argument (RDI) of 5, when returned, makes
RAX
become 5.However, when we change the
num-unroll
flag to 2 as in invocation 2, we would also expectRDI
to be 5 in a SAT countermodel. However, this is not the observed behavior, as cbat returns UNSAT.The cfg for
foo
is: