source: CIVL/examples/languageFeatures/ranges.cvl

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: 681 bytes
Line 
1#include<assert.h>
2
3int main() {
4 int m = 0;
5 int n = 10;
6 int k = n-1;
7 int a[n];
8
9 for (int i = 0; i < n; i++)
10 a[i] = 0;
11
12 $assert($forall (int j:0.. k) a[j]==0);
13 $assert($forall (int j:0..n-1) a[j]==0);
14 $assert($forall (int j:0.. n-1) a[j]==0);
15 $assert($forall (int j:0 .. n-1) a[j]==0);
16 $assert($forall (int j:0 ..n-1) a[j]==0);
17 $assert($forall (int j:0..(n-1)) a[j]==0);
18 $assert($forall (int j:m ..9) a[j]==0);
19 $assert($forall (int j:m +0..9) a[j]==0);
20 $assert($forall (int j:m -0..9) a[j]==0);
21 $assert($forall (int j:0..+9) a[j]==0);
22 $assert($forall (int j:0..-9+18) a[j]==0);
23 $assert($forall (int j: m ..k) a[j]==0);
24 $assert($forall (int j: m..k) a[j]==0);
25}
Note: See TracBrowser for help on using the repository browser.