let get_loc_nodes_and_part state loc =
let process z (_default, nodes) acc =
if Locations.Zone.intersects z loc then
let z =
if Locations.Zone.equal loc z
then Some loc
(* Be carreful not ot put None here, because if we have n_1 : (s1 =
s2) and then n_2 : (s1.b = 3) the state looks like :
s1.a -> n_1; s1.b -> n_2 ; s1.c -> n_1. And if we
look for s1.a in that state, we get n_1 but this node
represent more that s1.a even if it is so in the
state... *)
else Some (Locations.Zone.narrow z loc) in
let add n acc =
P.debug ~level:2 "[pdg state] get_loc_nodes -> %a@."
PdgTypes.Node.pretty_with_part (n,z);
(n,z)::acc
in
NodeSetLattice.fold add nodes acc
else
acc
in
try LocInfo.fold process state.loc_info []
with LocInfo.Cannot_fold -> raise Cannot_fold