main
| Line | |
|---|
| 1 | /* Verified with mods:
|
|---|
| 2 | * for loop step size of 2 changed to step of 1
|
|---|
| 3 | */
|
|---|
| 4 | #include <stdlib.h>
|
|---|
| 5 | #include <stdio.h>
|
|---|
| 6 | #include <assert.h>
|
|---|
| 7 | #pragma CIVL ACSL
|
|---|
| 8 | $input int N;
|
|---|
| 9 | $assume(0 < N);
|
|---|
| 10 |
|
|---|
| 11 | int __VERIFIER_nondet_int() {
|
|---|
| 12 | int x;
|
|---|
| 13 | $havoc(&x);
|
|---|
| 14 | return x;
|
|---|
| 15 | }
|
|---|
| 16 | int main()
|
|---|
| 17 | {
|
|---|
| 18 | int i;
|
|---|
| 19 | int a[N];
|
|---|
| 20 | int b[N];
|
|---|
| 21 |
|
|---|
| 22 | // modified:
|
|---|
| 23 | //@ focus I;
|
|---|
| 24 | for(i = 0; i < N; i++)
|
|---|
| 25 | {
|
|---|
| 26 | a[i] = __VERIFIER_nondet_int();
|
|---|
| 27 | if(a[i] == 10)
|
|---|
| 28 | b[i] = 20;
|
|---|
| 29 | }
|
|---|
| 30 | /* original:
|
|---|
| 31 | for(i = 0; i < N; i = i + 2)
|
|---|
| 32 | {
|
|---|
| 33 | a[i] = __VERIFIER_nondet_int();
|
|---|
| 34 | if(a[i] == 10)
|
|---|
| 35 | b[i] = 20;
|
|---|
| 36 | }
|
|---|
| 37 | */
|
|---|
| 38 |
|
|---|
| 39 | // modified:
|
|---|
| 40 | //@ focus I;
|
|---|
| 41 | $assert($forall(int i:0..N-1) a[i] == 10 => b[i] == 20);
|
|---|
| 42 | /* original:
|
|---|
| 43 | for(i = 0; i < N; i = i + 2)
|
|---|
| 44 | {
|
|---|
| 45 | if(a[i] == 10)
|
|---|
| 46 | $assert(b[i] == 20);
|
|---|
| 47 | }
|
|---|
| 48 | */
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.