code: private void addCNF(final Formula formula, int weight) {
      switch (formula.type()) {
        case TRUE:
          break;
        case FALSE:
        case LITERAL:
        case OR:
          this.addClause(formula, weight);
          break;
        case AND:
          for (Formula op : formula)
            this.addClause(op, weight);
          break;
        default:
          throw new IllegalArgumentException("Input formula ist not a valid CNF: " + formula);
      }
    }
docs: Adds a formula which is already in CNF to the solver.
  @param formula the formula in CNF
  @param weight  the weight of this CNF (or -1 for a hard constraint)