Module logicng

Interface MaxSATHandler

  • All Superinterfaces:
    Handler
    All Known Implementing Classes:
    TimeoutMaxSATHandler

    public interface MaxSATHandler
    extends Handler
    Interface for a handler for MaxSAT solvers.
    Since:
    1.0
    Version:
    2.1.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean aborted()
      Returns whether the computation was aborted by the handler.
      default void finishedSolving()
      This method is called when the MaxSAT solver finished solving.
      boolean foundLowerBound​(int lowerBound, Assignment model)
      This method is called when the MaxSAT solver found a new lower bound for a solution.
      boolean foundUpperBound​(int upperBound, Assignment model)
      This method is called when the MaxSAT solver found a new upper bound for a solution.
      int lowerBoundApproximation()
      Returns the last approximation of the result or -1 if there is no approximation for the lower bound.
      SATHandler satHandler()
      Returns a SAT handler which can be used to cancel internal SAT calls of the MaxSAT solver.
      int upperBoundApproximation()
      Returns the last approximation of the result or -1 if there is no approximation for the lower bound.
    • Method Detail

      • satHandler

        SATHandler satHandler()
        Returns a SAT handler which can be used to cancel internal SAT calls of the MaxSAT solver.
        Returns:
        a SAT handler
      • aborted

        default boolean aborted()
        Description copied from interface: Handler
        Returns whether the computation was aborted by the handler.
        Specified by:
        aborted in interface Handler
        Returns:
        true if the computation was aborted by the handler, otherwise false
      • foundLowerBound

        boolean foundLowerBound​(int lowerBound,
                                Assignment model)
        This method is called when the MaxSAT solver found a new lower bound for a solution.
        Parameters:
        lowerBound - the cost of the lower bound
        model - the model of the lower bound, may be null if not applicable
        Returns:
        true if the solving process should be continued, otherwise false
      • foundUpperBound

        boolean foundUpperBound​(int upperBound,
                                Assignment model)
        This method is called when the MaxSAT solver found a new upper bound for a solution.
        Parameters:
        upperBound - the cost of the upper bound
        model - the model of the upper bound, may be null if not applicable
        Returns:
        true if the solving process should be continued, otherwise false
      • finishedSolving

        default void finishedSolving()
        This method is called when the MaxSAT solver finished solving.
      • lowerBoundApproximation

        int lowerBoundApproximation()
        Returns the last approximation of the result or -1 if there is no approximation for the lower bound. If the handler does not cancel the solving process, it is not guaranteed that this method will return the optimal result. Use the respective method of the MaxSAT solver instead.
        Returns:
        the last approximation of the result or -1 if no approximation is known
      • upperBoundApproximation

        int upperBoundApproximation()
        Returns the last approximation of the result or -1 if there is no approximation for the lower bound. If the handler does not cancel the solving process, it is not guaranteed that this method will return the optimal result. Use the respective method of the MaxSAT solver instead.
        Returns:
        the last approximation of the result or -1 if no approximation is known