Module logicng

Interface CCExactlyK

  • All Known Implementing Classes:
    CCEXKTotalizer

    public interface CCExactlyK
    The interface for exactly-k (ALK) cardinality constraints.
    Since:
    1.1
    Version:
    2.0.0
    • Method Detail

      • build

        void build​(EncodingResult result,
                   Variable[] vars,
                   int rhs)
        Builds a cardinality constraint of the form var_1 + var_2 + ... + var_n = k.
        Parameters:
        result - the result of the encoding
        vars - the variables var_1 ... var_n
        rhs - the right-hand side k of the constraint
        Throws:
        IllegalArgumentException - if the right-hand side of the cardinality constraint is negative
      • incrementalData

        CCIncrementalData incrementalData()
        Returns the incremental data for the current encoded constraint.
        Returns:
        the incremental data for the current encoded constraint