let expand_path_with_old path =
let rec expand_path par path acc =
match path with
[] -> (acc, par)
| node::rest ->
(match par with
None ->
let node = Tree.create_root node in
expand_path (Some node) rest (node::acc)
| Some par ->
(match Tree.get_parent_edge node with
None -> failwith "Expected incoming edge in expand_path"
| Some ed ->
(match Tree.get_edge_label ed with
PathEdge _ as ed ->
let node = Tree.create_child node ed par in
expand_path (Some node) rest (node::acc)
| SummaryEdge {path = spath; n_out = n_out; n_in = n_in} ->
fprintf "Expanding a summary edge!!@.";
let spath = expand_summary_path spath in
List.iter (fun s -> fprintf "Node: ";
print_node Format.std_formatter s;
fprintf "@.") spath;
let (acc, par) = expand_path (Some par) spath acc in
let node = Tree.create_child node (get_parent_edge n_out) (valOf par) in
expand_path (Some node) rest (node::acc)))) in
let (path, _) = expand_path None path [] in
List.rev path