inf and -inf values not escaped using --json-stream flag

9 views
Skip to first unread message

Simone Gazza

unread,
May 7, 2024, 8:48:29 PMMay 7
to MiniZinc
Hi,
I'd like to report a bug in MiniZinc version 2.8.3.

Specifically, when employing the HiGHS solver on an optimisation problem that is unsatisfiable, using the "-s", "--output-objective " and "--json-stream" flags: in this case MiniZinc releases JSON outputs containing values such as inf and -inf, but these values lack proper escaping (i.e., they're not written as "inf" and "-inf").

This leads to an error in parsing the JSON responses from MiniZinc, both in direct parsing from the standard output and when using the Python API for MiniZinc.

I have attached to this message an instance of the problem (in the form of model.mzn and data.dzn).
Here is the command used:
minizinc -s -d data.dzn model.mzn --json-stream --output-objective --solver highs

Thanks,
Simone.
data.dzn
model.mzn

Jip Dekker

unread,
May 7, 2024, 9:11:13 PMMay 7
to MiniZinc
Hi Simone,

The issue with the HiGHS solver have been resolved for the upcoming MiniZinc release, where the infinity values can be automatically resolved in the compiler.

A larger issue is the general is that a MiniZinc model might need to output positive or negative infinity. This issue was also reported here: https://github.com/MiniZinc/minizinc-python/issues/126
Likely we will implement both the way in which Python and JavaScript handle these values soon, and depending on an option a way to output infinity values as objects.

Cheers,
Jip
Reply all
Reply to author
Forward
0 new messages