Skip to content

Conversation

@ThomSerg
Copy link
Collaborator

@ThomSerg ThomSerg commented Nov 3, 2025

As encountered during the last two XCSP3 competitions, Z3 internally negates the objective function when maximising (turning the problem into minimisation). But when calling sol.evaluate(obj).as_long() to get the objective value after a solve call, this abstraction gets broken and Z3 returns the negated value. This in turn resulted in incorrect values for solver.objective_value(). Added code to undo the negation.

@ThomSerg ThomSerg added simple to review Simple change to review, e.g., a oneliner. inconsistency labels Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inconsistency simple to review Simple change to review, e.g., a oneliner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants