Changes between Version 24 and Version 25 of ContractReduction
- Timestamp:
- 12/07/15 11:49:02 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ContractReduction
v24 v25 2 2 3 3 == ACSL function contract grammar with CIVL-C extension (in bold) == 4 5 `function-contract ::= requires-clause∗ terminates-clause? decreases-clause?` 6 `simple-clause∗ named-behavior∗ completeness-clause∗` 7 8 `requires-clause ::= requires pred ;` 9 10 `terminates-clause ::= terminates pred ;` 11 12 `decreases-clause ::= decreases term (for id)? ;` 13 14 `simple-clause ::= assigns-clause | ensures-clause | allocation-clause | abrupt-clause-fn` 15 16 `assigns-clause ::= assigns locations ;` 17 18 `locations ::= location (, location) ∗ | \nothing |` **\everything** 19 20 `location ::= tset` 21 22 `ensures-clause ::= ensures pred ;` 23 24 `named-behavior ::= behavior id : behavior-body` 25 26 `behavior-body ::= assumes-clause∗ requires-clause∗ simple-clause∗` 27 28 `assumes-clause ::= assumes pred ;` 29 30 `completeness-clause ::= complete behaviors (id (, id)∗)? ;` 31 `| disjoint behaviors (id (, id)∗)? ;` 4 {{{ 5 function-contract ::= requires-clause∗ terminates-clause? decreases-clause? 6 simple-clause∗ named-behavior∗ completeness-clause∗ 7 requires-clause ::= requires pred ; 8 terminates-clause ::= terminates pred ; 9 decreases-clause ::= decreases term (for id)? ; 10 simple-clause ::= assigns-clause | ensures-clause 11 | allocation-clause | abrupt-clause-fn 12 assigns-clause ::= assigns locations ; 13 locations ::= location (, location) ∗ | \nothing |` $everything 14 location ::= tset 15 ensures-clause ::= ensures pred ; 16 named-behavior ::= behavior id : behavior-body 17 behavior-body ::= assumes-clause∗ requires-clause∗ simple-clause∗ 18 assumes-clause ::= assumes pred ; 19 completeness-clause ::= complete behaviors (id (, id)∗)? ; 20 | disjoint behaviors (id (, id)∗)? ; 21 term ::= \old ( term ) | \result 22 pred ::= \old ( pred ) 23 }}} 32 24 33 25 {{{ … … 46 38 }}} 47 39 48 `term ::= \old ( term ) | \result`49 50 `pred ::= \old ( pred )`51 52 40 53 41 == `$memory` type == … … 63 51 64 52 As in other contract specification language, this contract clause is used to specify a set of existing memory units. The claim is that if an existing memory unit is not in the set, it will not be modified in the course of the function call. The syntax is: 65 `assigns location (, location)*` or `assigns \nothing`66 53 67 where `<memory-list>` is a comma-separated list of expressions of type `$memory`. 54 `assigns location (, location)*` or `assigns \nothing` or `assigns $everything` 55 56 where `location` is a `tset` expressions of type `$memory`. 68 57 69 58 Example: … … 77 66 This contractual clause specifies part of the dependence relation used in POR. 78 67 {{{ 79 $depends {e}68 $depends event (, event)* 80 69 }}} 81 where `e ` is an expression of boolean type. For each process `p`, the `e` can be evaluated in the context of `p`. If `e` evaluates to `true`, then `p` must be included in an ample set containing a call to this function.70 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. 82 71 83 72 The expression `e` hence defines a predicate d(s,p), where s ranges over states, and p over procs. The requirement is the following:
