Package net.sf.tweety.arg.adf.sat
Class NativeLingelingSolver.LingelingSolverState
- java.lang.Object
-
- net.sf.tweety.arg.adf.sat.NativeLingelingSolver.LingelingSolverState
-
- All Implemented Interfaces:
java.lang.AutoCloseable,SatSolverState
- Enclosing class:
- NativeLingelingSolver
private static class NativeLingelingSolver.LingelingSolverState extends java.lang.Object implements SatSolverState
-
-
Field Summary
Fields Modifier and Type Field Description private longhandleprivate intnextPropositionKeeps track of the int representation of fresh propositionsprivate java.util.Map<Proposition,java.lang.Integer>propositionsToNativeMaps the propositions to their native representation.private java.util.Set<Disjunction>stateCacheContains the disjunctions which were added after the last sat call and must be added before the next sat call.
-
Constructor Summary
Constructors Modifier Constructor Description privateLingelingSolverState(long handle)
-
Method Summary
Modifier and Type Method Description booleanadd(java.util.Collection<Disjunction> clauses)booleanadd(Disjunction clause)Updates the state of the corresponding SAT-Solver by adding a clause.voidassume(Proposition proposition, boolean value)voidclose()private booleanisTrue(Proposition p)booleanremove(Disjunction clause)Tries to remove the given clause from the sat instance.booleansatisfiable()Interpretation<PlBeliefSet,PlFormula>witness()
-
-
-
Field Detail
-
propositionsToNative
private java.util.Map<Proposition,java.lang.Integer> propositionsToNative
Maps the propositions to their native representation.
-
stateCache
private java.util.Set<Disjunction> stateCache
Contains the disjunctions which were added after the last sat call and must be added before the next sat call.
-
nextProposition
private int nextProposition
Keeps track of the int representation of fresh propositions
-
handle
private long handle
-
-
Method Detail
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
isTrue
private boolean isTrue(Proposition p)
-
add
public boolean add(java.util.Collection<Disjunction> clauses)
- Specified by:
addin interfaceSatSolverState
-
add
public boolean add(Disjunction clause)
Description copied from interface:SatSolverStateUpdates the state of the corresponding SAT-Solver by adding a clause.- Specified by:
addin interfaceSatSolverState- Parameters:
clause- a clause containing only literals - no constants!- Returns:
- true iff the
-
remove
public boolean remove(Disjunction clause)
Description copied from interface:SatSolverStateTries to remove the given clause from the sat instance.- Specified by:
removein interfaceSatSolverState- Returns:
- true iff the removal was successful
-
witness
public Interpretation<PlBeliefSet,PlFormula> witness()
- Specified by:
witnessin interfaceSatSolverState
-
satisfiable
public boolean satisfiable()
- Specified by:
satisfiablein interfaceSatSolverState
-
assume
public void assume(Proposition proposition, boolean value)
- Specified by:
assumein interfaceSatSolverState
-
-