Commit 21903bf3 authored by Daniel Le Berre's avatar Daniel Le Berre

Added @since tags thanks to Eclipse API tooling.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@456 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent a037c89c
......@@ -30,10 +30,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sourceforge.metrics.nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.sat4j.core" version="2">
<resource path="src/test/java/org/sat4j/ModelIteratorTest.java" type="org.sat4j.ModelIteratorTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.ModelIteratorTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/SingleSolutionTest.java" type="org.sat4j.SingleSolutionTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.SingleSolutionTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/TestConstrGroup.java" type="org.sat4j.TestConstrGroup">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.TestConstrGroup"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/TestFreeId.java" type="org.sat4j.TestFreeId">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.TestFreeId"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/TestQuickExplain.java" type="org.sat4j.TestQuickExplain">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.TestQuickExplain"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/core/VecTest.java" type="org.sat4j.core.VecTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.core.VecTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/AbstractAcceptanceTestCase.java" type="org.sat4j.minisat.AbstractAcceptanceTestCase">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.AbstractAcceptanceTestCase"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/AbstractM2Test.java" type="org.sat4j.minisat.AbstractM2Test">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.AbstractM2Test"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/AllTests.java" type="org.sat4j.minisat.AllTests">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.AllTests"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/GenericM2Test.java" type="org.sat4j.minisat.GenericM2Test">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.GenericM2Test"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2AtLeastTest.java" type="org.sat4j.minisat.M2AtLeastTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2AtLeastTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2BackjumpingTest.java" type="org.sat4j.minisat.M2BackjumpingTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2BackjumpingTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2CardMaxYannTest.java" type="org.sat4j.minisat.M2CardMaxYannTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2CardMaxYannTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2CardMinYannTest.java" type="org.sat4j.minisat.M2CardMinYannTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2CardMinYannTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2MiniLearningCBTest.java" type="org.sat4j.minisat.M2MiniLearningCBTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2MiniLearningCBTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2MiniLearningTest.java" type="org.sat4j.minisat.M2MiniLearningTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2MiniLearningTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2MiniSATTest.java" type="org.sat4j.minisat.M2MiniSATTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2MiniSATTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/M2RelsatTest.java" type="org.sat4j.minisat.M2RelsatTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.M2RelsatTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/TestAssertion.java" type="org.sat4j.minisat.TestAssertion">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.TestAssertion"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/TestLubyFunction.java" type="org.sat4j.minisat.TestLubyFunction">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.TestLubyFunction"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/TestsFonctionnels.java" type="org.sat4j.minisat.TestsFonctionnels">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.TestsFonctionnels"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/VarOrderTest.java" type="org.sat4j.minisat.VarOrderTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.VarOrderTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/constraints/LitTest.java" type="org.sat4j.minisat.constraints.LitTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.constraints.LitTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/Bug275101.java" type="org.sat4j.minisat.core.Bug275101">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.Bug275101"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/BugThomas.java" type="org.sat4j.minisat.core.BugThomas">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.BugThomas"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/HeapTest.java" type="org.sat4j.minisat.core.HeapTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.HeapTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/LboolTest.java" type="org.sat4j.minisat.core.LboolTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.LboolTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/QueueTest.java" type="org.sat4j.minisat.core.QueueTest">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.QueueTest"/>
</message_arguments>
</filter>
</resource>
<resource path="src/test/java/org/sat4j/minisat/core/TestAtMost.java" type="org.sat4j.minisat.core.TestAtMost">
<filter id="1110441988">
<message_arguments>
<message_argument value="org.sat4j.minisat.core.TestAtMost"/>
</message_arguments>
</filter>
</resource>
</component>
#Sat May 16 13:11:50 CEST 2009
ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
ILLEGAL_EXTEND=Warning
ILLEGAL_IMPLEMENT=Warning
ILLEGAL_INSTANTIATE=Warning
ILLEGAL_OVERRIDE=Warning
ILLEGAL_REFERENCE=Warning
INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
INVALID_JAVADOC_TAG=Ignore
INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Error
LEAK_EXTEND=Warning
LEAK_FIELD_DECL=Warning
LEAK_IMPLEMENT=Warning
LEAK_METHOD_PARAM=Warning
LEAK_METHOD_RETURN_TYPE=Warning
METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
UNUSED_PROBLEM_FILTERS=Warning
eclipse.preferences.version=1
incompatible_api_component_version=Error
incompatible_api_component_version_include_major_without_breaking_change=Disabled
incompatible_api_component_version_include_minor_without_api_change=Disabled
invalid_since_tag_version=Warning
malformed_since_tag=Error
missing_since_tag=Error
report_api_breakage_when_major_version_incremented=Disabled
report_resolution_errors_api_component=Warning
......@@ -137,14 +137,24 @@ public class SolverFactory extends ASolverFactory<ISolver> {
return solver;
}
/**
* @since 2.1
*/
public static Solver<DataStructureFactory> newBestWL() {
return newBestCurrentSolverConfiguration(new MixedDataStructureDanielWL());
}
/**
*
* @since 2.1
*/
public static Solver<DataStructureFactory> newBestHT() {
return newBestCurrentSolverConfiguration(new MixedDataStructureDanielHT());
}
/**
* @since 2.1
*/
public static Solver<DataStructureFactory> newGlucose() {
Solver<DataStructureFactory> solver = newBestWL();
solver.setLearnedConstraintsDeletionStrategy(solver.GLUCOSE);
......
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*
* Based on the original MiniSat specification from:
*
* An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
* Sixth International Conference on Theory and Applications of Satisfiability
* Testing, LNCS 2919, pp 502-518, 2003.
*
* See www.minisat.se for the original solver in C++.
*
*******************************************************************************/
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*
* Based on the original MiniSat specification from:
*
* An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
* Sixth International Conference on Theory and Applications of Satisfiability
* Testing, LNCS 2919, pp 502-518, 2003.
*
* See www.minisat.se for the original solver in C++.
*
*******************************************************************************/
package org.sat4j.minisat.constraints;
import org.sat4j.minisat.constraints.card.AtLeast;
......@@ -42,52 +42,57 @@ import org.sat4j.specs.IVecInt;
/**
* Uses specific data structure for cardinality constraints.
*
*
* @author leberre
* @since 2.1
*/
public class MixedDataStructureDanielHT extends AbstractDataStructureFactory {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.DataStructureFactory#createCardinalityConstraint(org.sat4j.datatype.VecInt,
* int)
*/
@Override
public Constr createCardinalityConstraint(IVecInt literals, int degree)
throws ContradictionException {
return AtLeast.atLeastNew(solver, getVocabulary(), literals, degree);
}
/*
* (non-Javadoc)
*
* @see
* org.sat4j.minisat.DataStructureFactory#createCardinalityConstraint(org
* .sat4j.datatype.VecInt, int)
*/
@Override
public Constr createCardinalityConstraint(IVecInt literals, int degree)
throws ContradictionException {
return AtLeast.atLeastNew(solver, getVocabulary(), literals, degree);
}
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.DataStructureFactory#createClause(org.sat4j.datatype.VecInt)
*/
public Constr createClause(IVecInt literals) throws ContradictionException {
IVecInt v = Clauses.sanityCheck(literals, getVocabulary(), solver);
if (v == null)
return null;
if (v.size()==2) {
return OriginalBinaryClause.brandNewClause(solver, getVocabulary(), v);
}
return OriginalHTClause.brandNewClause(solver, getVocabulary(), v);
}
/*
* (non-Javadoc)
*
* @see
* org.sat4j.minisat.DataStructureFactory#createClause(org.sat4j.datatype
* .VecInt)
*/
public Constr createClause(IVecInt literals) throws ContradictionException {
IVecInt v = Clauses.sanityCheck(literals, getVocabulary(), solver);
if (v == null)
return null;
if (v.size() == 2) {
return OriginalBinaryClause.brandNewClause(solver, getVocabulary(),
v);
}
return OriginalHTClause.brandNewClause(solver, getVocabulary(), v);
}
public Constr createUnregisteredClause(IVecInt literals) {
if (literals.size()==1) {
return new UnitClause(literals.last());
}
if (literals.size()==2) {
return new LearntBinaryClause(literals,getVocabulary());
}
return new LearntHTClause(literals, getVocabulary());
}
public Constr createUnregisteredClause(IVecInt literals) {
if (literals.size() == 1) {
return new UnitClause(literals.last());
}
if (literals.size() == 2) {
return new LearntBinaryClause(literals, getVocabulary());
}
return new LearntHTClause(literals, getVocabulary());
}
@Override
protected ILits createLits() {
return new Lits();
}
@Override
protected ILits createLits() {
return new Lits();
}
}
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*
* Based on the original MiniSat specification from:
*
* An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
* Sixth International Conference on Theory and Applications of Satisfiability
* Testing, LNCS 2919, pp 502-518, 2003.
*
* See www.minisat.se for the original solver in C++.
*
*******************************************************************************/
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*
* Based on the original MiniSat specification from:
*
* An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
* Sixth International Conference on Theory and Applications of Satisfiability
* Testing, LNCS 2919, pp 502-518, 2003.
*
* See www.minisat.se for the original solver in C++.
*
*******************************************************************************/
package org.sat4j.minisat.constraints;
import org.sat4j.minisat.constraints.card.AtLeast;
......@@ -41,52 +41,56 @@ import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.IVecInt;
/**
* @author leberre To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
* @author leberre
* @since 2.1
*/
public class MixedDataStructureDanielWL extends AbstractDataStructureFactory {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.DataStructureFactory#createCardinalityConstraint(org.sat4j.datatype.VecInt,
* int)
*/
@Override
public Constr createCardinalityConstraint(IVecInt literals, int degree)
throws ContradictionException {
return AtLeast.atLeastNew(solver, getVocabulary(), literals, degree);
}
/*
* (non-Javadoc)
*
* @see
* org.sat4j.minisat.DataStructureFactory#createCardinalityConstraint(org
* .sat4j.datatype.VecInt, int)
*/
@Override
public Constr createCardinalityConstraint(IVecInt literals, int degree)
throws ContradictionException {
return AtLeast.atLeastNew(solver, getVocabulary(), literals, degree);
}
/*
* (non-Javadoc)
*
* @see org.sat4j.minisat.DataStructureFactory#createClause(org.sat4j.datatype.VecInt)
*/
public Constr createClause(IVecInt literals) throws ContradictionException {
IVecInt v = Clauses.sanityCheck(literals, getVocabulary(), solver);
if (v == null)
return null;
if (v.size()==2) {
return OriginalBinaryClause.brandNewClause(solver, getVocabulary(), v);
}
return OriginalWLClause.brandNewClause(solver, getVocabulary(), v);
}
/*
* (non-Javadoc)
*
* @see
* org.sat4j.minisat.DataStructureFactory#createClause(org.sat4j.datatype
* .VecInt)
*/
public Constr createClause(IVecInt literals) throws ContradictionException {
IVecInt v = Clauses.sanityCheck(literals, getVocabulary(), solver);
if (v == null)
return null;
if (v.size() == 2) {
return OriginalBinaryClause.brandNewClause(solver, getVocabulary(),
v);
}
return OriginalWLClause.brandNewClause(solver, getVocabulary(), v);
}
public Constr createUnregisteredClause(IVecInt literals) {
if (literals.size()==1) {
return new UnitClause(literals.last());
}
if (literals.size()==2) {
return new LearntBinaryClause(literals,getVocabulary());
}
return new LearntWLClause(literals, getVocabulary());
}
public Constr createUnregisteredClause(IVecInt literals) {
if (literals.size() == 1) {
return new UnitClause(literals.last());
}
if (literals.size() == 2) {
return new LearntBinaryClause(literals, getVocabulary());
}
return new LearntWLClause(literals, getVocabulary());
}
@Override
protected ILits createLits() {
return new Lits();
}
@Override
protected ILits createLits() {
return new Lits();
}
}
......@@ -119,6 +119,9 @@ public class AtLeast implements Constr, Undoable, Serializable {
}
/**
* @since 2.1
*/
public static Constr atLeastNew(UnitPropagationListener s, ILits voc,
IVecInt ps, int n) throws ContradictionException {
int degree = niceParameters(s, voc, ps, n);
......@@ -127,10 +130,8 @@ public class AtLeast implements Constr, Undoable, Serializable {
return new AtLeast(voc, ps, degree);
}
/*
* (non-Javadoc)
*
* @see Constr#remove(Solver)
/**
* @since 2.1
*/
public void remove(UnitPropagationListener upl) {
for (int q : lits) {
......@@ -287,6 +288,9 @@ public class AtLeast implements Constr, Undoable, Serializable {
return stb.toString();
}
/**
* @since 2.1
*/
public void forwardActivity(double claInc) {
// TODO Auto-generated method stub
......
......@@ -304,7 +304,7 @@ public class MaxWatchCard implements Constr, Undoable, Serializable {