add arithm preprocessing to detect trivial cases#1188
Conversation
|
I agree on the proposed preprocessing. But why are some tests failing due to these changes ? |
Ah, those optimization are no longer possible within a dynamic context... |
|
Wouldn't be better to move this simplification to |
It is already in |
| return new Arithmetic(var, Operator.get(op), cste); | ||
| default Constraint arithm(IntVar x, String op, int cste) { | ||
| // this preprocessing is no longer permitted within a dynamical context | ||
| if (ref().getSolver().getNodeCount() == 0) { |
There was a problem hiding this comment.
I used to use solver.getSearchState() == SearchState.NEW for instance in cstr.impliedBy(bvar).
I would suggest either to call this method or to create a new method with an accurate name that indicates that such preprocessing can be done safely.
There was a problem hiding this comment.
Well, there exists a method like that: solver.isSolving()
No description provided.