let get_last_state pdg =
  try Pdg_state.get_last_state (PdgTypes.Pdg.get_states pdg)
  with Not_found -> raise Db.Pdg.NotFound