if (typeid(l.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, step.id(), l.condition(), l.to_id())) { unsafes = new Chain<Unsafe>(Unsafe(l, step.id(), e, atom), unsafes); num_unsafes++; } } } else { const NegationList& dels = e.del_list(); for (NegationListIter fi = dels.begin(); fi != dels.end(); fi++) { const Negation& neg = **fi; if (bindings.affects(neg, step.id(), l.condition(), l.to_id())) { unsafes = new Chain<Unsafe>(Unsafe(l, step.id(), e, neg), unsafes); num_unsafes++; } }
if (bindings.affects(e.literal(), step.id(), l.condition(), l.to_id())) { unsafes = new Chain<Unsafe>(Unsafe(l, step.id(), e, e.literal()), unsafes); num_unsafes++;
static void step_threats(const Chain<Unsafe>*& unsafes, size_t& num_unsafes,			 const Step& step, const Chain<Link>* links,			 const Orderings& orderings,			 const Bindings& bindings) {  for (const Chain<Link>* lc = links; lc != NULL; lc = lc->tail) {    const Link& l = lc->head;    StepTime lt1 = l.effect_time();    StepTime lt2 = end_time(l.condition_time());    if (orderings.possibly_before(l.from_id(), lt1, step.id(), STEP_END)	&& orderings.possibly_after(l.to_id(), lt2, step.id(), STEP_START)) {      const EffectList& effects = step.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 (orderings.possibly_before(l.from_id(), lt1, step.id(), et)	    && orderings.possibly_after(l.to_id(), lt2, step.id(), et)) {	  if (typeid(l.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, step.id(),				   l.condition(), l.to_id())) {		unsafes = new Chain<Unsafe>(Unsafe(l, step.id(), e, atom),					    unsafes);		num_unsafes++;	      }	    }	  } else {	    const NegationList& dels = e.del_list();	    for (NegationListIter fi = dels.begin(); fi != dels.end(); fi++) {	      const Negation& neg = **fi;	      if (bindings.affects(neg, step.id(),				   l.condition(), l.to_id())) {		unsafes = new Chain<Unsafe>(Unsafe(l, step.id(), e, neg),					    unsafes);		num_unsafes++;	      }	    }	  }	}      }    }  }}