Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option -O5 gives errors. #755

Closed
vdijken opened this issue Nov 27, 2023 · 5 comments
Closed

option -O5 gives errors. #755

vdijken opened this issue Nov 27, 2023 · 5 comments
Assignees
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@vdijken
Copy link

vdijken commented Nov 27, 2023

A model run by minizinc -O5 model.mzn runs fine under version 2.8.0 but gives errors under version 2.8.1.:

Multiple type errors:
Error: type error: Type array[int,int] of bool is not allowed in as a FlatZinc builtin argument, arrays must be one dimensional
/MiniZinc/share/minizinc/gecode_presolver/fzn_table_bool.mzn:37.53-78

Error: type error: Type array[int,int] of int is not allowed in as a FlatZinc builtin argument, arrays must be one dimensional
/MiniZinc/share/minizinc/gecode_presolver/fzn_regular.mzn:38.19-42

The model does not have booleans but an 2-dimensional array containing 0 or 1. The only cause I see is that the optimizer changes the 0's and 1's in booleans. Without the option -O5 the model works fine,

@Dekker1 Dekker1 self-assigned this Nov 27, 2023
@Dekker1 Dekker1 added bug resolved Issue is resolved and the feature or fix will be part of next release labels Nov 27, 2023
@Dekker1
Copy link
Member

Dekker1 commented Nov 27, 2023

It seems that when we adjusted the check to make sure that the FlatZinc declarations are correct, we didn't correctly check that the internal version of the Gecode library was compliant.

Since the types were normally automatically corrected previously, patching the changes in the installed mzn library files would resolve the issue as a workaround.

@Dekker1
Copy link
Member

Dekker1 commented Nov 27, 2023

Fixed in c438ae6

(seems I forgot the commit tag)

@vdijken
Copy link
Author

vdijken commented Nov 28, 2023

Explanation for the reason why is clear. But have I wait until the next release before it is available? It is not clear to me how to perform the workaround in my environment.

@Dekker1
Copy link
Member

Dekker1 commented Nov 28, 2023

If you copy the updated MiniZinc files into your installation, then it should work immediately

@Dekker1
Copy link
Member

Dekker1 commented Nov 29, 2023

If it helps, we are now also publishing the development builds of MiniZinc: https://github.com/MiniZinc/MiniZincIDE/releases/tag/edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

3 participants