diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 3c89ea38..79b73ba3 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -731,6 +731,7 @@ public class TypeUnifyTask extends RecursiveTask>> { } else if (variance == -1) { a = oup.min(nextSetasList.iterator()); + writeLog("Min: a in " + variance + " "+ a); nextSetasList.remove(a); nextSetasListRest = new ArrayList<>(nextSetasList); Iterator> nextSetasListItRest = new ArrayList>(nextSetasListRest).iterator(); @@ -2059,7 +2060,7 @@ public class TypeUnifyTask extends RecursiveTask>> { //} Set cs = fc.getAllTypesByName(thetaPrime.getName());//cs= [java.util.Vector, java.util.Vector>, ????java.util.Vector???] - + writeLog("cs: " + cs.toString()); //PL 18-02-06 entfernt, kommt durch unify wieder rein //cs.add(thetaPrime); //PL 18-02-06 entfernt @@ -2085,6 +2086,7 @@ public class TypeUnifyTask extends RecursiveTask>> { if (!(match.match(ml)).isPresent()) { thetaQs.remove(c); } + writeLog("thetaQs von " + c + ": " + thetaQs.toString()); //Set thetaQs = fc.getChildren(c).stream().collect(Collectors.toCollection(HashSet::new)); //thetaQs.add(thetaPrime); //PL 18-02-05 wieder geloescht //PL 2017-10-03: War auskommentiert habe ich wieder einkommentiert, @@ -2108,7 +2110,7 @@ public class TypeUnifyTask extends RecursiveTask>> { for(TypeParams tp : permuteParams(candidateParams)) thetaQPrimes.add(c.setTypeParams(tp)); } - + writeLog("thetaQPrimes von " + c + ": " + thetaQPrimes.toString()); for(UnifyType tqp : thetaQPrimes) {//PL 2020-03-08 umbauen in der Schleife wird nur unifizierbarer Typ gesucht break am Ende Collection tphs = tqp.getInvolvedPlaceholderTypes(); Optional opt = stdUnify.unify(tqp, thetaPrime); @@ -2180,7 +2182,7 @@ public class TypeUnifyTask extends RecursiveTask>> { } } } - + writeLog("result von " + pair + ": " + result.toString()); return result; } diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java index 95c90377..8ee39d7f 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java @@ -711,13 +711,15 @@ implements IFiniteClosure { HashSet hs = new HashSet<>(); hs.add(up); Set smallerRes = unifyTask.applyTypeUnificationRules(hs, this); - if (left.getName().equals("Matrix") || right.getName().equals("Matrix")) + /* + //if (left.getName().equals("Matrix") || right.getName().equals("Matrix")) {try { logFile.write("\nsmallerRes: " + smallerRes);//"smallerHash: " + greaterHash.toString()); logFile.flush(); } catch (IOException e) { System.err.println("no LogFile");}} + */ //Gleichungen der Form a <./=. Theta oder Theta <./=. a oder a <./=. b sind ok. Predicate delFun = x -> !((x.getLhsType() instanceof PlaceholderType || x.getRhsType() instanceof PlaceholderType) @@ -732,13 +734,15 @@ implements IFiniteClosure { hs = new HashSet<>(); hs.add(up); Set greaterRes = unifyTask.applyTypeUnificationRules(hs, this); - if (left.getName().equals("Matrix") || right.getName().equals("Matrix")) + /* + //if (left.getName().equals("Matrix") || right.getName().equals("Matrix")) {try { logFile.write("\ngreaterRes: " + greaterRes);//"smallerHash: " + greaterHash.toString()); logFile.flush(); } catch (IOException e) { System.err.println("no LogFile");}} + */ //Gleichungen der Form a <./=. Theta oder Theta <./=. a oder a <./=. b sind ok. long greaterLen = greaterRes.stream().filter(delFun).count(); if (greaterLen == 0) return 1;