Class AsynchronousCloseSatSolverState

java.lang.Object
org.tweetyproject.arg.adf.sat.state.AsynchronousCloseSatSolverState
All Implemented Interfaces:
AutoCloseable, SatSolverState

public class AsynchronousCloseSatSolverState extends Object implements SatSolverState
The close() call is handled by the provided executor. This allows asynchronous cleanup.
Author:
Mathias Hofer
  • Constructor Details

    • AsynchronousCloseSatSolverState

      public AsynchronousCloseSatSolverState(SatSolverState delegate, Executor executor)
      Parameters:
      delegate - the state
      executor - 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 interface SatSolverState
      Returns:
      true if the state is satisfiable, false if it is not
    • witness

      public Set<Literal> witness()
      Description copied from interface: SatSolverState
      Returns a witness of the satisfiability of all the clauses in the state, or null if the state is unsatisfiable.
      Specified by:
      witness in interface SatSolverState
      Returns:
      a witness if the state is sat, else returns null
    • witness

      public Set<Literal> witness(Collection<? extends Literal> filter)
      Specified by:
      witness in interface SatSolverState
      Parameters:
      filter - filter
      Returns:
      Set
    • assume

      public void assume(Literal literal)
      Description copied from interface: SatSolverState
      Assumes the truth value of the given proposition for the next call to SatSolverState.satisfiable(). There can be multiple assumptions, all of them are gone after the next SatSolverState.satisfiable() call.
      Specified by:
      assume in interface SatSolverState
      Parameters:
      literal - the atom for which we assume a value
    • add

      public boolean add(Clause clause)
      Description copied from interface: SatSolverState
      Adds the given clause to the solver state.
      Specified by:
      add in interface SatSolverState
      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 interface AutoCloseable
      Specified by:
      close in interface SatSolverState