code: public static void write(final File file, final Formula formula, final boolean splitAndMultiline,
                             final FormulaStringRepresentation formatter) throws IOException {
      final StringBuilder sb = new StringBuilder();
      if (splitAndMultiline && formula.type() == FType.AND)
        for (final Formula f : formula)
          sb.append(formatter.toString(f)).append(System.lineSeparator());
      else
        sb.append(formatter.toString(formula));
      try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
        writer.append(sb);
        writer.flush();
      }
    }
docs: Writes a given formula to a file  with a given formula formatter.
  @param file              the file
  @param formula           the formula to write
  @param splitAndMultiline indicates whether - if the formula is an conjunction - the single operands should be
  written to different lines without a conjoining operator
  @param formatter         the formatter for the formula
  @throws IOException if there was a problem writing the file