File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
share/minizinc/std/stdlib Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ https://github.com/MiniZinc/libminizinc/issues.
66
77.. _unreleased :
88
9+ Changes:
10+ ^^^^^^^^
11+ - Add ``mzn_max_version_required `` to enable models to speficy the maximum
12+ version of MiniZinc required to run the model (:bugref: `872 `).
13+
914Bug fixes:
1015^^^^^^^^^^
1116- Fix the rewriting of the multidimensional search annotations to ensure
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ constraint
2424 mzn_version_to_string (mzn_compiler_version ()),
2525 );
2626
27+ /** @group stdlib.language If defined, this can be used to check that the MiniZinc compiler is not newer than the given version. */
28+ opt int : mzn_max_version_required ;
29+
30+ constraint
31+ assert (
32+ absent (mzn_max_version_required ) \/ deopt (mzn_max_version_required ) >= mzn_compiler_version (),
33+ "This model only works with MiniZinc up to version " ++
34+ mzn_version_to_string (deopt (mzn_max_version_required )) ++
35+ " but you are running version " ++
36+ mzn_version_to_string (mzn_compiler_version ()),
37+ );
38+
2739/***
2840 @groupdef stdlib.options Compiler options
2941*/
You can’t perform that action at this time.
0 commit comments