1.23
2.0
main
test-branch
| Line | |
|---|
| 1 | /* Bug found!
|
|---|
| 2 | * Fixed assertion and verified.
|
|---|
| 3 | */
|
|---|
| 4 | #include <stdlib.h>
|
|---|
| 5 | #include <assert.h>
|
|---|
| 6 | #pragma CIVL ACSL
|
|---|
| 7 | $input int N;
|
|---|
| 8 | $assume(0 < N);
|
|---|
| 9 |
|
|---|
| 10 | signed int a[N];
|
|---|
| 11 |
|
|---|
| 12 | int main()
|
|---|
| 13 | {
|
|---|
| 14 | int i;
|
|---|
| 15 | //@ transform flatten i;
|
|---|
| 16 | for(i = 0; i < N; i++)
|
|---|
| 17 | {
|
|---|
| 18 | if(i>=0 && i<=10000)
|
|---|
| 19 | a[i] = 10;
|
|---|
| 20 | else
|
|---|
| 21 | a[i] = 0;
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | // fixed:
|
|---|
| 25 | //@ transform flatten i;
|
|---|
| 26 | $assert($forall(int i:0..N-1) (i>=0 && i <= 10000) => a[i] == 10);
|
|---|
| 27 | /* modified:
|
|---|
| 28 | // transform flatten i;
|
|---|
| 29 | $assert($forall(int i:0..N-1) a[i] == 10);
|
|---|
| 30 | */
|
|---|
| 31 | /* original:
|
|---|
| 32 | for(i = 0; i < N; i++)
|
|---|
| 33 | {
|
|---|
| 34 | __VERIFIER_assert(a[i] == 10);
|
|---|
| 35 | }
|
|---|
| 36 | */
|
|---|
| 37 |
|
|---|
| 38 | return 0;
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.