code: public static void write(final File file, final Formula formula, boolean alignLiterals) throws IOException {
      final StringBuilder sb = new StringBuilder(String.format("digraph G {%n"));
      final Map<Formula, Integer> ids = new HashMap<>();
      if (alignLiterals && !formula.literals().isEmpty())
        sb.append(String.format("{ rank = same;%n"));
      int id = 0;
      for (final Literal lit : formula.literals()) {
        ids.put(lit, id);
        sb.append("  id").append(id).append(" [shape=box, label=\"").
                append(lit.phase() ? lit.name() : "¬" + lit.name()).append(String.format("\"];%n"));
        id++;
      }
      if (alignLiterals && !formula.literals().isEmpty())
        sb.append(String.format("}%n"));
      generateDotString(formula, sb, ids);
      sb.append(String.format("}%n"));
      try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
        writer.append(sb);
        writer.flush();
      }
    }
docs: Writes a given formula's internal data structure as a dot file.
  @param file          the file of the dot file to write
  @param formula       the formula
  @param alignLiterals indicates whether all literals should be aligned at the same vertical level
  @throws IOException if there was a problem writing the file