let open_dot () =
if not dot then fun () -> ()
else
let bfile = Filename.basename file in
let dot_file, dot_channel =
Filename.open_temp_file bfile ".dot" in
dot_fmt := formatter_of_out_channel dot_channel;
fprintf !dot_fmt "digraph \"%s\" {@." bfile;
fprintf !dot_fmt "orientation = portrait;\nfontsize = 10;\nrankdir = BT;\nnode [fontname=helvetica];\nedge [fontname=helvetica];\ngraph [fontname=helvetica];\nratio=\"fill\";\nsize=\"11.7,8.3!\";\nmargin=0;\nsplines=false;\nconcentrate=false;\n@.";
dot_header !dot_fmt;
fun () ->
dot_footer !dot_fmt;
dot_footer !dot_fmt;
close_out dot_channel;
display_graph dot_file