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