Class SynchronizedSatSolverState
java.lang.Object
org.tweetyproject.arg.adf.sat.state.SynchronizedSatSolverState
- All Implemented Interfaces:
AutoCloseable,SatSolverState
A synchronized wrapper of
SatSolverState. May be too restrictive, since it does not know anything about implementation details.- Author:
- Mathias
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the given clause to the solver state.voidAssumes the truth value of the given proposition for the next call toSatSolverState.satisfiable().voidclose()booleanComputes if the current state is satisfiable.witness()Returns a witness of the satisfiability of all the clauses in the state, ornullif the state is unsatisfiable.witness(Collection<? extends Literal> filter) Returns a witness restricted to the given filter.
-
Constructor Details
-
SynchronizedSatSolverState
- Parameters:
delegate- delegate
-
-
Method Details
-
satisfiable
public boolean satisfiable()Description copied from interface:SatSolverStateComputes if the current state is satisfiable. Also takes made assumptions into account.Note that it is up to the implementation if the current satisfiability status is cached or if it is computed for every call.
- Specified by:
satisfiablein interfaceSatSolverState- Returns:
- true if the state is satisfiable, false if it is not
-
witness
Description copied from interface:SatSolverStateReturns a witness of the satisfiability of all the clauses in the state, ornullif the state is unsatisfiable.- Specified by:
witnessin interfaceSatSolverState- Returns:
- a witness if the state is sat, else returns
null
-
witness
Description copied from interface:SatSolverStateReturns a witness restricted to the given filter. Only literals contained in the filter are included in the returned set.- Specified by:
witnessin interfaceSatSolverState- Parameters:
filter- the literals to keep in the witness- Returns:
- a witness restricted to the given filter
-
assume
Description copied from interface:SatSolverStateAssumes the truth value of the given proposition for the next call toSatSolverState.satisfiable(). There can be multiple assumptions, all of them are gone after the nextSatSolverState.satisfiable()call.- Specified by:
assumein interfaceSatSolverState- Parameters:
literal- the atom for which we assume a value
-
add
Description copied from interface:SatSolverStateAdds the given clause to the solver state.- Specified by:
addin interfaceSatSolverState- Parameters:
clause- a clause containing only literals - no constants!- Returns:
- true if the clause could be added to the state, false if it failed
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSatSolverState
-