Changes between Version 20 and Version 21 of Libraries


Ignore:
Timestamp:
06/09/23 02:24:26 (3 years ago)
Author:
siegel
Comment:

Finish comm library and add mem library

Legend:

Unmodified
Added
Removed
Modified
  • Libraries

    v20 v21  
    6565* `$COMM_ANY_SOURCE`: a constant that can be used as the source argument in a dequeue operation to indicate that a message may be taken from any source
    6666* `$COMM_ANY_TAG`: a constant that can be used as the tag argument in a dequeue operation to indicate that a message with any tag may be selected
     67* `$comm_null`: a constant representing the absence of `$comm`
    6768
    6869=== Functions
     
    9899  * Determines whether there exists a message with the given source and tag, and with destination the place of `comm`, in the gcomm associated to `comm`.   `source` may be `$COMM_ANY_SOURCE` and `tag` may be `$COMM_ANY_TAG`.
    99100* `$system $message $comm_seek($comm comm, int source, int tag)`
     101  * Returns the oldest message in the gcomm associated to `comm` that matches `source` and `tag` without modifying gcomm. `source` may be `$COMM_ANY_SOURCE` and `tag` may be `$COMM_ANY_TAG`. If no such message found, returns a message with empty data and all meta-data being `-1`.
    100102* `$system $message $comm_dequeue($comm comm, int source, int tag)`
     103  * Dequeues a message in a FIFO channel in the gcomm. The message should have its destination be the place of `comm`. The message will be dequeued from channel ''(i,j)'' in the gcomm, where ''i'' is the place of the source, and ''j'' is the place of the destination of the message.  A call to this function will not return until a matching message can be dequeued.
    101104* `$system $state_f _Bool $comm_empty_in($comm )`
     105  * deprecated
    102106* `$system $state_f _Bool $comm_empty_out($comm )`
     107  * deprecated
    103108
    104109
     
    122127Uses: (nothing).
    123128
     129The `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
    124163
    125164== op #op