main
test-branch
|
Last change
on this file since a389857 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:
591 bytes
|
| 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.