| 243 | | * `$pure` : the function has no side effects, but may be nondeterministic |
| 244 | | * `$abstract`: function is a pure, mathematical function: deterministic function of inputs |
| 245 | | * `$atomic_f`: function definition is atomic, and it never blocks |
| | 243 | * `\pure` : the function has no side effects, but may be nondeterministic |
| | 244 | * `\abstract`: function is a pure, mathematical function: deterministic function of inputs |
| | 245 | * `\atomic_f`: function definition is atomic, and it never blocks |
| 285 | | * assigns clause: `$assigns [condition] {memory-list}` |
| 286 | | * reads clause: `$reads [condition] {memory-list}` |
| 287 | | * `$reads {$nothing}` implies `$assigns {$nothing}` |
| 288 | | * `$reads {$nothing}` is equivalent to: `$reads {$nothing} $assigns {$nothing}` |
| 289 | | * `$assigns {X}` where `X != $nothing`, implies `$reads {X}` |
| 290 | | * `$assigns {X}` is equivalent to:` $assigns{X} $reads{X}` |
| | 285 | * assigns clause: `\assigns [condition] {memory-list}` |
| | 286 | * reads clause: `\reads [condition] {memory-list}` |
| | 287 | * `\reads {\nothing}` implies `\assigns {\nothing}` |
| | 288 | * `\reads {\nothing}` is equivalent to: `\reads {\nothing} \assigns {\nothing}` |
| | 289 | * `\assigns {X}` where `X != \nothing`, implies `\reads {X}` |
| | 290 | * `\assigns {X}` is equivalent to:` \assigns{X} \reads{X}` |
| 292 | | * absence of `$reads` clause: there is no assumption about the read access of the function, i.e., the function could read anything |
| 293 | | * absence of `$assigns` clause: similar to the absence of `$reads` clause |
| 294 | | * `$reads/$assigns {$nothing}` doesn’t necessarily means that the function never reads or assigns any variable. The function could still reads/assigns its “local” variables, including function parameters and any variable declared inside the function body. |
| 295 | | |
| 296 | | * For an independent function which has `$depends {$nothing}`, usually we also need to specify `$reads{nothing}`, for the purpose of reachability analysis. |
| | 292 | * absence of `\reads` clause: there is no assumption about the read access of the function, i.e., the function could read anything |
| | 293 | * absence of `\assigns` clause: similar to the absence of `\reads` clause |
| | 294 | * `\reads/\assigns {\nothing}` doesn’t necessarily means that the function never reads or assigns any variable. The function could still reads/assigns its “local” variables, including function parameters and any variable declared inside the function body. |
| | 295 | |
| | 296 | * For an independent function which has `\depends {\nothing}`, usually we also need to specify `\reads{nothing}`, for the purpose of reachability analysis. |
| 308 | | $atomic_f void sendRecv(int cmd, void*buf) |
| 309 | | $depends [cmd==SEND] {$write(buf)} |
| 310 | | $depends [cmd==RECV] {$access(*buf)} |
| 311 | | $assigns [cmd==SEND] {$nothing} |
| 312 | | $assigns [cmd==RECV] {*buf} |
| 313 | | $reads {*buf} |
| | 308 | \atomic_f sendRecv(Int cmd, Pointer buf; Int) |
| | 309 | \depends [cmd==SEND] {$write(buf)} |
| | 310 | \depends [cmd==RECV] {$access(*buf)} |
| | 311 | \assigns [cmd==SEND] {$nothing} |
| | 312 | \assigns [cmd==RECV] {*buf} |
| | 313 | \reads {*buf} |