main
|
Last change
on this file 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:
513 bytes
|
| Line | |
|---|
| 1 | /* Verifiable!
|
|---|
| 2 | */
|
|---|
| 3 | #include <stdlib.h>
|
|---|
| 4 | #include <assert.h>
|
|---|
| 5 | #pragma CIVL ACSL
|
|---|
| 6 | $input int N;
|
|---|
| 7 | $assume(0 < N);
|
|---|
| 8 |
|
|---|
| 9 | int *a[N];
|
|---|
| 10 | int i;
|
|---|
| 11 | int main ()
|
|---|
| 12 | {
|
|---|
| 13 | //@ transform flatten half;
|
|---|
| 14 | for(i = 0; i < N; i++)
|
|---|
| 15 | {
|
|---|
| 16 | a[i] = NULL;
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | //@ transform flatten half;
|
|---|
| 20 | for(i = 0; i < N / 2; i++)
|
|---|
| 21 | {
|
|---|
| 22 | a[i] = malloc(sizeof(int)) ;
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | // modified:
|
|---|
| 26 | //@ transform flatten half;
|
|---|
| 27 | $assert($forall(int i:0..(N/2)-1) a[i] != NULL);
|
|---|
| 28 | /* original:
|
|---|
| 29 | for(i = 0; i < N / 2; i++)
|
|---|
| 30 | {
|
|---|
| 31 | __VERIFIER_assert(a[i] != NULL);
|
|---|
| 32 | }
|
|---|
| 33 | */
|
|---|
| 34 |
|
|---|
| 35 | return 0;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.