diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 3435edd3..70db967a 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -171,7 +171,10 @@ public class TypeUnifyTask extends RecursiveTask>> { // If pairs occured that did not match one of the cartesian product cases, // those pairs are contradictory and the unification is impossible. if(!undefinedPairs.isEmpty()) { - writeLog("UndefinedPairs; " + undefinedPairs); + for (UnifyPair up : undefinedPairs) { + writeLog("UndefinedPairs; " + up); + writeLog("BasePair; " + up.getBasePair()); + } Set> error = new HashSet<>(); undefinedPairs = undefinedPairs.stream().map(x -> { x.setUndefinedPair(); return x;}).collect(Collectors.toCollection(HashSet::new)); error.add(undefinedPairs); @@ -467,6 +470,10 @@ public class TypeUnifyTask extends RecursiveTask>> { //} return (!x.containsAll(durchschnitt)); }).collect(Collectors.toCollection(ArrayList::new)); + writeLog("abhSubst: " + abhSubst.toString()); + writeLog("nextSet: " + nextSet.toString()); + writeLog("nextSetasList: " + nextSetasList.toString()); + writeLog("Durchschnitt: " + durchschnitt.toString()); System.out.println(""); } if (nextSetasList.size() == 0 && isUndefinedPairSetSet(result) && nextSet.size() > 1) { diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java b/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java index cbe0053f..8aa03a77 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java @@ -79,7 +79,7 @@ public class Unifier implements Function, Iterable suniUnifyPair = new HashSet<>(); - suniUnifyPair.addAll(thisAsPair.getSubstitution()); + suniUnifyPair.addAll(thisAsPair.getAllSubstitutions()); suniUnifyPair.add(thisAsPair); if (p.getLhsType() instanceof PlaceholderType && newLhs instanceof PlaceholderType && p.getPairOp() == PairOperator.EQUALSDOT) { suniUnifyPair.add(p); //p koennte auch subsitution sein