let print_final_project proj filename =
  match proj.T.actions with [] ->
    let file = open_out filename in
    let fmt = Format.formatter_of_out_channel file in
    Format.fprintf fmt "%a@." print_project proj
  | _ -> raise (Invalid_argument ("Impossible to produce the final project "^
                  "because the worklist is not empty"))