forked from MiniZinc/libminizinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGES.txt
901 lines (794 loc) · 41.9 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
======================
# MiniZinc Changelog #
======================
All bug numbers refer to the issue tracker at
https://github.com/MiniZinc/libminizinc/issues
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.