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

mzn2fzn v2.0 drops output variables #5

Closed
alexmahrer-adventiumlabs opened this issue Feb 6, 2015 · 2 comments
Closed

mzn2fzn v2.0 drops output variables #5

alexmahrer-adventiumlabs opened this issue Feb 6, 2015 · 2 comments

Comments

@alexmahrer-adventiumlabs

Output variables aren't included in the FlatZinc generated by mzn2fzn (v2.0) if they can be reduced to an equivalent variable.

Example MiniZinc:

var 0..1: x;
var int: y = x;
solve maximize x;
output [show(x), show(y)];

Resulting FlatZinc using mzn2fzn v1.6:

var 0..1: x :: output_var;
var 0..1: y :: output_var = x;
solve maximize x;

Resulting FlatZinc using mzn2fzn v2.0:

var 0..1: x:: output_var;
solve  maximize x;

This becomes more of an issue when y reduces to x through a more complex expression, or when the MiniZinc model is itself the result of a generation tool. I.e., when the relationship between equivalent variables is unclear, and one of them is not included in the FlatZinc, deciphering the output of the FlatZinc solver can become difficult.

@guidotack
Copy link
Member

This is expected behaviour. You can run the FlatZinc output through the solns2out program to generate readable output. We will change this behaviour slightly in an upcoming update so that variables defined by functions are retained in the FlatZinc, but aliased variables (i.e. two variables that are equal) will be removed, because they can actually lead to performance problems in the solver.

@alexmahrer-adventiumlabs
Copy link
Author

Ah, I see. Thanks.

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

No branches or pull requests

2 participants