Operators
Operators used in guards, assertions, and context updates.
Comparison Operators
Used in guards and assertions:
| Operator | Meaning | Example |
|---|---|---|
equals / is | Equal to | ? $total equals 100 |
is not | Not equal to | ? $status is not "cancelled" |
is greater than | > | ? $total is greater than 100 |
is less than | < | ? $count is less than 5 |
is at least | >= | ? $age is at least 18 |
is at most | <= | ? $items is at most 10 |
contains | Has element | ? $items contains "Laptop" |
is empty | Empty collection | ? $cart is empty |
is not empty | Has elements | ? $items is not empty |
State Transition Verbs
All equivalent - use what reads best:
| Verb | Example |
|---|---|
moves to | order moves to #paid |
transitions to | order transitions to #approved |
enters | payment enters #processing |
becomes | ticket becomes #closed |
changes to | status changes to #active |
Context Update Operators
Assignment
flow
$variable becomes value
$variable: type becomes valueArithmetic
flow
$total increases by 25
$balance decreases by $amountCollection
flow
$items adds "Laptop"
$items removes "Mouse"
$items clearsState Checks
flow
? order is in #pending
? order is not in #cancelled