CBMC version: 5.12 (cbmc-5.12.6-17-g7d30335)
Operating system: GNU/Linux x86_64
Exact command line resulting in the issue: cbmc top.c
What behaviour did you expect: VERIFICATION SUCCESSFUL
What happened instead: VERIFICATION FAILED
Test case top.c:
#include "assert.h"
int main()
{
int count = 0;
do {
count = count +1 ;
} while(count < 5);
assert(count == 5);
assert(count == 17);
}
The first assertion should pass, the second should fail. However, CBMC reports SUCCESS for both assertions.
Looking at the program functions shows that simulating the loop is aborted via ASSUME(false) after one iteration:
cbmc top.c --program-only
[...]
// 1 file top.c line 5 function main
(36) count!0@1#2 == 0
// 2 file top.c line 7 function main
(37) count!0@1#3 == 1
// 3 file top.c line 8 function main
// 3 file top.c line 8 function main
(38) ASSUME(FALSE)
The problem is also present in cbmc-5.12.6
The last major version of CBMC where this test case works correctly is 5.7.