let translate_crit_to_select pdg ?(to_select=[]) list_crit =
let translate acc (nodes, nd_mark) =
let add_pdg_mark acc (nd, mark) =
let add_nodes m acc nodes =
let add m acc nodepart =
PdgMarks.add_node_to_select acc nodepart m
in
List.fold_left (add m) acc nodes
in
let add_node_dpds dpd_mark f_dpds acc (node, _node_z_part) =
let nodes = f_dpds node in
add_nodes dpd_mark acc nodes
in
let acc = match nd with
| T.CwNode -> add_nodes mark acc nodes
| T.CwAddrDpds -> let f = P.Pdg.get_x_direct_dpds P.Dpd.Addr pdg in
List.fold_left (add_node_dpds mark f) acc nodes
| T.CwCtrlDpds -> let f = P.Pdg.get_x_direct_dpds P.Dpd.Ctrl pdg in
List.fold_left (add_node_dpds mark f) acc nodes
| T.CwDataDpds -> let f = P.Pdg.get_x_direct_dpds P.Dpd.Data pdg in
List.fold_left (add_node_dpds mark f) acc nodes
in acc
in List.fold_left add_pdg_mark acc nd_mark
in List.fold_left translate to_select list_crit