Module logicng

Class CCEXKCardinalityNetwork

  • All Implemented Interfaces:
    CCAtMostK

    public final class CCEXKCardinalityNetwork
    extends Object
    implements CCAtMostK
    Encodes that exactly 'rhs' variables are assigned value true. Uses the cardinality network encoding due to Asín, Nieuwenhuis, Oliveras, and Rodríguez-Carbonell .
    Since:
    1.1
    Version:
    1.1
    • Method Detail

      • build

        public void build​(EncodingResult result,
                          Variable[] vars,
                          int rhs)
        Description copied from interface: CCAtMostK
        Builds a cardinality constraint of the form var_1 + var_2 + ... + var_n <= k.
        Specified by:
        build in interface CCAtMostK
        Parameters:
        result - the result for 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: CCAtMostK
        Returns the incremental data for the current encoded constraint.
        Specified by:
        incrementalData in interface CCAtMostK
        Returns:
        the incremental data for the current encoded constraint