Common mistakes
Using = for strings
Use == for string equality:
# Wrong
arrival(sender | sender = "carol@example.net")
# Correct
arrival(sender | sender == "carol@example.net")
Use != for string disequality:
Using == for numbers
Use = for numeric equality:
Use <> for numeric disequality:
Forgetting a signature
Every event name used in an expression needs a signature:
Forgetting the final expression
Named expressions are definitions, not the final monitored expression. End the file with the expression to monitor:
Using init in the wrong mode
init is parsed by the syntax, but SyMon only supports initial constraints with
parametric timing constraints. If SyMon reports that initial constraints are not
supported, remove the init block or run the appropriate parametric timing
mode. See Execution modes.
Mixing up one_of and all_of
one_of branches are separated by or:
one_of {
arrival(sender | sender == "alice@example.com")
} or {
arrival(sender | sender == "carol@example.net")
}
all_of branches are separated by and:
all_of {
arrival(sender | sender == "alice@example.com")
} and {
arrival(sender | sender != "blocked@example.net")
}
This is wrong:
one_of {
arrival(sender | sender == "alice@example.com")
} and {
arrival(sender | sender == "carol@example.net")
}
Trying to update event fields
Updates assign to global variables declared in var, not to fields declared in
an event signature:
var {
saved_sender: string;
}
signature arrival {
sender: string;
}
arrival(sender | | saved_sender := sender)
Back to the Syntax overview, or continue with Syntax examples.