Package org.tweetyproject.sat.lingeling
Class LingelingSatSolver
java.lang.Object
org.tweetyproject.sat.lingeling.LingelingSatSolver
- All Implemented Interfaces:
AutoCloseable,SatSolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int[] clause) Adds the given clause to the SAT solver state.voidclose()intnewVar()Creates and returns the integer representation of a fresh propositional variable.booleansatisfiable(int[] assumptions) boolean[]witness(int[] literals, int[] assumptions) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tweetyproject.sat.SatSolver
satisfiable, witness
-
Constructor Details
-
LingelingSatSolver
public LingelingSatSolver()
-
-
Method Details
-
satisfiable
public boolean satisfiable(int[] assumptions) - Specified by:
satisfiablein interfaceSatSolver
-
witness
public boolean[] witness(int[] literals, int[] assumptions) -
add
public void add(int[] clause) Description copied from interface:SatSolverAdds the given clause to the SAT solver state.Note that contrary to DIMACS format, a trailing '0' is not required!
-
newVar
public int newVar()Description copied from interface:SatSolverCreates and returns the integer representation of a fresh propositional variable.It is necessary to only use variables returned by this method, since some solvers require to first allocate and maintain a data structure of the variables before they can be used in clauses. Hence, using integers not returned by this method may work for some solvers, but not for others.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSatSolver
-