| | 129 | The `mem` library provides functions to manipulate objects of the CIVL-C built-in type---`$mem`. A `$mem` object represents a set of memory locations. |
| | 130 | |
| | 131 | === Functions |
| | 132 | |
| | 133 | * `$system void $write_set_push()` |
| | 134 | * Pushes a new entry (i.e. an empty `$mem`) onto the write stack of the calling process. Each process maintains a write stack. A write to a memory location will cause the memory location being added to the top entry of the write stack, if the stack is non-empty. |
| | 135 | * `$system $mem $write_set_pop()` |
| | 136 | * Pops and returns the top entry of the write stack of the calling process. |
| | 137 | * `$state_f $system $mem $write_set_peek()` |
| | 138 | * Returns the top entry of the write stack of the calling process. |
| | 139 | * `$system void $read_set_push()` |
| | 140 | * Pushes a new entry (i.e. an empty `$mem`) onto the read stack of the calling process. Each process maintains a read stack. Reading a memory location will cause the memory location being added to the top entry of the read stack, if the stack is non-empty. |
| | 141 | * `$system $mem $read_set_pop()` |
| | 142 | * Pops and returns the top entry of the read stack of the calling process. |
| | 143 | * `$state_f $system $mem $read_set_peek()` |
| | 144 | * Returns the top entry of the read stack of the calling process. |
| | 145 | * `$atomic_f $system $mem $mem_empty()` |
| | 146 | * Creates a new empty `$mem` object. |
| | 147 | * `$atomic_f $system _Bool $mem_equals($mem m0, $mem m1)` |
| | 148 | * Returns true iff `m0` and `m1` are the identical set of memory locations. |
| | 149 | * `$atomic_f $system _Bool $mem_contains($mem super, $mem sub)` |
| | 150 | * Returns true iff `super` is a super-set of `sub`. |
| | 151 | * `$atomic_f $system _Bool $mem_no_intersect($mem m0, $mem m1, $mem *out0, $mem *out1)` |
| | 152 | * Returns true iff `m0` and `m1` are two disjoint sets. If `m0` and `m1` overlap, `out0` and `out1` will be assigned two overlapping memory location sets, which are as small as the function can figure out from `m0` and `m1`, respectively. |
| | 153 | * `$atomic_f $system $mem $mem_union($mem mem0, $mem mem1)` |
| | 154 | * Returns the union of the two sets of memory locations `mem0` and `mem1`. |
| | 155 | * `$atomic_f $system $mem $mem_union_widening($mem, $mem)` |
| | 156 | * Similar to the `$mem_union` function but may return an over-approximated super-set of the union set. The over-approximation is done by the model checker in order to make state space finite. |
| | 157 | * `$atomic_f $system void $mem_havoc($mem m)` |
| | 158 | * Assigns arbitrary values to memory locations in `m` |
| | 159 | * `$atomic_f $system $mem $mem_unary_widening($mem m)` |
| | 160 | * Returns an over-approximated super-set of `m`. The over-approximation is done by the model checker in order to make state space finite. |
| | 161 | * `$atomic_f $system void $mem_assign_from($state s, $mem m)` |
| | 162 | * deprecated |