In the MiniZinc tutorial, I noticed that the endif
keyword was repeated many times at the end of a series of conditional statements. Is it possible to write switch statements in MiniZinc as an alternative to this verbose syntax?
For example, I'd like to write this series of conditional statements more concisely:
predicate examplePredicate(var int:x, int:s) =
if s == 1
% some code goes here
else if s == 2 then
% some code goes here
else if s == 3 then
% some code goes here
else if s == 4 then
% some code goes here
else
% some code goes here
endif endif endif endif;