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:
380 bytes
|
| Line | |
|---|
| 1 | #include<assert.h>
|
|---|
| 2 |
|
|---|
| 3 | #pragma CIVL ACSL
|
|---|
| 4 | $input int N;
|
|---|
| 5 | $assume(0 < N);
|
|---|
| 6 | int a[N];
|
|---|
| 7 | //int b[N];
|
|---|
| 8 |
|
|---|
| 9 | int main() {
|
|---|
| 10 |
|
|---|
| 11 | //@ focus J;
|
|---|
| 12 | for (int i = 0; i < N; i++) {
|
|---|
| 13 | a[i] = i;
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | //@ focus J;
|
|---|
| 17 | $assume($forall(int i:0..N-1) a[i] == i);
|
|---|
| 18 |
|
|---|
| 19 | //@ focus I;
|
|---|
| 20 | for (int i = 0; i < N-1; i++) {
|
|---|
| 21 | a[i] = a[i+1] + a[i];
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | //@ focus I;
|
|---|
| 25 | $assert($forall(int i:0..N-2) a[i] == 2*i + 1);
|
|---|
| 26 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.