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

Decompose globals does not flatten globalfunctions when supported #377

Closed
Dimosts opened this issue Jul 5, 2023 · 0 comments · Fixed by #378
Closed

Decompose globals does not flatten globalfunctions when supported #377

Dimosts opened this issue Jul 5, 2023 · 0 comments · Fixed by #378

Comments

@Dimosts
Copy link
Collaborator

Dimosts commented Jul 5, 2023

As revealed by #370 and discussed in #366, the current version of decompose_in_tree, e.g. [(count([IV1,IV2,IV3],1)) - 2 == 0] stays like that. This creates a problem in solvers that support count only in a direct comparison and that do not use any other transformations later (like minizinc). If flatten is used, like in ortools, this is not a problem, but we should not always have to use flatten to support them.

In my opinion, we should directly flatten these cases in decompose_in_tree. It is easy to do so, using normalized_numexpr(), and offers many benefits.

I will open a PR with this and we can decide if we move towards this or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant