diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index f8af5dd7..4af7a62c 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -156,7 +156,9 @@ public class TypeUnifyTask extends RecursiveTask>> { // those pairs are contradictory and the unification is impossible. if(!undefinedPairs.isEmpty()) { writeLog("UndefinedPairs; " + undefinedPairs); - return new HashSet<>(); + Set> error = new HashSet<>(); + error.add(undefinedPairs); + return error; } /* Up to here, no cartesian products are calculated. @@ -310,7 +312,7 @@ public class TypeUnifyTask extends RecursiveTask>> { int i = 0; byte variance = nextSetasList.iterator().next().iterator().next().getVariance(); Set a_next = null; - if (nextSetasList.iterator().next().iterator().next().getLhsType().getName().equals("A")) + if (nextSetasList.iterator().next().iterator().next().getLhsType().getName().equals("D")) System.out.print(""); if (nextSetasList.size()>1) { if (variance == 1) { @@ -360,6 +362,10 @@ public class TypeUnifyTask extends RecursiveTask>> { else { 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 (variance == 1) { if (a.iterator().next().getLhsType().getName().equals("WL")) diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java index abb7651c..82194363 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java @@ -27,6 +27,8 @@ public class UnifyPair { private PairOperator pairOp; private byte variance = 0; + + private boolean undefinedPair = false; private final int hashCode; diff --git a/test/javFiles/Matrix.jav b/test/javFiles/Matrix.jav index e8178ad4..6d73c1fc 100644 --- a/test/javFiles/Matrix.jav +++ b/test/javFiles/Matrix.jav @@ -16,6 +16,7 @@ class Matrix extends Vector> { var erg = 0; var k = 0; while(k < v1.size()) { + erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); erg = add(erg, mul1(v1.elementAt(k), m.elementAt(k).elementAt(j))); k++; }