Module logicng

Class CCIncrementalData


  • public final class CCIncrementalData
    extends Object
    Incremental data for an at-most-k cardinality constraint. When an at-most-k cardinality constraint is constructed, it is possible to save incremental data with it. Then one can modify the constraint after it was created by tightening the original bound.
    Since:
    1.1
    Version:
    1.1
    • Method Detail

      • newUpperBound

        public List<Formula> newUpperBound​(int rhs)
        Tightens the upper bound of an at-most-k constraint and returns the resulting formula.
        Parameters:
        rhs - the new upperBound
        Returns:
        the incremental encoding of the new upper bound
      • newUpperBoundForSolver

        public void newUpperBoundForSolver​(int rhs)
        Tightens the upper bound of an at-most-k constraint and encodes it on the solver of the result.

        Usage constraints: -New right-hand side must be smaller than current right-hand side. -Cannot be used for at-least-k constraints.

        Parameters:
        rhs - the new upperBound
      • newLowerBound

        public List<Formula> newLowerBound​(int rhs)
        Tightens the lower bound of an at-least-k constraint and returns the resulting formula.
        Parameters:
        rhs - the new upperBound
        Returns:
        the incremental encoding of the new lower bound
      • newLowerBoundForSolver

        public void newLowerBoundForSolver​(int rhs)
        Tightens the lower bound of an at-least-k constraint and encodes it on the solver of the result.

        Usage constraints: -New right-hand side must be greater than current right-hand side. -Cannot be used for at-most-k constraints.

        Parameters:
        rhs - the new upperBound
      • currentRHS

        public int currentRHS()
        Returns the current right-hand side of this CCIncrementalData.
        Returns:
        the current right-hand side of this CCIncrementalData.