Changes between Version 28 and Version 29 of ContractReduction
- Timestamp:
- 12/07/15 13:28:57 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ContractReduction
v28 v29 2 2 3 3 == ACSL function contract grammar with CIVL-C extension (starting with `$`) == 4 The CIVL-C function contract extends ACSL function contract with the following elements: 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 6 * `$depends` clause: specify the dependency relation of the function, usually used for partial order reduction (POR) or other analysis 7 * `$reads` clause: specify memory locations read by the function, the syntax of which is similar to `assigns` clause 8 4 9 {{{ 5 10 function-contract ::= requires-clause∗ terminates-clause? decreases-clause? guards-clause? … … 74 79 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. 75 80 81 The grammar of `event` is defined as follows: 82 83 {{{ 84 EventSetExpression 85 ::= $read(MemorySetExpression) 86 | $write(MemorySetExpression) 87 | $access(MemorySetExpression) 88 | $calls(FunctionCallExpression) 89 | \nothing 90 | $everything 91 | ‘(’ EventSetExpression ‘)’ 92 | EventSetExpression + EventSetExpression 93 | EventSetExpression - EventSetExpression 94 | EventSetExpression & EventSetExpression 95 }}} 96 76 97 The expression `event ` hence defines a predicate d(s,p), where s ranges over states, and p over procs. The requirement is the following: 77 98 … … 163 184 164 185 165 == Function specifiers == 166 167 Both `$atomic` and `$atom` may be used as function specifiers. They designate that any call to the function is to be treated atomically or atom-ly, respectively. 186 == Function specifier `$atomic_f`== 187 The function specifier `$atomic_f` may be used to designate that any call to the function is to be treated atomically. 168 188 169 189 == Guards == 170 190 171 The following construct is used to specify a guard for a function. The function may be a system or ordinary function. It maybe used in conjunction with `$atom ` or `$atomic`.191 The following construct is used to specify a guard for a function. The function may be a system or ordinary function. It maybe used in conjunction with `$atomic_f`. 172 192 Grammatically, it is a contract clause, though it is not really part of the contract. 173 193 … … 182 202 - The following means that any process that can reach the memory unit of `comm` should be in the ample set if the current process (`$self`) is to be chosen in the ample set. 183 203 {{{ 184 void comm_dequeue($comm comm, ....) 185 $depends {$access(*comm)} 186 ; 187 }}} 204 /*@ $depends $access(*comm); */ 205 void comm_dequeue($comm comm, ....); 206 }}}
