Next: Cannot use otherwise guard with non-guard statements, Previous: Imperative statement expected, Up: Well-formedness – Mixing [Contents][Index]
otherwise guard more than onceAn otherwise guard catches the remaining cases for a list of
guards. For that reason it is not allowed to have more than one
otherwise statement in a list. So:
interface second_otherwise
{
in void hello ();
in void cruel ();
in void world ();
behavior
{
bool b = true;
[b] on hello: b = false;
[otherwise] on world: b = true;
[otherwise] on cruel: {}
}
}
This results in the following error message:
second-otherwise.dzn:11:5: error: cannot use otherwise guard more than
once
second-otherwise.dzn:10:5: info: first otherwise here