source: CIVL/examples/mem/writeset/ws_push_pop_loop.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: 441 bytes
Line 
1#include <mem.cvh>
2$input int N, n;
3$assume(N > n && n > 5);
4
5int main() {
6 double a[10];
7 float c[N];
8
9 $write_set_push();
10 for (int i = 0; i < 5; i++) {
11 a[i] = i;
12 c[i] = i;
13 }
14
15 $mem m = $write_set_pop();
16 $mem m2 = $mem_empty();
17
18 m2 = $mem_union(m, &a[0 .. 4]);
19 m2 = $mem_union(m, &c[0 .. 4]);
20 $assert($mem_contains(m, m2));
21 $assert(!$mem_contains(m, &a[5]));
22 $assert(!$mem_contains(m, &c[5]));
23 return 0;
24}
Note: See TracBrowser for help on using the repository browser.