Constraints and updates
Atomic actions can contain a guard, updates, or both:
Constraints
Use && to combine constraints:
String constraints use == and !=:
| Construct | Meaning |
|---|---|
x == y |
string equality |
x != y |
string disequality |
x == "literal" |
compare with a string literal |
"literal" != y |
compare a literal with a variable |
String literals use double quotes.
Numeric constraints use <, <=, =, <>, >=, and >:
| Construct | Meaning |
|---|---|
n < m |
less than |
n <= m |
less than or equal |
n = m |
numeric equality |
n <> m |
numeric disequality |
n >= m |
greater than or equal |
n > m |
greater than |
Numeric expressions may use identifiers, numbers, parentheses, +, and -:
Numbers may be integers or decimals, with an optional leading -.
Updates
Use := to update global variables declared in var:
Separate multiple updates with semicolons:
String variables can be updated from a string literal or a string-valued identifier. Number variables can be updated from a numeric expression.
Updates target global variables, not event fields declared in a signature.
Guards without updates
When an action only checks a condition, use one |:
Updates without guards
When an action only performs updates, keep the empty guard section:
Next: Expressions, File structure, Syntax examples, and Common mistakes.