head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2026.11.17.01.10.16; author alnsn; state dead; branches; next 1.1; commitid ZREZADwpPJ5jDK3H; 1.1 date 2026.10.10.14.31.03; author alnsn; state Exp; branches; next ; commitid 0hWA24U11kNYgWYG; desc @@ 1.2 log @Update math/minizinc to version 2.10.1, add math/gecode support. Version 2.10.1 (released 31 August 2026) Packaging changes: * The naming scheme for GitHub release assets has changed to use the build target triple. * Windows ARM64 packages are now available. * Separate ARM and Intel macOS packages are provided instead of a single universal binary. * Packages containing the MiniZinc command line tools and solvers are now available without the IDE. * Docker images are now released on the GitHub Container Registry, including -dist variants which contain only the MiniZinc installation and are designed to copied into other images. Changes: * Add an experimental parser using the tree-sitter grammar shared with shackle, enabled by setting the MZN_TREE_SITTER_PARSER environment variable. Syntax that is not yet supported, such as class declarations and lambdas, is rejected by name rather than as a generic syntax error. Data files are read with a separate, stricter grammar that accepts data, not all MiniZinc expressions. A warning is issued for invalid data, but will not be accepted in the future. * Harden how external FlatZinc solvers are launched. On POSIX, the solver is now started with posix_spawn in its own process group, using close-on-exec pipes and full error checking. On Windows, the solver inherits only the three standard I/O handles (instead of every inheritable handle) and is placed in a kill-on-close job object, so it is reliably terminated together with MiniZinc. Several descriptor and handle leaks were fixed in the process. * Extend the Xpress solver interface with support for lazy constraints, lexicographic multiple objectives (via the goal_hierarchy annotation), and user cuts, and enable quadratic and bilinear constraints. * Make built-in Gecode solver interface handle restart annotations and statistics output. * Greatly reduce the memory used by two-pass compilation (--two-pass, -O2 and above). The paths that identify variables between passes were stored as one string per variable, each spelling out the file name of every frame on the flattening call stack, and held several times over. They are now an interned tree of shared frames, and the text is only built when --keep-paths or --output-paths asks for it. Where an expression has picked up more than one path, the deepest one is now kept. Previously the textually longest was kept, which could prefer a shallower path that happened to run through longer file or function names (issue 1029). Bug fixes: * Fix a crash when projecting a field that is itself a tuple or record out of an array of tuples or records (as in x.1 and x.1.1 for any: x = [((1, 2), 3)]). The projection gave the resulting array type the type id of the field instead of an array type id, which was then misinterpreted when the element type was looked up again. * Fix a crash when indexing or slicing the result of a projection (as in x.1[1] and x.2[1..2] for any: x = [((1, 2), 3)]). Array access was the only context that did not coerce its object, so the projection was never rewritten into a comprehension and reached evaluation as a field access on an array. This affected fields of any type, not just structs. * Fix projecting an array-valued field out of an array of tuples or records (as in x.1 for any: x = [([1, 2], 3)]). The result is an array of arrays, but the projection did not build the tuple wrapper that represents one, dropping the field's own dimensions and producing an array of the element type instead. The model was then accepted with a wrong type and failed in evaluation with not an integer expression, or, for a var field, handed malformed FlatZinc to the solver. * Fix possible process hanging after receiving IDE interrupts on Windows. * Fix incorrect return type of select_from_index_X and concat_index_X functions. * Fix incorrect index restriction for concat_index_6 function. * Fix output reverse mapping for tuples/record function parameters which shadow top-level declarations of the same name. * Fix element type of concatenated multi-dimensional par arrays * Fix a crash in the Gecode presolver (-O3 and higher) when the flattened model contains a set_in constraint on an integer variable. The argument was tested for being a variable rather than for being a Boolean variable, so the integer variable was looked up in the space's Boolean variable array (issue 1027). * Fix in on records/tuples whose members are all fixed (issue 1027). * Fix possible crashes while handling stack overflows on Windows which previously would have prevented the stack trace from being printed. * Fix clearing of internal annotations from array declarations in FlatZinc. Version 2.10.0 (released 23 July 2026) Changes: * Add reified regular constraint decompositions. Rewrite to direct decomposition if non-reified regular is also a decomposition, or to an augmented automaton if a native regular constraint is available. * Add an experimental assumption interface. The new assume predicate (in experimental/assume.mzn) records a set of Boolean assumptions and lowers them to a solver-overridable fzn_assume. Solvers that support solving under assumptions can report an unsatisfiable core, which is translated back into the original MiniZinc expressions and printed as a %%%mzn-core comment (or a core message in the --json-stream output). Solvers without native support post the assumptions as hard constraints and issue a warning. * The SCIP interface is now only compatible with SCIP 10 and later. * Some performance improvements through better inlining and reducing allocation in hot paths of the compiler. * Compile root forall constraints with variable generators or where clauses in root context instead of reified context. * Improve compilation of comprehensions with complex variable generators by moving the generator expression into a generator alias. * Add an experimental black-box propagator interface. A bodyless predicate or function annotated with ::minizinc_value_propagator or ::minizinc_bounds_propagator (in experimental/blackbox.mzn) together with a source annotation (::blackbox_exec for an external executable or ::blackbox_dll for a dynamically loaded library) has its body generated by the compiler as a call to a solver-overridable blackbox / blackbox_bounds constraint. Supporting solvers invoke the external code during search to propagate values or bounds; solvers without support abort with a clear message. * Add support for interactive FlatZinc solvers. These can read commands from standard input while running, and output both solutions and messages. * Add support for warm starts to HiGHS and SCIP interfaces. * It is now a type error to declare two overloads of a function or predicate that a call supplying all of its arguments by name could not tell apart, i.e. two overloads that give the same name and type to every parameter that has to be supplied. Previously such a call silently resolved to whichever overload was declared first. Parameter order is irrelevant here, and parameters with a default value are exempt, since a call need not supply them. * The parameter names of the global constraints in the standard library have been revised so that they read well as named arguments (now that named arguments make them part of the public interface). As part of this, all_different gains an optional except set parameter (defaulting to the empty set), unifying it with all_different_except and all_different_except_0, which are now deprecated. Language changes: * Add support for named arguments. Function calls can now refer to arguments by name, in addition to the usual positional arguments. The parameter names of the global constraints in the standard library have been revised so that they read well as named arguments (now that named arguments make them part of the public interface). It is now a type error to declare two overloads of a function or predicate that a call supplying all of its arguments by name could not tell apart, i.e. two overloads that give the same name and type to every parameter that has to be supplied. Named arguments are available for user-defined and library operations. The low-level operations a solver supports natively (those declared without a body) remain positional-only for now, until solver libraries have converged on a common set of parameter names; calling one by name is an error. The new --warn-non-authoritative-names option helps solver implementers audit their libraries against the standard-library names ahead of that change. * Add support for default values for function and parameter arguments. * Add support for set cardinality declarations using the syntax set(e) of T: s;. When e has type int or var int, this desugars to an additional card(s) = e constraint; when e has type set of int or var set of int, it desugars to card(s) in e. The syntax works for tuple- and record-typed sets as well as arrays (and arrays of arrays) of sets. * Add support for index-dependent array declarations, where an index list entry of the form c in S binds the name c in the element type's domain expression -- for example array[c in 1..n] of var 1..f(c): x;. The per-element domain is desugared into an additional constraint and works for tuple- and record-typed elements as well as arrays of arrays; it also composes with the set(e) of T cardinality syntax. * Make the list type behave like a real 1-based array type. It is now syntactic sugar for array [1..infinity] of T. Checks ensure that only 1-based arrays match the list type. * Allow par tuples and records to be optional. opt makes the tuple or record optional as a whole (it is either a complete value or <>); it does not distribute into the fields, so opt record(int: a) remains a different type from record(opt int: a). Accessing a field of an optional tuple or record yields an optional value. var opt tuples and records remain type errors, including when the var comes from a field, since a tuple or record with any var field is itself var. Bug fixes: * Fix a crash (segmentation fault) when a non-optional variable is constrained to be equal to an absent optional value. The model is now correctly detected as unsatisfiable (issue 1023). * Fix a crash when finalising FlatZinc for models containing chains of equality constraints between output variables. Depending on the order, the alias chain could collapse into a cyclic right-hand side (issue 1022). * Fix x=infinity and x=-infinity being incorrectly translated when used in reified positions. * Fix a bug in type specialisation that could produce incorrect internal type representations for tuples. * Fix spurious UNSATISFIABLE results under -O1 for half-reified constraints whose right-hand side uses a pinned var float as a coefficient operand. The LE chain compressor was incorrectly adding the folded-in constant offset to the RHS instead of subtracting it (issue 1020). * Fix parsing of JSON data files with enumerated or record types where the model contains a type alias for the type of the parameter. * Fix the type signature of set_search to allow sets of enums without warning about enum2int conversion (issue 1024). * Fix flattening of annotated array declarations that have a right-hand side, which could previously crash. * Make list of list of T work correctly (was previously rejected with a type error). * Fix eval_par abort when projecting a par field of a polymorphic any $T result instantiated at a record/tuple with mixed par and var fields. * Add missing defines_var/is_defined_var annotations for mod. * Fix SCIP interface to be compatible with SCIP 10, which is not binary compatible with previous releases due to changed enum values in the C API. * Fix freelist allocation in garbage collector to use proper alignment. This fixes an issue on 32-bit platforms where freelist entries were not being reused. * Fix garbage collector handling of free pages. Release them when they only contain freelist entries. * Fix memory leaks in SolverConfig and the flattener, which leaked model objects in every run. * Fixed some flattening non-determinism. Several sorting and comparison operations still relied on pointer comparisons and have been replaced with deterministic alternatives. * Fix incorrect double-negation of certain operators in negative contexts. * Fix a bug in the handling of set variables assigned to set constants, which would ignore the variable's domain under certain conditions. * Fix false positive index set mismatch when passing a tuple/record containing and array as an argument to a function and calling it multiple times with different array index sets. * Fix boolean context for call arguments and local declaration right-hand sides of type array [_] of var bool. * Add missing GC lock to EnvI::fail(). * Fix index-set checking for arrays nested inside other arrays, where an outer array does not have a declared index set but the inner array does. * Fix default operator for var opt LHS expressions which end up being fixed to <> (issue 1030). @ text @$NetBSD: patch-share_minizinc_Preferences.json,v 1.1 2026/10/10 14:31:03 alnsn Exp $ Gecode isn't yet available in pkgsrc. --- share/minizinc/Preferences.json.orig 2026-10-10 14:02:45.887783345 +0000 +++ share/minizinc/Preferences.json @@@@ -1,6 +1,6 @@@@ { "tagDefaults": [ - ["", "org.gecode.gecode"] + ["", "org.chuffed.chuffed"] ], "solverDefaults" : [ ["org.minizinc.mip.gurobi", "-DQuadrIntSolverConfig=true", ""], @ 1.1 log @Import minizinc from wip, version 2.9.7. MiniZinc is a high-level constraint modelling language that allows you to easily express and solve discrete optimisation problems. This is a minimal working version of MiniZinc with no Gecode integration. @ text @d1 1 a1 1 $NetBSD$ @