} else if (replacementTerm instanceof GdlFunction) {
if (originalTerm instanceof GdlVariable) {
int varIndex = Integer.valueOf(originalTerm.toString().replace("?v", ""));
replacementsByOriginalTupleIndex.put(varIndex, (GdlFunction) replacementTerm);
} else if (originalTerm instanceof GdlFunction) {
GdlFunction originalFunction = (GdlFunction) originalTerm;
GdlFunction replacementFunction = (GdlFunction) replacementTerm;
if (originalFunction.getName() != replacementFunction.getName()) {
return false;
}
boolean successSoFar = findAmbiguity(originalFunction.getBody(),
replacementFunction.getBody(),
replacementsByOriginalTupleIndex);
if (!successSoFar) {
return false;
}
} else {