Package net.sf.tweety.arg.adf.sat
Class NativeLingelingSolver
- java.lang.Object
-
- net.sf.tweety.logics.pl.sat.SatSolver
-
- net.sf.tweety.arg.adf.sat.IncrementalSatSolver
-
- net.sf.tweety.arg.adf.sat.NativeLingelingSolver
-
- All Implemented Interfaces:
BeliefSetConsistencyTester<PlFormula>,ConsistencyTester<BeliefSet<PlFormula,?>>,ConsistencyWitnessProvider<PlBeliefSet,PlFormula>
public class NativeLingelingSolver extends IncrementalSatSolver
Experimental lingeling binding- Author:
- Mathias Hofer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classNativeLingelingSolver.LingelingSolverState
-
Field Summary
Fields Modifier and Type Field Description private static java.io.FileDEFAULT_WIN_LIB
-
Constructor Summary
Constructors Constructor Description NativeLingelingSolver()
-
Method Summary
Modifier and Type Method Description private voidadd(long lgl, int lit)private voidaddClause(long lgl, int[] clause)private voidassume(long lgl, int lit)private booleanchanged(long lgl)SatSolverStatecreateState()private booleanderef(long lgl, int lit)private booleanfailed(long lgl, int lit)private booleanfixed(long lgl, int lit)private voidflushCache(long lgl)private voidfreeze(long lgl, int lit)private booleanfrozen(long lgl, int lit)Interpretation<PlBeliefSet,PlFormula>getWitness(java.util.Collection<PlFormula> formulas)If the collection of formulas is consistent this method returns some model of it or, if it is inconsistent, null.Interpretation<PlBeliefSet,PlFormula>getWitness(SatSolverState state)private booleaninconsistent(long lgl)private longinit()booleanisSatisfiable(java.util.Collection<PlFormula> formulas)Checks whether the given set of formulas is satisfiable.booleanisSatisfiable(SatSolverState state)private voidmelt(long lgl, int lit)private voidmeltAll(long lgl)private voidreduceCache(long lgl)private voidrelease(long lgl)private booleanreusable(long lgl, int lit)private voidreuse(long lgl, int lit)private booleansat(long lgl)private booleanusable(long lgl, int lit)-
Methods inherited from class net.sf.tweety.logics.pl.sat.SatSolver
convertToDimacs, convertToDimacs, createTmpDimacsFile, createTmpDimacsFile, getDefaultSolver, getWitness, getWitness, hasDefaultSolver, isConsistent, isConsistent, isConsistent, setDefaultSolver, setTempFolder
-
-
-
-
Method Detail
-
getWitness
public Interpretation<PlBeliefSet,PlFormula> getWitness(java.util.Collection<PlFormula> formulas)
Description copied from class:SatSolverIf the collection of formulas is consistent this method returns some model of it or, if it is inconsistent, null.- Specified by:
getWitnessin interfaceConsistencyWitnessProvider<PlBeliefSet,PlFormula>- Specified by:
getWitnessin classSatSolver- Parameters:
formulas- a set of formulas- Returns:
- some model of the formulas or null.
-
isSatisfiable
public boolean isSatisfiable(java.util.Collection<PlFormula> formulas)
Description copied from class:SatSolverChecks whether the given set of formulas is satisfiable.- Specified by:
isSatisfiablein classSatSolver- Parameters:
formulas- a set of formulas.- Returns:
- "true" if the set is consistent.
-
createState
public SatSolverState createState()
- Specified by:
createStatein classIncrementalSatSolver
-
isSatisfiable
public boolean isSatisfiable(SatSolverState state)
- Specified by:
isSatisfiablein classIncrementalSatSolver
-
getWitness
public Interpretation<PlBeliefSet,PlFormula> getWitness(SatSolverState state)
- Specified by:
getWitnessin classIncrementalSatSolver
-
addClause
private void addClause(long lgl, int[] clause)
-
init
private long init()
-
release
private void release(long lgl)
-
add
private void add(long lgl, int lit)
-
assume
private void assume(long lgl, int lit)
-
sat
private boolean sat(long lgl)
-
deref
private boolean deref(long lgl, int lit)
-
fixed
private boolean fixed(long lgl, int lit)
-
failed
private boolean failed(long lgl, int lit)
-
inconsistent
private boolean inconsistent(long lgl)
-
changed
private boolean changed(long lgl)
-
reduceCache
private void reduceCache(long lgl)
-
flushCache
private void flushCache(long lgl)
-
freeze
private void freeze(long lgl, int lit)
-
frozen
private boolean frozen(long lgl, int lit)
-
melt
private void melt(long lgl, int lit)
-
meltAll
private void meltAll(long lgl)
-
usable
private boolean usable(long lgl, int lit)
-
reusable
private boolean reusable(long lgl, int lit)
-
reuse
private void reuse(long lgl, int lit)
-
-