Updates

An update is a comma separated list of expressions. These expressions will typically have side effects. Assignments to clocks are limited to the regular := assignment operator and only integer expressions are allowed on the right hand side of such assignments. The syntax of updates is defined by the grammar for Update:

Update ::= [Expression (',' Expression)*]

Note: Assignments are evaluated sequentially (not concurrently). On synchronizing transition, the assignments on the !-side (the emitting side) are evaluated before the ?-side (the receiving side).

Assignment Operators

The regular assignment operator, :=, can be used for assignment to integer and clock variables. The other assignment operators work as in C, e.g. x += 2 is equivalent to x := x + 2 except that any side effect of evaluating x is only executed once in the first case whereas it is executed twice in the latter case.

Assignment to integer variables are forced to be within range. An attempt to assign a value below the range of an integer variable will result in the integer obtaining the smallest value in its range. Similarly, an attempt to assign a value above the range of an integer variable will result in the integer obtaining the biggest value in its range. Notice: This behaviour is subject to change in future versions of UPPAAL. Any model deliberately using this behaviour should be considered bad.

Examples