Changes between Version 2 and Version 3 of Function_Contracts
- Timestamp:
- 01/11/16 16:56:17 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Function_Contracts
v2 v3 21 21 | 'Disjoint' (id (',' id)*)? 22 22 ; 23 }}} 24 25 Example 26 {{{ 27 fun[atomic] sendRecv(Int cmd, Pointer buf): Integer 28 Reads deref(buf); 29 Behavior send: 30 Depends writes(buf); 31 Assigns nothing; 32 Behavior receive: 33 Depends access(deref(buf)); 34 Assigns deref(buf); 35 { 36 begin choose 37 when eq(cmd, 0) 38 do CALL send, <buf, ...>; goto L1; 39 when eq(cmd, 1) 40 do CALL recv, <buf, ...>; goto L1; 41 when and(neq(cmd, 0), neq(cmd, 1)) 42 do NOOP; goto L1; 43 end choose 44 L1: 45 } 46 23 47 }}} 24 48
