for (EffectListIter ei = effects.begin(); ei != effects.end(); ei++) {
for (EffectList::const_iterator ei = effects.begin(); ei != effects.end(); ei++) {
static void link_threats(const Chain<Unsafe>*& unsafes, size_t& num_unsafes,			 const Link& link, const Chain<Step>* steps,			 const Orderings& orderings,			 const Bindings& bindings) {  StepTime lt1 = link.effect_time();  StepTime lt2 = end_time(link.condition_time());  for (const Chain<Step>* sc = steps; sc != NULL; sc = sc->tail) {    const Step& s = sc->head;    if (link.from_id() == s.id()	|| (orderings.possibly_before(link.from_id(), lt1, s.id(), STEP_END)	    && orderings.possibly_after(link.to_id(), lt2,					s.id(), STEP_START))) {      const EffectList& effects = s.action().effects();      for (EffectListIter ei = effects.begin(); ei != effects.end(); ei++) {	const Effect& e = **ei;	if (!domain->requirements.durative_actions	    && e.link_condition().contradiction()) {	  continue;	}	StepTime et = end_time(e);	if ((link.from_id() == s.id() && lt1 == et)	    || orderings.possibly_before(link.from_id(), lt1, s.id(), et)	    || orderings.possibly_after(link.to_id(), lt2, s.id(), et)) {	  if (typeid(link.condition()) == typeid(Negation)) {	    const AtomList& adds = e.add_list();	    for (AtomListIter fi = adds.begin(); fi != adds.end(); fi++) {	      const Atom& atom = **fi;	      if (bindings.affects(atom, s.id(),				   link.condition(), link.to_id())) {		unsafes = new Chain<Unsafe>(Unsafe(link, s.id(), e, atom),					    unsafes);		num_unsafes++;	      }	    }	  } else if (!(link.from_id() == s.id() && lt1 == et)) {	    const NegationList& dels = e.del_list();	    for (NegationListIter fi = dels.begin(); fi != dels.end(); fi++) {	      const Negation& neg = **fi;	      if (bindings.affects(neg, s.id(),				   link.condition(), link.to_id())) {		unsafes = new Chain<Unsafe>(Unsafe(link, s.id(), e, neg),					    unsafes);		num_unsafes++;	      }	    }	  }	}      }    }  }}