Class AsynchronousCloseSatSolverState
java.lang.Object
org.tweetyproject.arg.adf.sat.state.AsynchronousCloseSatSolverState
- All Implemented Interfaces:
AutoCloseable
,SatSolverState
The
close()
call is handled by the provided executor. This allows asynchronous cleanup.- Author:
- Mathias Hofer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the given clause to the solver state.void
Assumes the truth value of the given proposition for the next call toSatSolverState.satisfiable()
.void
close()
boolean
Computes if the current state is satisfiable.witness()
Returns a witness of the satisfiability of all the clauses in the state, ornull
if the state is unsatisfiable.witness
(Collection<? extends Literal> filter)
-
Constructor Details
-
AsynchronousCloseSatSolverState
- Parameters:
delegate
- the stateexecutor
- the executor which is used to execute the calls to the delegate state
-
-
Method Details
-
satisfiable
public boolean satisfiable()Description copied from interface:SatSolverState
Computes 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:
satisfiable
in interfaceSatSolverState
- Returns:
- true if the state is satisfiable, false if it is not
-
witness
Description copied from interface:SatSolverState
Returns a witness of the satisfiability of all the clauses in the state, ornull
if the state is unsatisfiable.- Specified by:
witness
in interfaceSatSolverState
- Returns:
- a witness if the state is sat, else returns
null
-
witness
- Specified by:
witness
in interfaceSatSolverState
- Parameters:
filter
- filter- Returns:
- Set
-
assume
Description copied from interface:SatSolverState
Assumes 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:
assume
in interfaceSatSolverState
- Parameters:
literal
- the atom for which we assume a value
-
add
Description copied from interface:SatSolverState
Adds the given clause to the solver state.- Specified by:
add
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSatSolverState
-