@Override public ListallDoRule applySubst(Substitution substitution) { // Make sure to not instantiate the variable assigned to by this rule. // TODO: can we delegate this to check during compile time? Substitution safesubstitution = substitution.clone(); safesubstitution.remove(getVariable()); return new ListallDoRule((getCondition() == null) ? null : getCondition().applySubst(substitution), getVariable(), (getAction() == null) ? null : getAction().applySubst(safesubstitution), getSourceInfo()); }