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

Output console does not print trace text #114

Closed
GustavBjordal opened this issue Oct 9, 2020 · 1 comment
Closed

Output console does not print trace text #114

GustavBjordal opened this issue Oct 9, 2020 · 1 comment

Comments

@GustavBjordal
Copy link
Contributor

When running the MiniZinc IDE, trace is not printed for me unless the model is unsat.

var 1..10: x;
constraint trace("foo", true);
% constraint trace("bar", false); %% Tracing works when the model is unsatisfiable.

gives

Running foo.mzn
x = 1;
----------
Finished in 65msec

but uncommenting the second constraint gives

Running foo.mzn
foobar
  WARNING: model inconsistency detected
=====UNSATISFIABLE=====
Finished in 46msec

When I run the model (without the second constraint) via the command-line I get:

>./minizinc foo.mzn 
foox = 1;
----------
@cyderize
Copy link
Member

I think this should be fixed in the develop branch now - I've tried to more accurately emulate console behaviour.

In general, it's probably safer to always end a trace string with \n if possible, since that's essentially what triggers printing to the console. I've now changed it so that a new line in stdout will trigger the printing of anything left in stderr, which is more similar to what happens on the command line.

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