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 static classNativeLingelingSolver.LingelingSolverState
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDEFAULT_LINUX_LIBprivate static java.lang.StringDEFAULT_WIN_LIB
-
Constructor Summary
Constructors Constructor Description NativeLingelingSolver()
-
Method Summary
Modifier and Type Method Description private static voidadd(long lgl, int lit)private voidaddClause(long lgl, int[] clause)private static voidassume(long lgl, int lit)private static booleanchanged(long lgl)SatSolverStatecreateState()private static booleanderef(long lgl, int lit)private static booleanfailed(long lgl, int lit)private static booleanfixed(long lgl, int lit)private static voidflushCache(long lgl)private static voidfreeze(long lgl, int lit)private static 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.private static booleaninconsistent(long lgl)private static longinit()booleanisSatisfiable(java.util.Collection<PlFormula> formulas)Checks whether the given set of formulas is satisfiable.private static voidmelt(long lgl, int lit)private static voidmeltAll(long lgl)private static voidreduceCache(long lgl)private static voidrelease(long lgl)private static booleanreusable(long lgl, int lit)private static voidreuse(long lgl, int lit)private static booleansat(long lgl)private static 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
-
-
-
-
Field Detail
-
DEFAULT_WIN_LIB
private static final java.lang.String DEFAULT_WIN_LIB
- See Also:
- Constant Field Values
-
DEFAULT_LINUX_LIB
private static final java.lang.String DEFAULT_LINUX_LIB
- See Also:
- Constant Field Values
-
-
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
-
addClause
private void addClause(long lgl, int[] clause)
-
init
private static long init()
-
release
private static void release(long lgl)
-
add
private static void add(long lgl, int lit)
-
assume
private static void assume(long lgl, int lit)
-
sat
private static boolean sat(long lgl)
-
deref
private static boolean deref(long lgl, int lit)
-
fixed
private static boolean fixed(long lgl, int lit)
-
failed
private static boolean failed(long lgl, int lit)
-
inconsistent
private static boolean inconsistent(long lgl)
-
changed
private static boolean changed(long lgl)
-
reduceCache
private static void reduceCache(long lgl)
-
flushCache
private static void flushCache(long lgl)
-
freeze
private static void freeze(long lgl, int lit)
-
frozen
private static boolean frozen(long lgl, int lit)
-
melt
private static void melt(long lgl, int lit)
-
meltAll
private static void meltAll(long lgl)
-
usable
private static boolean usable(long lgl, int lit)
-
reusable
private static boolean reusable(long lgl, int lit)
-
reuse
private static void reuse(long lgl, int lit)
-
-