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

--output-mode does not work when using include-statements. #153

Closed
einarjohan opened this Issue Mar 27, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@einarjohan

einarjohan commented Mar 27, 2017

It seems that the .ozn produced by a model with a single file, is not equivalent to the .ozn produced by the same model when broken up into multiple files and include-statements, at least when using --output-mode.

Take the example from the MiniZinc tutorial:

aust.mzn:

% Colouring Australia using nc colours
int: nc = 3;

var 1..nc: wa;   var 1..nc: nt;  var 1..nc: sa;   var 1..nc: q;
var 1..nc: nsw;  var 1..nc: v;   var 1..nc: t;

constraint wa != nt;
constraint wa != sa;
constraint nt != sa;
constraint nt != q;
constraint sa != q;
constraint sa != nsw;
constraint sa != v;
constraint q != nsw;
constraint nsw != v;
solve satisfy;

output ["wa=", show(wa), "\t nt=", show(nt), 
        "\t sa=", show(sa), "\n", "q=", show(q),  
        "\t nsw=", show(nsw), "\t v=", show(v), "\n",
         "t=", show(t),  "\n"];

If you run mzn2fzn against that, with "--output-mode dzn", you get a non-empty .ozn, however, if you divide this into two files:

variable_declarations.mzn:

int: nc = 3;

var 1..nc: wa;   var 1..nc: nt;  var 1..nc: sa;   var 1..nc: q;
var 1..nc: nsw;  var 1..nc: v;   var 1..nc: t;

aust.mzn:

include "variable_declarations.mzn";

constraint wa != nt;
constraint wa != sa;
constraint nt != sa;
constraint nt != q;
constraint sa != q;
constraint sa != nsw;
constraint sa != v;
constraint q != nsw;
constraint nsw != v;
solve satisfy;

output ["wa=", show(wa), "\t nt=", show(nt), 
        "\t sa=", show(sa), "\n", "q=", show(q),  
        "\t nsw=", show(nsw), "\t v=", show(v), "\n",
         "t=", show(t),  "\n"];

The same call to mzn2fzn yields an .ozn containing "output [];" and just that. If I move some of the variables back to aust.mzn, those variables are then visible in the output again.

guidotack added a commit that referenced this issue Mar 28, 2017

@guidotack guidotack closed this in 413462e May 17, 2017

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