| | 1 | == Types == |
| | 2 | * boolean |
| | 3 | * int |
| | 4 | * double |
| | 5 | * $proc : The process type. |
| | 6 | * $scope : The scope type. |
| | 7 | |
| | 8 | == Expressions == |
| | 9 | |
| | 10 | * +, - , * , / , % |
| | 11 | * = |
| | 12 | * ==, <=. >=, <, > |
| | 13 | * ++, -- |
| | 14 | * $true, $false |
| | 15 | * $self : The process invoking the expression (constant of type $proc). |
| | 16 | * $spawn f(e1, ..., e_n) : Spawn a process executing f on (e1, ..., e_n), return a reference to the process. |
| | 17 | * function calls |
| | 18 | |
| | 19 | == Statements == |
| | 20 | * Expression statement : Use an expression as a statement (e.g. i++;). |
| | 21 | * if-then-else statements : Same syntax as C. |
| | 22 | * while, for loops |
| | 23 | * $assert <expr> : Check that <expr> holds. |
| | 24 | * $assume <expr> : Add <expr> to the path condition. |
| | 25 | * $wait <expr> : For <expr> of type $proc, block until <expr> terminates. |
| | 26 | * $when (<expr>) S; : Guarded statement. Block until <expr> is true, then execute S. |
| | 27 | * $choose : A $choose statement has the form |
| | 28 | {{{ |
| | 29 | $choose { |
| | 30 | stmt1; |
| | 31 | stmt2; |
| | 32 | ... |
| | 33 | default: stmt |
| | 34 | } |
| | 35 | }}} |
| | 36 | The "default" clause is optional. |
| | 37 | The guards of the statements are evaluated and among those that are |
| | 38 | true, one is chosen nondeterministically and executed. If none are |
| | 39 | true and the default clause is present, it is chosen. The default |
| | 40 | clause will only be selected if all guards are false. If no default |
| | 41 | clause is present and all guards are false, the statement blocks. |
| | 42 | Hence the implicit guard of the $choose statement without a default |
| | 43 | clause is the disjunction of the guards of its sub-statements. |
| | 44 | The implicit guard of the $choose statement with a default clause |
| | 45 | is "true". |