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

Using output sections outputs both all decision variables, as well as sections #733

Closed
CervEdin opened this issue Sep 21, 2023 · 1 comment
Assignees
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@CervEdin
Copy link

CervEdin commented Sep 21, 2023

Following up on the issue I posted about using output-sections in issue #712

My understand from reading --help

  --only-sections <section_1,...section_n>
    Enable only the given comma-separated output sections.
  --not-sections <section_1,...section_n>
    Disable the given comma-separated output sections.

and the section on annotations

one should be able to annotate output like this

model.mzn

var int: x;

output :: "hello"  ["Hello\n"] ;
output :: "world" ["World\n"];

and then compile and run the model like this

echo "Both hello/world" >&2 &&
  minizinc --solver chuffed model.mzn
echo "Only hello" >&2 &&
  minizinc --solver chuffed --only-sections hello model.mzn
echo "Not hello" >&2 &&
  minizinc --solver chuffed --not-sections hello model.mzn

this results in the expected output, as well as printing all the decision variables

x = -500000000;
Hello
World
----------
x = -500000000;
Hello
----------
x = -500000000;
World
----------

It seems that as soon as one annotates an output statement, MiniZinc it has the same effectively as setting --output-mode dzn as well as using the output statements.

This was encountered running
MiniZinc to FlatZinc converter, version 2.6.4, build 570825159
Copyright (C) 2014-2022 Monash University, NICTA, Data61

@cyderize cyderize added the bug label Sep 21, 2023
@cyderize cyderize self-assigned this Sep 21, 2023
@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Oct 13, 2023
@CervEdin
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

2 participants