source:
CIVL/examples/count.cvl@
9ae277d
| Last change on this file since 9ae277d was 34760dc, checked in by , 14 years ago | |
|---|---|
|
|
| File size: 128 bytes | |
| Rev | Line | |
|---|---|---|
| [34760dc] | 1 | |
| 2 | _input int n; | |
| 3 | _output int s = 0; | |
| 4 | ||
| 5 | void main() { | |
| 6 | _assume n>0; | |
| 7 | for (int i=0; i<n; i++) _invariant (i<=n) { | |
| 8 | s += i; | |
| 9 | } | |
| 10 | } |
Note:
See TracBrowser
for help on using the repository browser.
