Commit 8b7802d7 authored by Daniel Le Berre's avatar Daniel Le Berre

Moved SearchListenerAdapter to spec package to remove duplicated code in

VoidTracing.
parent 29a1634a
Pipeline #86 passed with stage
in 11 minutes and 21 seconds
This diff is collapsed.
......@@ -29,11 +29,8 @@
*******************************************************************************/
package org.sat4j.minisat.core;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListener;
import org.sat4j.specs.SearchListenerAdapter;
/**
* Do-nothing search listener. Used by default by the solver when no
......@@ -42,60 +39,7 @@ import org.sat4j.specs.SearchListener;
* @author leberre
*
*/
final class VoidTracing implements SearchListener<ISolverService> {
final class VoidTracing extends SearchListenerAdapter<ISolverService> {
private static final long serialVersionUID = 1L;
public void assuming(int p) {
}
public void propagating(int p) {
}
public void enqueueing(int p, IConstr reason) {
}
public void backtracking(int p) {
}
public void adding(int p) {
}
public void learn(IConstr clause) {
}
public void learnUnit(int p) {
}
public void delete(IConstr c) {
}
public void conflictFound(IConstr confl, int dlevel, int trailLevel) {
}
public void conflictFound(int p) {
}
public void solutionFound(int[] model, RandomAccessModel lazyModel) {
}
public void beginLoop() {
}
public void start() {
}
public void end(Lbool result) {
}
public void restarting() {
}
public void backjump(int backjumpLevel) {
}
public void init(ISolverService solverService) {
}
public void cleaning() {
}
}
......@@ -27,13 +27,7 @@
* Contributors:
* CRIL - initial API and implementation
*******************************************************************************/
package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListener;
package org.sat4j.specs;
public abstract class SearchListenerAdapter<S extends ISolverService>
implements SearchListener<S> {
......
......@@ -32,6 +32,7 @@ package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.2
......
......@@ -32,6 +32,7 @@ package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.2
......
......@@ -32,6 +32,7 @@ package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.2
......
......@@ -31,6 +31,7 @@ package org.sat4j.tools;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.2
......
......@@ -41,6 +41,7 @@ import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.VarMapper;
/**
......
......@@ -31,6 +31,7 @@ package org.sat4j.tools;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListenerAdapter;
public class HeuristicsTracing extends SearchListenerAdapter<ISolverService> {
......
......@@ -33,6 +33,7 @@ import org.sat4j.specs.Constr;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
public class LBDTracing extends SearchListenerAdapter<ISolverService> {
......
......@@ -32,6 +32,7 @@ package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.2
......
......@@ -32,6 +32,7 @@ package org.sat4j.tools;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* @since 2.3.2
......
......@@ -33,6 +33,7 @@ import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.IVec;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListenerAdapter;
public class LearnedTracing extends SearchListenerAdapter<ISolverService> {
......
......@@ -50,6 +50,7 @@ import org.sat4j.specs.ISolverService;
import org.sat4j.specs.IVec;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.SearchListener;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.TimeoutException;
import org.sat4j.specs.UnitClauseProvider;
import org.sat4j.specs.UnitPropagationListener;
......
......@@ -38,6 +38,7 @@ import org.sat4j.core.LiteralsUtils;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
/**
* Output an unsat proof using the reverse unit propagation (RUP) format.
......
......@@ -33,6 +33,7 @@ import org.sat4j.specs.ISolverService;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListenerAdapter;
/**
* That class allows to iterate over the models from the inside: conflicts are
......
......@@ -31,6 +31,7 @@ package org.sat4j.tools;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.Lbool;
/**
......
......@@ -31,6 +31,7 @@ package org.sat4j.tools;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.SearchListenerAdapter;
public class SpeedTracing extends SearchListenerAdapter<ISolverService> {
......
......@@ -11,8 +11,8 @@ import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.ISolverService;
import org.sat4j.specs.IVec;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.TimeoutException;
import org.sat4j.tools.SearchListenerAdapter;
public class LevelBasedVarOrderTest {
......
......@@ -24,8 +24,8 @@ import org.sat4j.specs.ISolverService;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.IteratorInt;
import org.sat4j.specs.SearchListener;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.TimeoutException;
import org.sat4j.tools.SearchListenerAdapter;
public class CardConstrFinder implements Iterator<AtLeastCard>,
Iterable<AtLeastCard> {
......
......@@ -36,7 +36,7 @@ import java.io.PrintStream;
import org.sat4j.pb.constraints.pb.PBConstr;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.ISolverService;
import org.sat4j.tools.SearchListenerAdapter;
import org.sat4j.specs.SearchListenerAdapter;
public class ConflictTracing extends SearchListenerAdapter<ISolverService> {
......
......@@ -21,8 +21,8 @@ import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.IVec;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.specs.TimeoutException;
import org.sat4j.tools.SearchListenerAdapter;
public class InprocCardConstrLearningSolver extends PBSolverCP {
......
......@@ -37,7 +37,7 @@ import org.sat4j.pb.ObjectiveFunction;
import org.sat4j.specs.IConstr;
import org.sat4j.specs.Lbool;
import org.sat4j.specs.RandomAccessModel;
import org.sat4j.tools.SearchListenerAdapter;
import org.sat4j.specs.SearchListenerAdapter;
import org.sat4j.tools.SolutionFoundListener;
public final class SearchOptimizerListener extends
......
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