main
test-branch
|
Last change
on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
756 bytes
|
| 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 | //@ transform flatten 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 | //@ transform flatten 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.