Changes between Version 38 and Version 39 of ContractReduction
- Timestamp:
- 12/11/15 13:35:05 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ContractReduction
v38 v39 1 1 == Contract Reduction Language == 2 2 3 == ACSL function contract grammar with CIVL-C extension (starting with `$`)==3 == ACSL function contract grammar with CIVL-C extension == 4 4 The CIVL-C function contract extends ACSL function contract with the following elements: 5 5 * `guards` clause: specify the guard of a function, i.e., the specified predicate should hold in order to enable the execution of the function body … … 8 8 * `\noact`: empty set of actions 9 9 * `\anyact`: any actions 10 * memory actions: `\read(mu-list)`, `\write(mu-list)` 11 * action operations: `+`, `-`, `&` 10 12 * `reads` clause: specify memory locations read by the function, the syntax of which is similar to `assigns` clause 11 13 * additional parameter for `allocates` clause: specify the scope of the heap for allocation; if absent then the root scope `$root` is used … … 79 81 This contractual clause specifies part of the dependence relation used in POR. 80 82 {{{ 81 depends event (, event)*82 }}} 83 where ` event` is a memory event represented as a boolean expression. For each process `p`, the `event ` can be evaluated in the context of `p`. If `event` evaluates to `true`, then `p` must be included in an ample set containing a call to this function.83 depends action (, action)* 84 }}} 85 where `action` is an action represented as a boolean expression. For each process `p`, the `action ` can be evaluated in the context of `p`. If `action ` evaluates to `true`, then `p` must be included in an ample set containing a call to this function. 84 86 85 87 The grammar of `event` is defined as follows: … … 90 92 | \write(MemorySetExpression) 91 93 | \calls(FunctionCallExpression) 92 | \no thing93 | \ everything94 | \noact 95 | \anyact 94 96 | ‘(’ EventSetExpression ‘)’ 95 97 | EventSetExpression + EventSetExpression … … 195 197 196 198 {{{ 197 guard bool-expr199 guards bool-expr 198 200 }}} 199 201 … … 227 229 /*@ requires barrier != \null; 228 230 @ guards true; 229 @ depends \no thing;231 @ depends \noact; 230 232 @ assigns barrier;//barrier has pointer type, and is converted into $memory type automatically 231 233 @ */ … … 284 286 {{{ 285 287 /* Calls the barrier associated with this local barrier object.*/ 286 /*@ depends \no thing;288 /*@ depends \noact; 287 289 @ assigns \nothing; // although the barrier records is updated but it gets cleaned up when the method returns 288 290 @*/
