let process_declarations pdg ~formals ~locals =
    let empty_state = Pdg_state.empty in

    
    (** 2 new nodes for each formal parameters : one for its declaration, and one for its values. This is because it might be the case that we only need the declaration whatever the value is. Might allow us to do a better slicing of the callers. TODO: normally, the value should depend on the the declaration, but because we don't know how to select a declaration without selecting the value at the moment, we do the dependence the other way round. *)

    let do_param (n, state) v =
      let decl_node = decl_var pdg v in
      let new_node = add_elem pdg (Key.param_key n) in
      add_decl_dpd pdg new_node Dpd.Addr decl_node ;
      add_decl_dpd pdg decl_node Dpd.Addr new_node ;
      let new_state =
        Pdg_state.add_loc_node
          state  ~exact:true (Locations.zone_of_varinfo v) new_node in
        (n+1, new_state)
    in
    let _next_in_num, new_state =
      List.fold_left do_param (1, empty_state) formals in
    List.iter (fun v -> ignore (decl_var pdg v)) locals;
    new_state