#10 Bug in IfThenElse constraint consistency function

closed-accepted
nobody
None
5
2011-11-23
2011-11-22
Anonymous
No

There is a consistency problem with the IfThenElse constraint.
e.g.: IF a THEN b ELSE c.
The current implementation take care of the following :
a is True -> b is true
b is false -> a is false
a is false -> c is true
c is false -> a is true

But it miss the following :
b is false -> a is false and c is true
c is false -> a is true and b is true

Here the fix :
public void consistency(Store store) {
if (condC.satisfied())
thenC.consistency(store);
else if (condC.notSatisfied())
elseC.consistency(store);

if (imposed) {

if (thenC.notSatisfied()) {
condC.notConsistency(store);
elseC.consistency(store);
}

if (elseC.notSatisfied()) {
condC.consistency(store);
thenC.consistency(store);
}
}
}

Discussion

  • kris

    kris - 2011-11-23
    • status: open --> closed-accepted
     
  • kris

    kris - 2011-11-23

    Thanks for the proposal. It really improves propagation for IfThenElse constraint. We have changed the version of the constraint in svn and this change will be included in the next release.