Originally posted by: SystemAdmin
[Didier Vidal said:]
Being it that way, I thought that both models should be completely solved by only instantiating the first variable.
Tony,
I tested your models with ILOG CP Optimizer, in OPL, and -unless I misunderstood something- I think that what you expected happens.
The first model is
using CP;
dvar int vars[0..3] in 0..10;
constraints {
vars[3] == 5 => (vars[1] == 0 && vars[2] == 1);
vars[3] == 5;
vars[0] < 3;<br />}
When you run it, you see that three variables are fixed at initial propagation, and only one decision closes the model
! ----------------------------------------------------------------------------
! Satisfiability problem - 4 variables, 7 constraints
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 13.8 (before), 1.6 (after)
! . Memory usage : 315.4 Kb (before), 315.4 Kb (after)
! . Variables fixed : 3
! ----------------------------------------------------------------------------
! Branches Non-fixed Branch decision
* 1 0.00s vars(0) = 0
! ----------------------------------------------------------------------------
! Solution status : Terminated normally, solution found
! Number of branches : 1
! Number of fails : 0
! Total memory usage : 473.2 Kb (331.4 Kb CP Optimizer + 141.7 Kb Concert)
! Time spent in solve : 0.00s (0.00s engine + 0.00s extraction)
! Search speed (br. / s) : 100.0
! ----------------------------------------------------------------------------
The second model is
using CP;
dvar int vars[0..3] in 0..10;
constraints {
vars[1]<vars[2] => (vars[1]==0 && vars[2]==1);
vars[0] < 3;<br /> vars[1]<vars[2]; <br />}
And has the same behavior (except that vars[3] is unused which changes the search space size)
! ----------------------------------------------------------------------------
! Satisfiability problem - 3 variables, 7 constraints
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 10.4 (before), 1.6 (after)
! . Memory usage : 315.4 Kb (before), 315.4 Kb (after)
! . Variables fixed : 2
! ----------------------------------------------------------------------------
! Branches Non-fixed Branch decision
* 1 0.00s vars(0) = 0
! ----------------------------------------------------------------------------
! Solution status : Terminated normally, solution found
! Number of branches : 1
! Number of fails : 0
! Total memory usage : 474.2 Kb (331.4 Kb CP Optimizer + 142.7 Kb Concert)
! Time spent in solve : 0.00s (0.00s engine + 0.00s extraction)
! Search speed (br. / s) : 100.0
! ----------------------------------------------------------------------------
#CPOptimizer#DecisionOptimization