refactoring

This commit is contained in:
Florian Steurer 2016-04-12 15:47:38 +02:00
parent 27f6abefe8
commit d8e7df425d

View File

@ -66,16 +66,17 @@ public class MartelliMontanariUnify implements IUnify {
// f<t1,...,tn> = f<s1,...,sm> are not unifiable // f<t1,...,tn> = f<s1,...,sm> are not unifiable
if(rhsTypeParams.size() != lhsTypeParams.size()) if(rhsTypeParams.size() != lhsTypeParams.size())
return Optional.empty(); // conflict return Optional.empty(); // conflict
// f = g is not unifiable (cannot be f = f because erase rule would have been applied)
if(rhsTypeParams.size() != 0) { //if(rhsTypeParams.size() == 0)
// Unpack the arguments //return Optional.empty();
for(int i = 0; i < rhsTypeParams.size(); i++)
result.add(new UnifyPair(rhsTypeParams.get(i), lhsTypeParams.get(i), PairOperator.EQUALSDOT));
termsList.remove(idx); // Unpack the arguments
termsList.addAll(result); for(int i = 0; i < rhsTypeParams.size(); i++)
continue; result.add(new UnifyPair(rhsTypeParams.get(i), lhsTypeParams.get(i), PairOperator.EQUALSDOT));
}
termsList.remove(idx);
termsList.addAll(result);
continue;
} }
// SWAP - Rule // SWAP - Rule