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

Problem with $T #65

jnmonette opened this Issue Nov 20, 2015 · 0 comments


None yet
1 participant

jnmonette commented Nov 20, 2015

The following piece of code cannot be flattened.

include "globals.mzn";

function array[int] of $T: my_row(array [int,int] of $T: x, int: r) = 
%function array[int] of int: my_row(array [int,int] of int: x, int: r) = 
     [x[r,i] | i in index_set_2of2(x)];

constraint all_different(my_row([|1,2|2,3|],1));

solve satisfy;

The error message is

in call 'all_different'
cannot find matching declaration

There is no problem if replacing the "my_row" declaration by the commented line (i.e. instanciating the "$T" to "int").

Note that the problem happens also with the original "row" function.

Note also that the problem happens even if the result of my_row is put in a local array of the proper (int) type inside a let statement.

@guidotack guidotack closed this in 942dab6 Dec 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment