public Rule substitute(Term term, Term replacement) {
        List<Predicate> substitutedConditions = new ArrayList<Predicate>(conditions.size());
        for (Predicate condition : conditions) {
            substitutedConditions.add((Predicate) condition.substitute(term, replacement));
        }

        return new Rule((Predicate) head.substitute(term, replacement), substitutedConditions);
    }