modified: TypeUnifyTask.java

modified:   model/UnifyPair.java
This commit is contained in:
Pluemicke Martin 2018-03-14 17:45:16 +01:00
parent 273ddb92d7
commit 89b7d99621
2 changed files with 12 additions and 4 deletions

View File

@ -362,10 +362,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
else { else {
result.addAll(computeCartesianRecursive(elems, remainingSets, eq, fc, parallel)); result.addAll(computeCartesianRecursive(elems, remainingSets, eq, fc, parallel));
} }
if (result.size() == 1) {
System.out.println(result.toString());
result.remove(result.iterator().next());
}
if (!result.isEmpty()) { if (!result.isEmpty()) {
if (variance == 1) { if (variance == 1) {
if (a.iterator().next().getLhsType().getName().equals("WL")) if (a.iterator().next().getLhsType().getName().equals("WL"))
@ -399,6 +395,14 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
return result; return result;
} }
protected boolean isUndefinedPairSet(Set<Set<UnifyPair>> s) {
boolean res = true;
if (s.size() ==1) {
s.iterator().next().stream().forEach(x -> { res = res && x.isUndefinedPair(); return; });
return res;
}
}
/** /**
* Checks whether a set of pairs is in solved form. * Checks whether a set of pairs is in solved form.
* @param eqPrimePrime The set of pair * @param eqPrimePrime The set of pair

View File

@ -75,6 +75,10 @@ public class UnifyPair {
public void setVariance(byte v) { public void setVariance(byte v) {
variance = v; variance = v;
} }
public boolean isUndefinedPair() {
return undefinedPair;
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(!(obj instanceof UnifyPair)) if(!(obj instanceof UnifyPair))