code: private void encodeConstraint(final PBConstraint cc, final EncodingResult result) {
      if (!cc.isCC())
        throw new IllegalArgumentException("Cannot encode a non-cardinality constraint with a cardinality constraint encoder.");
      final Variable[] ops = litsAsVars(cc.operands());
      switch (cc.comparator()) {
        case LE:
          if (cc.rhs() == 1)
            this.amo(result, ops);
          else
            this.amk(result, ops, cc.rhs());
          break;
        case LT:
          if (cc.rhs() == 2)
            this.amo(result, ops);
          else
            this.amk(result, ops, cc.rhs() - 1);
          break;
        case GE:
          this.alk(result, ops, cc.rhs());
          break;
        case GT:
          this.alk(result, ops, cc.rhs() + 1);
          break;
        case EQ:
          if (cc.rhs() == 1)
            this.exo(result, ops);
          else
            this.exk(result, ops, cc.rhs());
          break;
        default:
          throw new IllegalArgumentException("Unknown pseudo-Boolean comparator: " + cc.comparator());
      }
    }
docs: Encodes the constraint in the given result.
  @param cc     the constraint
  @param result the result