code: void buildAMK(final EncodingResult result, final Variable[] vars, int rhs) {
      final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);
      this.incData = new CCIncrementalData(result, CCConfig.AMK_ENCODER.TOTALIZER, rhs, cardinalityOutvars);
      this.toCNF(cardinalityOutvars, rhs, Bound.UPPER);
      assert this.cardinalityInvars.size() == 0;
      for (int i = rhs; i < cardinalityOutvars.size(); i++)
        this.result.addClause(cardinalityOutvars.get(i).negate());
    }
docs: Builds an at-most-k constraint.
  @param result the result
  @param vars   the variables
  @param rhs    the right-hand side
  @throws IllegalArgumentException if the right hand side of the constraint was negative