modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

aufgeraeumt
This commit is contained in:
Pluemicke Martin 2018-10-11 16:31:02 +02:00
parent 56dd759762
commit 2be9055608

View File

@ -570,9 +570,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
.collect(Collectors.toCollection(HashSet::new));
//Set<PlaceholderType> vars = durchschnitt.stream().map(x -> (PlaceholderType)x.getLhsType()).collect(Collectors.toCollection(HashSet::new));
int len = nextSetasList.size();
//if (!durchschnitt.isEmpty())
{
//UnifyPair groundBasepair = res.iterator().next().iterator().next().getGroundBasePair().get();
Set<UnifyPair> undefRes = res.stream().reduce((y,z) -> { y.addAll(z); return y;}).get(); //flatten aller undef results
Set<Pair<Set<UnifyPair>, UnifyPair>> reducedUndefResSubstGroundedBasePair = undefRes.stream()
.map(x -> { Set<UnifyPair> su = x.getAllSubstitutions(); //alle benutzten Substitutionen
@ -580,12 +577,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
su.removeAll(durchschnitt); //alle aktuell genänderten Paare entfernen
return new Pair<>(su, x.getGroundBasePair());})
.collect(Collectors.toCollection(HashSet::new));
//Set<UnifyPair> resGroundBasepairs = undefRes.stream().map(x -> x.getGroundBasePair().get()).collect(Collectors.toCollection(HashSet::new));
if (res.size() > 1) {
System.out.println();
}
//Set<UnifyPair> reducedAbhSubst = new HashSet<>(abhSubst);
//reducedAbhSubst.removeAll(durchschnitt);
nextSetasList = nextSetasList.stream().filter(x -> {
//Boolean ret = false;
//for (PlaceholderType var : vars) {
@ -597,7 +591,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
nofstred = nextSetasList.size();
nextSetasList = nextSetasList.stream().filter(y -> couldBecorrect(reducedUndefResSubstGroundedBasePair, y))
.collect(Collectors.toCollection(ArrayList::new));
}
writeLog("abhSubst: " + abhSubst.toString());
writeLog("a: " + a.toString());
writeLog("Durchschnitt: " + durchschnitt.toString());