Commit ee673934 authored by Daniel Le Berre's avatar Daniel Le Berre

Fix NPE and ClassCastException in PBCautious solver.

parent 8a186b23
Pipeline #7819 passed with stages
in 214 minutes and 52 seconds
......@@ -31,6 +31,8 @@ package org.sat4j.pb.constraints.pb;
import java.math.BigInteger;
import org.sat4j.pb.core.PBSolverStats;
public final class ConflictMapSwitchToClause extends ConflictMap {
private static int upperBound;
......@@ -39,6 +41,11 @@ public final class ConflictMapSwitchToClause extends ConflictMap {
super(cpb, level);
}
public ConflictMapSwitchToClause(PBConstr cpb, int level, boolean noRemove,
boolean skip, PBSolverStats stats) {
super(cpb, level, noRemove, skip, stats);
}
/**
* reduces the constraint defined by wpb until the result of the cutting
* plane is a conflict. this reduction returns either a clause if .
......
......@@ -31,11 +31,8 @@ package org.sat4j.pb.core;
import org.sat4j.minisat.core.IOrder;
import org.sat4j.minisat.core.LearningStrategy;
import org.sat4j.pb.constraints.pb.AutoDivisionStrategy;
import org.sat4j.pb.constraints.pb.ConflictMapSwitchToClause;
import org.sat4j.pb.constraints.pb.IConflict;
import org.sat4j.pb.constraints.pb.IWeakeningStrategy;
import org.sat4j.pb.constraints.pb.NoPostProcess;
import org.sat4j.pb.constraints.pb.PBConstr;
public class PBSolverCautious extends PBSolverCP {
......@@ -57,10 +54,8 @@ public class PBSolverCautious extends PBSolverCP {
@Override
protected IConflict chooseConflict(PBConstr myconfl, int level) {
return ConflictMapSwitchToClause.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, null);
return new ConflictMapSwitchToClause(myconfl, level, isNoRemove(),
isSkipAllow(), pbStats);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment