let fix_edges (group : string hashset)
(inbound : string hashset)
(graph : graph) : unit =
let remove_inbound edge = match edge with
| OutIsect n -> mem group n
| _ -> false in
let remove_group edge = match edge with
| OutIsect _ -> false
| OutConcatLeft (rhs, target) -> mem group target
| OutConcatRight (lhs, target) -> mem group target in
let group_it id =
let id_node = find_node graph id in
iter (fun edge -> if remove_group edge then
remove_outb graph id edge) id_node.outb
in let inbound_it id =
let id_node = find_node graph id in
iter (fun edge -> if remove_inbound edge then
remove_outb graph id edge) id_node.outb
in
iter group_it group;
iter inbound_it inbound