code: public static void write(final File file, final BDD bdd) throws IOException {
      final StringBuilder sb = new StringBuilder(String.format("digraph G {%n"));
      if (!bdd.isContradiction()) {
        sb.append(String.format("  const_true [shape=box, label=\"$true\", style = bold, color = darkgreen];%n"));
      }
      if (!bdd.isTautology()) {
        sb.append(String.format("  const_false [shape=box, label=\"$false\", style = bold, color = red];%n"));
      }
      for (final BDDFactory.InternalBDDNode internalNode : bdd.internalNodes()) {
        sb.append(String.format("  id_%d [shape=ellipse, label=\"%s\"];%n", internalNode.nodenum(), internalNode.label()));
        sb.append(String.format("  id_%d -> %s [style = dotted, color = red];%n", internalNode.nodenum(), getNodeString(internalNode.low())));
        sb.append(String.format("  id_%d -> %s [color = darkgreen];%n", internalNode.nodenum(), getNodeString(internalNode.high())));
      }
      sb.append("}").append(System.lineSeparator());
      try (final 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 bdd  the BDD
  @throws IOException if there was a problem writing the file