Open matsc-at-sics-se opened 3 years ago
We can change FlatZinc and still support older solvers by adding optional configuration parameters into the library. For example, we could add
opt bool: fzn_solver_supports_compact_sets;
and then the solver could set
fzn_solver_supports_compact_sets = true;
in its redefinitions.mzn
. I've been trying to come up with a reasonably simple syntax for this, so that solvers wouldn't have to change their parsers too much. E.g. we could extend the set literal syntax to accept lists of ranges {|1..999, 1001..2000|}
(this would also work in MiniZinc then). I don't want to support this for regular sets (such as {1..999, 1001..2000}
) because the type would imply that this is a set of sets. The alternative would be a functional form array_union([1..999, 1001..2000])
. If anyone has a strong preference one way or the other please let me know!
I would have a strong preference for an actual literal type such as {|1..999, 1001..2000|}
over the usage of the array_union
. It would seem strange to allow nested calls like constraint set_in(x, array_union(...))
in FlatZinc.
In addition, you could extend FlatZinc with the domain constraint (as in Sicstus Prolog) and produce one domain constraint for all variables having the same domain.
A set constant in FlatZinc can be arbitrarily larger in its printed representation than the same constant in MiniZinc. For example:
The problem (if it is a problem) would be solved by a
union
operator in FlatZinc. But, can you ever change the FlatZinc language?