Skip to content

Commit af83b96

Browse files
committed
[CP-SAT] fix #4640
1 parent 1de64ad commit af83b96

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ortools/sat/cp_model_presolve.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3088,8 +3088,10 @@ bool CpModelPresolver::PresolveSmallLinear(ConstraintProto* ct) {
30883088
bool CpModelPresolver::PresolveDiophantine(ConstraintProto* ct) {
30893089
if (ct->constraint_case() != ConstraintProto::kLinear) return false;
30903090
if (ct->linear().vars().size() <= 1) return false;
3091-
30923091
if (context_->ModelIsUnsat()) return false;
3092+
// The transformation can add extra variables, and creates duplicate solutions
3093+
// when enumerate_all_solutions is true.
3094+
if (context_->params().enumerate_all_solutions()) return false;
30933095

30943096
const LinearConstraintProto& linear_constraint = ct->linear();
30953097
if (linear_constraint.domain_size() != 2) return false;

0 commit comments

Comments
 (0)