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:
575 bytes
|
| Line | |
|---|
| 1 | /* Cannot verify. Reasons:
|
|---|
| 2 | * Contains break statement.
|
|---|
| 3 | */
|
|---|
| 4 | #include <stdlib.h>
|
|---|
| 5 | #include <assert.h>
|
|---|
| 6 | #pragma CIVL ACSL
|
|---|
| 7 | int __VERIFIER_nondet_int(void) {
|
|---|
| 8 | int x;
|
|---|
| 9 | $havoc(&x);
|
|---|
| 10 | return x;
|
|---|
| 11 | }
|
|---|
| 12 | $input int N;
|
|---|
| 13 | $assume(0 < N);
|
|---|
| 14 | struct S
|
|---|
| 15 | {
|
|---|
| 16 | int n;
|
|---|
| 17 | };
|
|---|
| 18 |
|
|---|
| 19 | struct S s[N];
|
|---|
| 20 |
|
|---|
| 21 | int main()
|
|---|
| 22 | {
|
|---|
| 23 | int i;
|
|---|
| 24 | int c;
|
|---|
| 25 | c = __VERIFIER_nondet_int();
|
|---|
| 26 | for(i = 0; i < N; i++)
|
|---|
| 27 | {
|
|---|
| 28 | if(c > 5)
|
|---|
| 29 | break;
|
|---|
| 30 |
|
|---|
| 31 | s[i].n = 10;
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | // Modified
|
|---|
| 35 | $assert($forall(int i:0..N-1) c <= 5 ==> s[i].n == 10);
|
|---|
| 36 | // Original
|
|---|
| 37 | /*
|
|---|
| 38 | for(i = 0; i < N; i++)
|
|---|
| 39 | {
|
|---|
| 40 | if(c <= 5)
|
|---|
| 41 | __VERIFIER_assert(s[i].n == 10);
|
|---|
| 42 | }
|
|---|
| 43 | */
|
|---|
| 44 |
|
|---|
| 45 | return 0;
|
|---|
| 46 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.