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
if(rhsTypeParams.size() != lhsTypeParams.size())
return Optional.empty(); // conflict
// f = g is not unifiable (cannot be f = f because erase rule would have been applied)
//if(rhsTypeParams.size() == 0)
//return Optional.empty();
if(rhsTypeParams.size() != 0) {
// Unpack the arguments
for(int i = 0; i < rhsTypeParams.size(); i++)
result.add(new UnifyPair(rhsTypeParams.get(i), lhsTypeParams.get(i), PairOperator.EQUALSDOT));
// Unpack the arguments
for(int i = 0; i < rhsTypeParams.size(); i++)
result.add(new UnifyPair(rhsTypeParams.get(i), lhsTypeParams.get(i), PairOperator.EQUALSDOT));
termsList.remove(idx);
termsList.addAll(result);
continue;
}
termsList.remove(idx);
termsList.addAll(result);
continue;
}
// SWAP - Rule