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:
261 bytes
|
| Line | |
|---|
| 1 | #pragma CIVL acsl
|
|---|
| 2 | $input int n;
|
|---|
| 3 | $assume(n>=0 && n%2==0);
|
|---|
| 4 |
|
|---|
| 5 | int f(int n) {
|
|---|
| 6 | int i=0;
|
|---|
| 7 | /*@ loop invariant i<=n;
|
|---|
| 8 | @ loop invariant i%2==0;
|
|---|
| 9 | @ loop assigns i;
|
|---|
| 10 | @*/
|
|---|
| 11 | while (i<n) {
|
|---|
| 12 | i+=2;
|
|---|
| 13 | }
|
|---|
| 14 | $assert(i==n);
|
|---|
| 15 | return i;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | int main() {
|
|---|
| 19 | return f(0);
|
|---|
| 20 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.