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

[BUG] fzn_regular predicate syntax error #813

Closed
chillja opened this issue Jul 2, 2021 · 2 comments
Closed

[BUG] fzn_regular predicate syntax error #813

chillja opened this issue Jul 2, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@chillja
Copy link

chillja commented Jul 2, 2021

I believe the regular global constraint as describe for FlatZinc (here) does not match the FlatZinc Syntax. The function required is passed as array[int,int] of int: d, but array[int, int] is not a valid predicate parameter type as described here.

Possible solution
I haven't managed to come up with an appropriate replacement, but maybe to split it in a function in and a function out array?

Environment (please complete the following information):

  • Choco-solver version: 06dff9c (master branch Jun 5th)
  • MiniZinc: version 2.5.5

Additional context
(I personally have no immediate problem that is blocked by this, just wrote a fzn parser and tripped over a fzn model that was created with choco globals.)

@chillja chillja added the bug label Jul 2, 2021
@cprudhom
Copy link
Member

Thank you for noticing that error.
I will fix it asap.

CP

@cprudhom cprudhom self-assigned this Jul 21, 2021
@cprudhom cprudhom added this to the 4.10.7 milestone Jul 21, 2021
@cprudhom
Copy link
Member

The issue is already fixed.
Indeed, there are 2 signatures in the fzn file:

predicate fzn_regular(array[int] of var int: x, int: Q, int: S,
                         array[int] of int: d, int: q0, set of int: F);

predicate fzn_regular(array[int] of var int: x, int: Q, int: S,
                      array[int,int] of int: d, int: q0, set of int: F) =
  fzn_regular(x,Q,S,array1d(d),q0,F);

The latter (which is minizinc compliant) turns the call into the former (which is flatzinc compliant).

Thank you for your help
CP

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

No branches or pull requests

2 participants