if (gdl instanceof GdlProposition) {
return gdl;
} else if (gdl instanceof GdlRelation) {
GdlRelation relation = (GdlRelation) gdl;
GdlConstant name = relation.getName();
List<GdlTerm> newBody = new ArrayList<GdlTerm>(relation.arity());
for(GdlTerm term : relation.getBody()) {
newBody.add(replaceVariables(term, assignment));
}
return GdlPool.getRelation(name, newBody);
} else if (gdl instanceof GdlConstant) {