======================
# MiniZinc Changelog #
======================

All bug numbers refer to the issue tracker at
https://github.com/MiniZinc/libminizinc/issues

Version 2.4.2
=============

Changes:
- The test suite is now integrated into the continuous integration
  system.

Bug fixes:
- Fix flattening of negated disjunctions (#359).
- Fix simplification of Boolean constraints (repeated simplification
  could sometimes crash).
- Fix memory management during flattening of conditionals (#358).
- Fix type inference for rewriting of sums into count constraints,
  and only apply the rewriting for var type-insts.
- Fix handling of solution checkers (these used to produce spurious
  error messages).

Version 2.4.1
=============

Changes:
- Improve compiler optimisation for some linear, multiplication and
  Boolean constraints.
- Improved translation of lex and all_equal constraints when the
  arrays have no or only one variable.

Bug fixes:
- Fixed regular expression constraint for expressions containing negated character
  classes (^ operator).
- Fix element constraint in nosets.mzn library when set domains are not
  contiguous.
- Correctly identify Windows paths starting with // or \\ as absolute
  (this enables the parser to open files stored on network drives).
- Use set_in constraints (rather than int_in) for internal Gecode-based
  presolver. This fixes some issues when compiling with -O3.
- The optimisation phase of the compiler now fully substitutes par bool
  variables (these can be introduced into the FlatZinc during multipass
  compilation). Partially fixes #357.
- Fixed the reference counting for variables that are re-used in
  multipass compilation. Partially fixes #357.
- Remove incorrect error handling when parsing from strings rather than
  files. Partially fixes #357.
- Made the is_fixed builtin work for more types. Fixes #356.
- Enable rewriting of sum(i in x)(i=c) op d and count(x,y) op z into
  global counting constraints.
- Split up count global constraints into separate files for reified
  versions.
- Use contiguous range for array index set in set_lt for nosets.mzn.
- Negate results of conditionals if required. Fixes #355.
- Partiality of conditional needs to be translated in root context
  (even if conditional itself is negated). Fixes #355.
- Don't copy function into output again if it was already copied (and
  made par) before. Fixes #323.
- Define card function on var sets in terms of set_card FlatZinc builtin.
- Don't set bounds for set variables in internal Gecode presolver.

Version 2.4.0
=============

Changes:
- The compiler now detects counting constraints in expressions such as
  count(i in x)(i=3) <= 4 and rewrites them into global counting constraints. This
  is now the preferred way to specify counting. The atmost/atleast/exactly constraints
  on integer variables have been deprecated, and versions of count predicates with
  par variables have been added. FlatZinc solvers that supported atmost/atleast/exactly
  should now support the corresponding fzn_count_?_par predicates.
- The compiler now supports the command line option --output-detailed-timing, which
  provides timing information for each toplevel constraint item, or for each line of
  code when used in conjunction with the --keep-paths option.
- The library now contains annotations for deprecated library functions.
- A par version of the inverse function has been added (include inverse_fn.mzn to use it).
- The common case of sums of optional variables is now handled more efficiently. This
  case often arises from generator expressions with variable where clauses.
- Added set_to_ranges built-ins to enable efficient iteration over sets. These are used
  to implement set_in for float variables, which was missing before.
- The Gurobi and CPLEX backends now support the --random-seed command line option.
- The Gurobi and CPLEX backends now use nodefile for search trees exceeding 500 MB
  (--nodefilestart can change this value and --nodefiledir the folder.)
- The MIPDomains optimisations have been switched back on by default. The optimisations
  have also been strengthened for some special cases.
- Without the MIPdomains postprocessing, linearisation of variable domains with holes
  now uses set_in instead of individual not-equal constraints, which may result in more
  compact FlatZinc.
- Linearisation of multiplication can now consider the exact domain of a factor.
- The product functions have been made non-recursive in order to support longer
  arrays.
- Bounds inference for results of if-then-else expressions has been improved.
- Support for optional float variables has been added.
- The interfaces to CBC, CPLEX and Gurobi now report correctly that they support
  verbose output during solving (so that the "verbose solving" option is available
  from the MiniZinc IDE).

Bug fixes:
- Fixed output handling on Windows (output is now processed on the main thread,
  so that exceptions thrown during output are printed correctly, and memory
  management is thread safe).
- Fixed decomposition of reified mdd constraint, and strengthened decompositions
  of mdd and cost_mdd.
- Fix handling of variable re-definitions (e.g. converting sets to arrays of bools),
  which would previously sometimes result in variables being removed although they
  were required for output, or the reverse mapping function not being available
  in the output model.
- Include regular.mzn from regular_regexp.mzn. (#351)
- Inlining of function calls has been moved from the flattener into the type checker, and
  it now is more strict about which functions can be inlined in order to avoid overloading
  issues.
- Updated fzn_count_{neq,leq,lt,geq,gt}, fzn_global_cardinality_low_up{,_reif} to use use
  the count_eq predicate. (#334, #335)
- Fixed the documentation for several constraints, which did not display as bullet point
  lists as intended.
- Copy function/predicate declarations into FlatZinc without annotations, since most
  FlatZinc parsers would not expect annotations and fail to parse.
- Process right hand side of par VarDecls to make sure any identifiers it uses are copied
  into the output model. Fixes #336.
- Fix type checking for conditionals where the else branch has enum type but the then
  branch has int type.
- Make the deopt function return correct enum instead of int type.
- Fix for path handling when 'needRangeDomains' is active. Avoids infinite recursion in
  the compiler.
- Fix race condition in temporary file generator for Windows. (#349)
- Register fzn_ names for Gecode presolver. Fixes command line flags -O3 and above.
- Fix par evaluation of float and bool set comprehensions.
- Fix documentation of array_bool_xor. Fixes minizinc/minizinc-doc#13.
- Fix the round() built-in to correctly round negative numbers
- Fix computation of intersection of domains when assigning an array to an array variable.
  Fixes #310.
- Add defines_var annotations for functional global constraints. Fixes #345.
- Add set_lt_reif/set_le_reif to flatzinc builtins library. Fixes #338.
- Clarify set order based on spec. Fixes #339.
- Don't return already removed VarDecl objects from CSE. Fixes #346.
- Do not post y!=0 constraint if 0 is not in the domain (workaround for a limitation in the
  handling of basic float constraints). Fixes #344.
- Help type checker by making deopt/occurs argument types explicit. Fixes #331.
- Fix transfer of domains when aliasing one variable to another
- MIP: fix for aux_float_ne_if_1
- MIP: int_(eq/ne)_imp: don't force eq_encode without MIPdomains
- Fix a typo in the definition of fzn_at_least_int{,_reif}
- Fix dependency problem in the gecode_presolver table specification
- Add seq_precede_chain.mzn to globals.mzn. Fixes #332.
- Don't assign right hand side of set variables if domain is singleton. Fixes #330.
- Don't invalidate float bound just because an expression contains an integer.
- Fix copying of let expressions.
- Put lexer and parser helper functions into MiniZinc namespace to avoid linker issues.
  Fixes #325.
- Reset array index sets defined in lets inside recursive function calls.
- Arrays copied into output model need to have par type-inst. Fixes #322.
- Don't complain when same function is registered twice. Fixes #323.
- Fix partiality handling of if-then-else expressions.
- Track whether variable is used in an output array before making decision to compress
  implication chains. Fixes #318.


Version 2.3.2
=============

Changes:
- Add warm starts and subtour cuts to CBC interface.
- Add documentation and assertion requiring that mdds are deterministic,
  and add nondeterministic variant of mdd constraint.
- Add -s to the standard flags supported by MIP interfaces.
- Add flag --output-output-item to include user specified output item in
  the formatted JSON and DZN output.

Bug fixes:
- Fix a bug that could leave unused variables in the resulting FlatZinc.
- bounded_dpath should rewrite to fzn_bounded_dpath. Fixes #300.
- Fix definition of sum_set.
- Check if overloaded function required for output. Fixes #303.
- Move regular constraint with set argument to its own file.
- Flatten assignment generators if necessary.
- Simplify fzn_value_precede_chain_int and avoid use of element predicate.
  Fixes #307.
- Only initialise par opt variables as absent if they are not arrays.
- Fix the description of the neural_net predicate.
- Fix regular constraint with regular expressions (stopped working in 2.3.0).
- Fix the model interface output to include the same variables as the generated
  output statement.
- Fix CSE for removed variable declarations. Could lead to reified constraints
  not being compiled correctly when the control variable got fixed to true.

Version 2.3.1
=============

Bug fixes:

- Report error when trying to assign an array literal to an array variable with incompatible index set.
- Fix partial evaluation of expressions, so that only par expressions are fully evaluated. Fixes #298.
- Remove carriage returns when reading piped solver output on Windows.
- Canonicalize paths of executables to avoid spurious warnings about multiple executables for the same solver.
- Add implementations for != on arrays.
- Compute quotient bounds before decomposition of int_div in linearisation library.
- Propagate domain constraints on variables that are aliased (previously domain constraints could get lost).
- Propagate domain constraints from left-hand-side to right-hand-side in variable assignments.
- piecewise-linear: reuse decomposition for X when only Y-values change.
- nosets: add set_in_imp(var set) and simplify set_in_reif, set_eq(var set, var set).
- linearisation: improved compilation of set_in constraints.

Version 2.3
===========

Major Changes:

- The compiler can now generate FlatZinc with half reified constraints. See
  https://www.minizinc.org/doc-2.3.0/en/fzn-spec.html#reified-and-half-reified-predicates
  for more details.
- The standard library of global constraints has been reorganised, making it
  easier for solvers to override just the bits that they support. See
  https://www.minizinc.org/doc-2.3.0/en/fzn-spec.html#solver-specific-libraries
  for more details.
- There is experimental support for solvers that can read AMPL NL files.

Minor Changes:

- The JSON input and output has been improved, with full support for enums and
  optional types.
- A new compiler option -g has been added, which turns variable domain changes
  into constraints (useful for debugging models).
- The SCIP interface has been updated, with support for indicator constraints,
  bounds disjunctions and a native cumulative constraint.
- Error reporting has been improved, with location information available for
  errors in par float expressions as well as include items.
- The timeout command line parameter now also applies to compilation itself
  (#281).
- Operations on par float values are now checked for overflows.
- The arg_min/arg_max constraints have been improved, with new special versions
  for Boolean variables, and a better standard decomposition.
- if-then-else-endif expressions with variable conditions are now compiled to a
  predicate call (rather than handled by the compiler), which enables solver
  libraries to implement these as native constraints or special decompositions.
- Dividing a variable by a constant is now translated as a multiplication (to
  keep the constraints linear).
- A new piecewise_linear predicate has been added to the library to make it
  easier to specify piecewise linear constraints.
- Print number of solutions as mzn-stat after solving (#244).
- Make search annotations work for arbitrary array index sets.

Bug fixes:

- Translate let expressions that contain constraints or variables as var
  type-inst. Fixes #263.
- Fix JSON array parsing by counting elements instead of commas.
- Fix parsing of the -p flag (#271).
- Fix type checking for array declarations with single enum type inst 
  identifier. E.g. array[$$T] of $U previously matched any multi-dimensional 
  array, and now only matches one-dimensional arrays with any enum index set.
- Fix computation of function return type when using type inst variables (#272).
- Evaluate each variable declaration only once in a par let expression.
- Check domain constraints on variable declarations in par let expressions.
- Try .exe/.bat on windows when using (constructed) absolute paths.
- Fix array slicing to support empty slices (#275).
- Fix a bug in the parser that could cause crashes on certain syntax errors.
- Fix the type of bool2int for arrays.
- Initialise counter for introduced variable ids based on names in original 
  model. This avoids reusing variable names if the user model contains names 
  such as X_INTRODUCED_0_.
- Fix compilation of nested clause/exist constraints, and improve handling of 
  negation. Tries to use primitive negation instead of creating negated 
  constraints. Should help with half-reification by creating more positive 
  contexts.
- Reorder fields in basic data structures to reduce padding on 64 bit platforms 
  (improved memory footprint).
- Perform type coercion after desugaring array slicing.
- Translate arguments to bool2int, exists, forall in positive context even if 
  those functions are redefined.
- Don't evaluate par array literals twice (inefficient, and can lead to 
  incorrect results when using random number generators).
- Terminate child processes when minizinc process is terminated by signal.
- Fix function return value array index check for empty arrays (#286).
- Fix translation of constant false where clause in array comprehension.
- Report error when json multi-dimensional array is not rectangular.
- Check index sets of function arguments (#273).
- Ignore partiality variables from CSE table when compiling _reif and _imp 
  predicates (#269).
- Flatten comprehensions with variable generators or where conditions before 
  evaluating any par functions on them (#259).
- Add missing redefinitions of basic operators and search annotations for 
  optional integers.
- Resolve filenames given on the command line relative to working directory,
  and warn if file in working directory has same name as included file from the
  library. Fixes #276.
- Update nosets library with a valid redefinition of set_less over booleans.
- Fix translation of showJSON (#294).
- Only apply set2array coercion for supported types, otherwise report error 
  (#295).
- Improve special case reasoning for abs on strictly negative variables.
- Add bounds for floating point min/max result in the standard library.


Version 2.2.3
=============

Bug fixes:
 - Fix some typos in the library documentation.
 - Fix solution checking.
 - Fix line numbers in parsed locations on 64 bit platforms. Fixes #255.
 - Fix bounds computation for calls. Partially fixes #255.
 - Fix translation of var where clauses with more than 3 par components.
   Fixes #253.

Version 2.2.2
=============

Changes:
 - Some changes to the optimisation phase of the compiler, to take into account
   more variables and constraints.
 - Preliminary support for MIP cuts based on graph algorithms (only available
   when compiled with boost C++ libraries; not part of the binary distribution).
 - Set Release as default build type when nothing is specified (for CMake
   platforms that do not support multiple build types, like Makefiles).
 - Add builtins outputJSON() and outputJSONParameters() for creating an
   array of strings that capture the output and parameters of the model as JSON.
 - On Linux and macOS, add /usr/share/minizinc/solvers and
   /usr/local/share/minizinc/solvers to list of paths where solver configuration files
   can be placed.
 - Add OSICBC_INCLUDEDIR and OSICBC_LIBDIR cmake flags. Fixes #247.
 - Output search paths for solver configurations using --solvers command line option.
 - Add support for Gurobi 8.1
 - Support parsing from stdin and files at the same time. Fixes #242.

Bug fixes:
 - Fix crash when flattening top-level array comprehensions with var where
   clauses. Fixes #250.
 - Support input files with more than 1M lines. Fixes #245.
 - Special case handling for array literals in top-level foralls: flatten in root context.
 - Fix translation of if-then-else for branches with undefined right hand sides.
 - Only propagate defines_var annotation to the variable that's actually being defined
   (not others that arise from the same decomposition).
 - Don't flatten arguments of predicates like symmetry_breaking_constraint.
 - Remove output_var and output_array annotations from user models (these
   could cause crashes).
 - Fix precedences for weak operators (~+, ~-, ~=, ~*).
 - Fix min and max for opt var arrays to work when the bounds of the arrays are unknown.
 - Fix a bug in bounds computations for function calls.
 - Add missing superset FlatZinc builtin.
 - Fix includes in file values.hh for some platforms.
 - Fix a garbage collection issue when printing solutions.
 - Deal with the case that a variable that's required for output is assigned to a par variable.
 - Throw type error when an array has only absent values. Fixes #239.
 - Flatten all arrays in FlatZinc, also those coming from functional definitions. Fixes #240.
 - Use list of strings as mzn_solver_path entry in the preferences json file. Fixes #241.
 - Fix crash when output variable is defined using recursive function

Version 2.2.1
=============

Changes:
 - all_different, all_equal, {int,set,float,bool}_search now accept
   multi-dimensional arrays.
 - Add exponentiation operator (^).
 - Improve layout of generated library documentation for some constraints.
 - Relax typechecking to allow assignment of empty array ([]) to
   multi-dimensional array variables. This is required to make empty
   arrays work in JSON data files.
 - Enumerated types can now be initialised using lists of strings.
   This enables enumerated type support in JSON.

Bug fixes:
 - Cumulative constraint for linear solvers now accepts empty arrays.
 - show2d/show3d functions now do not add quotes around array elements and
   work for empty arrays.
 - Add support for slicing of arrays with enumerated types. Fixes #229.
 - Fix slicing of 1d arrays.
 - Fix bounds computation for float variable declarations. Fixes #225.
 - When FlatZinc solver is terminated due to a timeout, do not report this
   as an error.
 - Fix pretty-printing of multi-dimensional arrays where dimensions other than
   the first one are empty. Fixes #236.
 - Add support for where clauses on generator assignment expressions. Fixes #237.

Version 2.2.0
=============
This is a major release of MiniZinc, introducing many new features and improvements.

Major new features:
 - New minizinc command line tool
   Previous releases contained a minizinc command line tool that was not much more
   than a simple script that could execute the compiler, solver and output processor.
   The minizinc executable in version 2.2.0 is now the main frontend to compilation and
   solving and integrates all of the functionality. It has access to all installed MiniZinc
   solvers (both internal solvers and those interfaced through FlatZinc files), and can
   automatically select the required options (e.g., to include the solver-specific MiniZinc
   globals library).
   You can get a list of available solvers using the --solvers command line option, and
   select a solver using --solver. The minizinc executable can now also be used as a replacement
   for mzn2fzn (using -c) and solns2out (using --ozn-file).
 - Multi-pass compilation
   The compiler can now perform multiple passes in order to improve the target FlatZinc code.
   This can be controlled using the -O command line flags (-O0 to -O4). Multi-pass compilation
   is particularly useful when the target solver requires sophisticated decomposition of
   global constraints (such as for MIP solvers).
 - Solution checking
   You can now supply an additional model that will be used to check each solution produced by
   your main model. This can be useful for teaching MiniZinc (to give students automatic feedback)
   and if your main model is very complex but checking that a solution is correct is easy.
 - MIP solvers: support for FICO Xpress, and loading IBM ILOG CPLEX as a plugin
   We have added support for FICO Xpress (this requires compiling MiniZinc from sources).
   CPLEX can now be loaded as a plugin, which means that the binary distribution of
   MiniZinc has built-in CPLEX support (just bring your own CPLEX dll).
 - Language extensions
   The MiniZinc language has been extended with two new features.
   * Array slicing introduces syntax to conveniently select rows, columns or entire slices
     of arrays. For example, x[3,..] selects the third row of array x, while x[..,4] selects
     the fourth column, and x[3..5,2..7] selects a slice of rows 3 to 5 and columns 2 to 7.
   * Generator expressions can now contain multiple where clauses, e.g.
     forall (i in S where foo(i), j in T where i<j) (bar(i,j))
     This enables more efficient compilation compared to evaluating all where clauses in the
     inner-most generator. In addition to iteration (i in S), generators can now contain
     assignment expressions (j=foo(i)). This enables intermediate definitions that can then
     be used in further generators.

Changes and minor features:
 - The value of the objective can now be added automatically to the
   output using the --output-objective command line option. Using --output-mode dzn,
   this allows automatic output of all the free variables of the model.
 - Models that do not contain a solve item are now accepted and treated as "solve satisfy"
 - Support for naming constraints and expressions (using ::"name" syntax)
 - Error messages have been improved, they now contain more accurate location
   information.
 - The compiler can be instructed to accept multiple assignments to the same parameter
   (as long as they are all identical), using the --allow-multiple-assignments
   command line option.
 - Annotations for supplying warm start values have been added to the
   standard library (currently supported by the MIP solvers Gurobi and IBM ILOG CPLEX).
 - The compiler now accepts multiple .mzn files as input.
 - Memory consumption and garbage collection performance has been improved.
 - The conditional expression has been extended to support
   "if <cond> then <exp> endif" (where <exp> is bool)
 - Decomposition of one variable type to another (e.g. set into array of bool)
   has been improved.
 - MIP solvers Gurobi and IBM ILOG CPLEX use node files when over 3GB working memory
 - Gurobi and CPLEX support the MIPfocus parameter
 - Gurobi supports MiniZinc search annotations by setting fixed branching priorities
 
Bug fixes:
 - Consult the bug tracker at https://github.com/MiniZinc/libminizinc/issues

Version 2.1.7
=============

Changes:
 - Improved linearisation for some element constraints.
 - Improve performance of optimisation phase by using a queue instead of a
   stack.
 - Add --dll option for Gurobi backend to specify the Gurobi DLL to load.
 - Add more defines_var annotations.

Bug fixes:
 - Fix generation of variable names in output model (sometimes could contain
   duplicates).
 - Fix enum type inference for array literals with empty sets as their first
   arguments. Fixes #180.
 - Fix incorrect simplification of float domain constraints. Fixes #159.
 - Fix ceil builtin for float values.
 - Add superset decomposition for solvers that do not support set variables.
 - Fix three bugs in the garbage collector.
 - Fix a bug in flattening that would create duplicate variables when a
   variable declaration referred to another one in its type-inst.
 - Fix a crash in flattening of partial functions. Fixes #187.
 - Add missing deopt builtins for all par types.
 - Fix output for arrays of sets of enums.
 - Define more functions on par opt types. Fixes #188.
 - Fix type checker to accept arrays of opt set values.
 - Support printing of opt enum types. Fixes #189.
 - Fix evaluation of comprehensions in recursive functions.
 - Fix output of Gurobi backend when used in conjunction with solns2out.
 - Fix pthread linking for mzn-cbc.
 - Catch type error when set literal is declared that contains another set.

Version 2.1.6
=============

Bug fixes:

 - Fully evaluate parameters before binding formal arguments when evaluating
   call expressions. Fixes #177.
 - Fix incorrect simplification of Boolean constraints assigned to variables
   that are assigned to false
 - Fix bug in flattening of linear equations that contain the same variable on
   both sides
 - Fix un-trailing for let expressions, which could sometimes cause incorrect
   code to be emitted when lets are evaluated in nested loops. Fixes #166.   
 - Fix bug in JSON output of one-dimensional array literals
 - Fix unification of enum type-inst variables

Version 2.1.5
=============

Changes:
 - Some improvements to the linearisation library.
 - Make parser read multiple .mzn files correctly.
 - Enable better bounds computation for array access expressions on
   fixed arrays.
 - Perform better constant folding during optimisation phase. Fixes #155.
 - Don't rewrite pow function into multiplication in the case of power of 2.
 - Save some memory by making certain internal data structures more compact.
 - Improve source code location of identifiers in generator calls (should give
   more precise error messages).
 - Produce an error message when a comprehension attempts to iterate over an
   infinite set.
 - Produce better error messages for operations on infinite values (previously
   some errors did not contain a source code location).
 - Speed up garbage collection by pre-allocating some memory.

Bug fixes:
 - Fix range check for float literals in arrays.
 - Fix a bug where a constraint could be removed incorrectly. Fixes #150.
 - Include variables for dzn and json output from all included models, not
   just the main model. Fixes #153.
 - Produce multi-dimensional arrays in json output. Fixes #156 and #157.
 - Remove incorrect closing bracket from json output. Fixes #154.
 - Fix bounds computation of par int and float arrays.
 - Don't allow var access to arrays of strings or annotations (since that would
   require an element constraint and var string / var ann types).
 - Introduce int2float constraints where necessary for some linearisations.

Version 2.1.4
=============

Changes:
 - Add warning for MIP solvers that do not support -a option for satisfaction
   problems.
 - Print introduced variable names with additional underscore to make
   debugging FlatZinc easier. Fixes #147.
 - Add support for pow function in linearisation library.
 - Add support for parallel solving with CBC.
 - Flatten top-level conjunctions in the order defined in the model.

Bug fixes:
 - Fix a garbage collection bug that could cause dangling pointers when
   expressions were copied.
 - Fix type checker to allow empty arrays to be assigned to variables
   declared as arrays of enums.
 - Fix infeasibility check in MIP translation for some inequality constraints.
 - Improved defines_var annotations for reified xor constraints. Fixes #146.
 - Fix output of empty integer sets and deal with empty arrays in output models.
 - Fix MIP translation when boolean variables were removed due to aliasing.
 - Improve corner cases for linearisation of cumulative constraint.
 - Properly report undefinedness in par bool expressions.
 - Enable some additional constant folding during flattening. Fixes #149.

Version 2.1.3
=============

Changes:
 - Remove more internal annotations from the generated FlatZinc.
 - Detect failure earlier if optimisation pass leads to fixing of variables
   outside their domains.

Bug fixes:
 - Fix CBC backend to correctly print UNSAT message for models where the
   compiler already detected unsatisfiability, and print solution separators
   even where there is no other output.
 - Add missing var_dom function for arrays of optional integer variables.
   Fixes #133.
 - Fix aliasing for optional integer variables. Fixes #132.
 - Remove all annotations from output model.
 - Fix computation of return type for functions that return arrays of enums.
 - Don't output newline if user-defined solution separator or status message is empty
 - Fix return type computation for functions where return type contains
   enums.
 - Check finiteness of float literals and bounds. Fixes #138.
 - More checks for function return values. Fixes #136.
 - Fix var int comprehensions (now triggers error message instead of crash
   for var set of int comprehensions). Fixes #135.
 - Fix output of variables with quoted identifiers.
 - Fix flattening of let expressions that contain variables with undefined
   (i.e., partial) right hand side.
 - Make printing of error messages to stdout or stderr more consistent
   across executables.
 - Fix type checking of initialisation of enum types.
 - Improve error messages for array access and index set errors. Fixes #131.
 - Fix definition of multi-dimensional element constraints to impose
   correct bounds on index variables.
 - Fix binding analysis during type checking, which did not handle the
   shadowing of top-level declarations by comprehension generators correctly.
   Fixes #129.

Version 2.1.2
=============

Bug fixes:
 - Fix a bug in the type checking for generators that iterate over
   arrays of enums.
 - Fix a bug in the output handling of arrays of enums.
 - Fix handling of multiple output items (only the last item was
   compiled, now the concatenation is used for output as defined
   in the specification).

Version 2.1.1
=============

Changes:
 - Add missing min/max functions for set variables. Can be redefined to solver
   builtins using the new redefinitions-2.1.1.mzn library file.
 - Add support for option type expressions as objective functions.
 - Automatically coerce arrays constructed using ++ to any enum index set
   (in addition to array literals and comprehensions).

Bug fixes:
 - Include cmath header to fix compilation issues with some compilers. Fixes #125.
 - Fix a garbage collection bug in the type checking for enumerated types that would
   sometimes lead to crashes or incorrect error messages.
 - Fix type checking of comprehensions that involve enumerated types.
 - Fix bounds computation for var sets of enumerated types.
 - Support anon_enum function as documented.

Version 2.1.0
=============

Changes:
 - MiniZinc now supports enumerated types.
 - Solvers can be interfaced directly to the MiniZinc library, and MiniZinc
   comes with direct support for the CBC, Gurobi and CPLEX MIP solvers.
 - The linearisation library has been updated, resulting in much better FlatZinc
   being generated for MIP solvers.
 - Data files can be in JSON format, and MiniZinc can produce JSON output
   (using the --output-mode command line option).
 - Variables can be annotated as ::add_to_output instead of writing an output
   item.
 - The compiler can output information about the parameters and output variables
   of a model (using the --model-interface-only option).
 - Floats are handled better (detecting infinities and handling sets of floats).
 - Bounds can be computed for more expressions (instead of failing with an error
   message).

Bug fixes:
 - Fix a bug in optimization that could remove variables even if they are used.
   Fixes #123.
 - Fix float variable declarations with sets of floats as domains.
   Fixes #117 and #98.
 - Fix type checking and evaluation of asserts with array arguments. Fixes #109.
 - Fix abs(var float) declaration to work on floats without declared bounds.
   Fixes #106.
 - Fix a bug in the computation of int and float bounds that could result in
   incorrect bounds in some cases. Fixes #94.
 - Fix garbage collection when creating output models. Fixes #77.
 - Fix binary operators on optional variables (in some cases comparison
   operators were reversed).
 - Fix optimization of unconstrained variables (could sometimes lead to
   constraints being removed although they were not subsumed).
 

Version 2.0.14
==============

Changes:

 - Less aggressive aggregation of linear expressions in cases where it
   leads to much less efficient FlatZinc.
 - Don't create temporary variable for an array literal if it is discarded
   immediately anyway.
 - Only create new partiality variable for if-then-else expression if there's
   at least one var condition.
 - Replace recursive definitions of array_intersect and array_union with
   iterative ones.

Bug fixes:
 - Don't report warnings about partiality when using extended generator
   expressions.
 - Include cmath to enable building with some versions of gcc.
 - Constrain result of function call based on function return type if necessary.
 - Make sure linear expressions generated during binding of variables are
   properly flattened (including simplification of the linear expression)


Version 2.0.13
==============

Bug fixes:

 - Fix a bug in the Common Subexpression Elimination table of the compiler,
   which could lead to some constraints being dropped (especially when using
   linear redefinitions).
 - The output model sometimes did not include all required definitions,
   in particular when array declarations used identifiers to specify the
   dimensions.
 - The generated FlatZinc sometimes still contained bool variables that were
   not connected to the rest of the model, which could produce incorrect
   solutions being printed.
 - Fix a bug where warnings (e.g. about partial functions) could lead to
   crashes.
 - Fix the bounds computation for integer and float variables, which could
   produce incorrect bounds for linear expressions. Fixes #94.

Version 2.0.12
==============

Changes:

 - Partial functions are now always evaluated in their Boolean context,
   independent of whether they are par or var. If the result of a partial
   function is statically known to be undefined (such as division by zero or
   array access out of bounds), and it is used in a constraint expression,
   this now results in a warning instead of an
   error. Warnings can be turned off using the ::maybe_partial annotation.
   Fixes #43 and #74.

Bug fixes:

 - Fix a bug in the optimisation phase related to unification of aliased
   variables.
 - Fix short-circuit evaluation of Boolean expressions.
 - Fix a bug in the optimisation phase related to repeated simplification of
   some Boolean expressions.
 - Handle errors in output produced by solver without solns2out crashing.
   Fixes #80.
 - Fix a bug in the integer bounds computation that caused bool2int with an
   embedded conditional to crash.
 - Fix a problem with short-circuit compilation of == expressions when one
   side was a var opt bool.
 - Stop compilation when model is failed. Fixes a bug where mzn2fzn would
   sometimes not clean up the FlatZinc enough for the solver.

Version 2.0.11
==============

Bug fixes:

 - Fix parsing of hex and octal literals. Fixes #71.
 - Fix compilation of extended comprehensions. Fixes #72.
 - Fix computation of float array access bounds.
 - Fix aggregation of clauses (could sometimes ignore the negative literals).

Version 2.0.10
==============

Bug fixes:

 - Fix a bug in the optimiser that could lead to undefined variables in the
   generated FlatZinc. Fixes #70.

Version 2.0.9
=============

Bug fixes:

 - Need to take return type into account when copying functions to output
   model. Fixes #55.
 - Evaluate calls that result in arrays using eval_arraylit. Fixes #57.
 - Move inverse function to its own library file, so that it remains available
   when a solver provides an alternative for the inverse predicate.
 - Optimisation phase now recursively checks constraints when elements in an
   array become fixed.
 - Fix CMakeLists file to work for paths that contain spaces.
 - Distinguish between infix operators and regular functions in the generated
   html documentation. Fixes #61.
 - Made parser more robust against incorrect code.
 - Fix increment/decrement operators for IntVals and make all operations throw
   correct overflow exceptions.
 - Fix automatic type coercion for variables declared in let expressions.
 - Fix a crash when printing some error messages.
 - Fix compute_div_bounds builtin to return correct result for a division by
   zero.
 - Fix optimisation of Boolean constraints to use pointer equality instead of
   structural equality (same expression can occur multiple times in the
   FlatZinc).
 - Only optimise constraints that have not been removed yet.
 - Fix declaration of functional version of bin_packing_load. Fixes #64.
 - Set type of arrays returned from polymorphic functions. Fixes #65.
 - Fix parsing of quoted unary operator calls.
 - Only compute set functions when bounds are valid. Fixes #66.
 - Compute proper bounds for if-then-else expressions.
 - Report error when no reified version of a constraint is available. Fixes #67.
 - Fix type checking of annotations on binary operators.
 - Keep annotations when rewriting linear constraints and remove is_defined_var
   annotations from fixed variables. Fixes #69.

Changes:

 - Integer, Boolean and float literals are now cached to achieve better memory
   performance for some models.
 - Improve performance of parsing integer literals.
 - Improve handling of clause constraints.
 - Add source files of MiniZinc specification to the repository.
 - Limit maximum array size to enable better error messages.
 - Add implied_constraint predicate as a synonym for redundant_constraint.

Version 2.0.8
=============

Bug fixes:

 - Fix incorrect negation of some reified comparisons.
 - Make lb/ub functions work in more cases.
 - Fix several bugs in the optimisation phase (could lead to incorrect
   FlatZinc and crashes).
 - Fix a problem with reverse mapper functions when the result of the reverse
   mapper can be fixed to a constant.

Version 2.0.7
=============

Changes:
 - Improved propagation of Boolean constants in the optimisation phase. This
   should result in far fewer aliases and improves simplification of
   conjunctions, disjunctions and clauses.
 - Add special case handling for integer division by 1.

Bug fixes:

 - Fix FlatZinc generator phase, need to turn all array literal arguments into
   1-based single dimensional arrays.
 - Fix compilation of if-then-else expressions with var conditions (which didn't
   implement proper partiality/totality semantics). Fixes #42.
 - Provide correct bounds for weak opt var arithmetic. Fixes #51.
 - Need to be able to handle unflattened annotations. Fixes #53.
 - Fix generation of output model (needs to ignore items that have been removed
   previously).
 - Add missing lb(var set of int) builtin. Fixes #47.
 - Check that var set declarations have a finite element type. Fixes #46.
 - Fix translation context for binary operators on arrays.
 - Need to access IntVal::infinity as a function, otherwise depending on linker
   etc it may become 0 in some cases. Fixes #40.
 - Change pretty printer to use one less digit when printing float literals.
   This fixes #41 (or at least provides a workaround), but some double
   constants may still be rounded incorrectly when pretty printing and reading
   them back in. The real fix will be to output hex float literals (coming
   soon).
 - Distinguish between generalised comprehensions (iterating over sets) and
   iterating over arrays. Fixes compilation of comprehensions where iteration
   over an array is combined with var where clauses. Fixes #45.
 - Fix bug in creation of output model where sometimes chains of variable
   definitions could lead to crashes.
 - Avoi creating mutually recursive definitions in some corner cases, which
   could cause the compiler to run into infinite loops.
 - Don't copy vardecl items to output model that are already there. Fixes #44.
 - Remove domain from array declarations in FlatZinc (avoids problems with
   domains where holes need to be removed and when there are infinities in the
   domains)
 - Fix flattening of equality operator between non-opt and opt vars
 - Check that model contains a single solve and output item during type
   checking (previously, multiple output items were not detected and resulted
   in incorrect .ozn files).
 - Fix flattening of xor (arguments need to be in mixed context).
 - Use is_fixed in cumulative definition.
 - Fix bug where a par right hand side of a variable mentioned in the output
   would cause a crash.
 - Fix variable dependency tracking during rewriting in the optimisation phase.
   Could previously lead to variables being removed that are still required.
   Fixes #54.

Version 2.0.6
=============

Changes:
 - Add parser support for hexadecimal floating point constants.

Bug fixes:
 - Fix bounds computation for some calls (abs, int_times).
 - Fix flattening of some array declarations (when right hand side is
   an identifier).
 - Add four missing GC locks (could lead to incorrect garbage collection).
 - Compact output model only after optimisation phase (could lead to 
   incorrect items being removed from output model).

Version 2.0.5
=============

Changes:
 - Improve the standard decomposition for the cumulative constraint.
 - Better handling of binary operators during type checking and flattening,
   can sometimes avoid stack overflows (e.g. for large conjunctions).
 - Make ++ operator left associative (avoid stack overflows in the parser).
 - Add ::domain annotations to linear constraints generated from
   multi-dimensional element constraints.
 - Greatly improved linearisation library.

Bug fixes:
 - Fix recursive function calls that contain let expressions.
 - Fix compilation of comprehensions inside parametric functions.
 - Fix a memory leak in solns2out.
 - Fix a problem in the evaluation of binary operators.
 - Fix a bug in the flattening of array literals.
 - Fix a bug that would crash the parser on certain syntax errors in let
   expressions.

Version 2.0.4
=============

Changes:
 - Models can now be read from standard input (using the "-" or
   "--input-from-stdin" command line options). Thanks to Sebastian Kosch.
 - Improved handling of bool2int during FlatZinc generation.

Bug fixes:
 - Fix unification of aliased variables which could sometimes result in
   variables being removed although had a constraining right hand side.
 - Fix evaluation of set comprehensions.
 - Fix command line flag --no-output-ozn
 - Fix performance problem when evaluating array expressions inside lets.
 - Fix flattening of bool_xor redefinitions.
 - Fix partial evaluation of some array access expressions with var indexes.
 - Fix definition of geost constraint.
 - User-defined functions are now copied correctly into the output model
   if they are referenced in the output item.
 - Set comprehensions are fully evaluated.

Version 2.0.3
=============

  (Internal release that did not contain some essential fixes)

Version 2.0.2
=============

Changes:
 - The optimiser now removes simple domain constraints from the FlatZinc
 - The compiler now checks for integer overflows in all built-in operations
 - Report an error when the FlatZinc or ozn file cannot be opened for writing
 - Add support for 3d array literals (e.g.  [| |1,2|3,4|,|5,6|7,8| |] )
 - Add show2d and show3d functions for formatting array output
 - Add row/col functions for variable arrays (github issue #2)
 - Introduce builtins for creating random distributions
 - Add reverse library function
 - Postpone flattening of some reified constraints
 - Slightly improved compilation of partial function calls when it can be 
   inferred at compile time that their result is undefined
 - Allow functions with empty argument lists to be declared as
   function int: foo(); instead of just function int: foo;
 - Improve error reporting, in particular for errors in comprehensions
 - Enable expressions a..b where a and b are integer variables
 - Add redundant_constraint and symmetry_breaking_constraint builtins, these
   can be rewritten by solver libraries to allow e.g. local search solvers to
   ignore redundant constraints.
 - Improve flattening of predicates that simply return their arguments (makes
   the redundant_constraint and symmetry_breaking_constraint predicates work
   in more situations).
 - Replace command line option --only-range-domains by optional boolean value
   so that solver libraries can set the flag directly in their redefinitions
   file.
 - Stop flattening immediately when a model has been found to contain an
   inconsistency.
 - Improve flattening of array access expressions, in particular for nested
   array accesses that can be combined into a single element constraint
 - Add command line option -s or --statistics to print statistics about the
   generated FlatZinc
 - Improve bounds computation for if-then-else expressions
 - Clause arguments are compiled in positive and negative contexts instead of
   mixed. That means that predicates that introduce free variables can now
   be used in the positive part of a clause.

Bug fixes:
 - Fix simplification of linear expressions, negative coefficients could
   sometimes result in incorrect bounds
 - Fix bounds computation for unary minus operator
 - Add missing par set comparison builtins
 - Fix bounds computation for extended comprehension syntax
 - Fix a bug in the garbage collector that could sometimes lead to premature
   deletion of expressions
 - Fix bounds computation for set difference
 - Fix duplication of some arrays in the FlatZinc (github issue #3)
 - Fix bounds inference for variables bound to empty sets (github bug #3)
 - Fix bug in error reporting function, which would sometimes not report the
   entire call stack
 - Fix the generation of fresh variable names for generator expressions
 - Fix subtype check to allow empty arrays as subtype of arrays of sets
 - Fix crash when using assert/2
 - Fix bug when function used in output referred to par variable
 - Fix bug in type checker, the detection of cyclic definitions was not
   correct and could lead to stack overflows
 - Fix parser to accept expressions with two consecutive array accesses
   (like x[3][4], which are valid MiniZinc if x is an array of sets)
 - Fix error reporting when an evaluation error occurs within a comprehension
   generator
 - Report type error on some ambiguous function calls
 - Report type error on var sets with element type other than int
 - Report type error when trying to coerce a var set into an array
 - Report error when calling function with a value that is outside the
   declared parameter bounds
 - Fix arg_sort builtin to implement the correct semantics
 - Fix sort_by builtin to sort in non-decreasing order, and work with floats
 - Fix bug in type checker, now automatic coercions in functions defined with
   type variables (like the comparison operators) work correctly
 - Check that index sets match for arrays assigned in let expressions
 - Fix bug in bounds inference for integer expressions with annotations
 - Fix propagation of defines_var annotation to be pushed through calls
 - Fix parser to accept empty 2d and 3d array literals
 - Fix flattening to remove defines_var annotations with par argument, e.g.
   defines_var(2), which could be introduced by the optimisation pass
 - Fix output model creation for variables that have been redefined, and
   remove more unused variables from the FlatZinc.
 - Fix bug in the garbage collector that could result in function items not
   being kept alive in rare cases.
 

Version 2.0.1
=============

Major bugs and changes:
 - Fix optimisation phase, which was previously incorrectly removing variables
 - Add support for trigonometric functions (built-ins were missing in 2.0.0)
   and pow (var versions were missing)
 - Fix equality operator on par arrays
 - All expressions in output model are now made par
 - Improve bounds computation for float variables
 - Fix translation of functions that need automatic coercion of their return
   value
 - Fix the array_lb and array_ub builtins, which would return incorrect bounds
   in some cases

Minor bugs and changes:
 - Add space between "array" and "[" in the pretty printer, to be compatible
   with 1.6 output
 - Output all par declarations before the var declarations in FlatZinc
 - Fix parser, which could sometimes crash on invalid input
 - Improve efficiency of bounds computation on some float expressions
 - Add special case handling for division by 1
 - Add missing float_times definition to the flatzinc builtins
 - Use correct version of var_dom for float variables
 - Output information about which files are included in verbose mode
 - Only compute bounds for "then" expressions if the "if" is not fixed to false

Version 2.0.0
=============

MiniZinc 2.0 contains many new features and is based on a complete rewrite of
the MiniZinc-to-FlatZinc compiler. If you are currently using the previous
version 1.6, the new tools can be used as drop-in replacements. The generated
FlatZinc is compatible with version 1.6, so all FlatZinc solvers should work
without changes.

** MiniZinc language changes **

 - MiniZinc now supports user-defined functions. Details have been published
   in the paper "MiniZinc with Functions". Both functions and predicates can
   be recursive.
 - MiniZinc now supports option types. Details have been published in the
   paper "Modelling with Option Types in MiniZinc".
 - Let expressions have been generalised. They can now contain constraint
   items in addition to variable declarations.
 - Array index sets can be declared using arbitrary set expressions as long as
   they evaluate to contiguous ranges.
 - The if-then-else expression has been generalised to allow the condition to
   be a var bool expression (instead of only par bool).
 - Array and set comprehensions as well as generator calls can now iterate
   over variables and use var bool where conditions.
 - Any bool expression can now automatically coerce to an int expression,
   likewise for int and float. This means that you don't have to write
   bool2int or int2float in your models any more.
 - Equality constraints can now be posted between array expressions.
 - Arbitrary expressions can now be included ("interpolated") into strings,
   using the syntax "some text \(e) some more text", where e is any
   expression. It is the same as writing "some text "++show(e)++" some more
   text".

** New built-in functions **

Array functions: array1d, arrayXd, row, col, has_index, has_element, sort_by,
sort, arg_sort, arg_min, arg_max

** New global constraints **

 - arg_max, arg_min
 - arg_sort
 - k-dimensional diffn
 - disjunctive
 - geost
 - knapsack
 - network_flow
 - regular with NFAs
 - symmetric all different
 - optional scheduling constraints: alternative, span, disjunctive, cumulative
 - functional versions of many global constraints

** New tool chain **

 - There are a few new builtins that solvers can reimplement, these are listed
   in the redefinitions-2.0 file.
 - Include items use a different method for finding included files. Paths are
   now interpreted as relative to the file that has the include item. That
   way, the mzn2fzn compiler can be called from a different working directory.
 - A new tool, mzn2doc, can produce html output from the documentation
   comments. The MiniZinc distribution contains the documentation for global
   constraints and builtins generated directly from the library source code.
