chocoteam / chocoteam/choco-solver

[BUG] Incomplete bounding of expressions with products or powers

Open
#980 1 comment 0 reactions 1 assignee Claimed by @cprudhom View on GitHub
bug
Dominant language
Java
Stars
779
Forks
159
Avg merge
6d 9h
Merged PRs (30d)
10

Description

**Describe the bug**

The computation of bounds of the auxiliary variable is not accurate for `mul` or `pow` expressions.
It raises an exception because it does not take into account the right member of the relation.

However, the constraint `times` does not meet the same issue.

**To Reproduce**

Define the model below.
```java
Model m = new Model();
IntVar[] x = m.intVarArray("x", 3, 0, IntVar.MAX_INT_BOUND);
model.times(x[0], x[1], x[2]).post(); // Valid and posted
x[0].mul(x[1]).eq(x[2]).post(); // Valid, but raise an exception
```

The issue is also encountered with `pow` expression.
```java
x[0].pow(x[1]).eq(x[2]).post(); // Valid, but raise an exception
```

**Expected behavior**
No exception.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.