Module logicng

Class CCEXKTotalizer

  • All Implemented Interfaces:
    CCExactlyK

    public final class CCEXKTotalizer
    extends Object
    implements CCExactlyK
    Encodes that exactly 'rhs' variables can be assigned value true. Uses the totalizer encoding for translating the cardinality constraint into CNF.
    Since:
    1.1
    Version:
    2.0.0
    • Method Detail

      • build

        public void build​(EncodingResult result,
                          Variable[] vars,
                          int rhs)
        Description copied from interface: CCExactlyK
        Builds a cardinality constraint of the form var_1 + var_2 + ... + var_n = k.
        Specified by:
        build in interface CCExactlyK
        Parameters:
        result - the result of the encoding
        vars - the variables var_1 ... var_n
        rhs - the right-hand side k of the constraint
      • incrementalData

        public CCIncrementalData incrementalData()
        Description copied from interface: CCExactlyK
        Returns the incremental data for the current encoded constraint.
        Specified by:
        incrementalData in interface CCExactlyK
        Returns:
        the incremental data for the current encoded constraint