for (GdlTerm term : function.getBody()) {
newBody.add(replaceVariables(term, assignment));
}
return GdlPool.getFunction(name, newBody);
} else if (gdl instanceof GdlDistinct) {
GdlDistinct distinct = (GdlDistinct) gdl;
GdlTerm arg1 = replaceVariables(distinct.getArg1(), assignment);
GdlTerm arg2 = replaceVariables(distinct.getArg2(), assignment);
return GdlPool.getDistinct(arg1, arg2);
} else if (gdl instanceof GdlNot) {
GdlLiteral internal = ((GdlNot) gdl).getBody();
return GdlPool.getNot(replaceVariables(internal, assignment));
} else if (gdl instanceof GdlOr) {