diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 1acdeaa3..9e95521d 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -745,7 +745,6 @@ public class TypeUnifyTask extends RecursiveTask>> { } } //Alle minimalen Elemente in nextSetasListRest bestimmen - //writeLog("nextSetasListRest davor: " + nextSetasListRest); nextSetasListRest = oup.minElements(nextSetasListRest); } else if (variance == 2) { @@ -777,24 +776,7 @@ public class TypeUnifyTask extends RecursiveTask>> { } //writeLog("nextSet: " + nextSetasList.toString()+ "\n"); //nextSetasList.remove(a); - /* zu loeschen - if (nextSetasList.size() > 0) { - if (nextSetasList.size()>1) { - if (variance == 1) { - a_next = oup.max(nextSetasList.iterator()); - } - else if (variance == -1) { - a_next = oup.min(nextSetasList.iterator()); - } - else { - a_next = nextSetasList.iterator().next(); - } - } - else { - a_next = nextSetasList.iterator().next(); - } - } - */ + //PL 2018-03-01 //TODO: 1. Maximum und Minimum unterscheiden //TODO: 2. compare noch für alle Elmemente die nicht X =. ty sind erweitern @@ -1264,33 +1246,6 @@ public class TypeUnifyTask extends RecursiveTask>> { System.out.print(""); Iterator> nextSetasListIt = new ArrayList>(nextSetasList).iterator(); if (variance == 1) { - /* vorgezogen vor das if - if (parallel) { - for (Set> par_res : add_res) { - if (!isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) { - //wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen - result = par_res; - if (par_res.iterator().next() instanceof WildcardType) { - System.out.println(""); - } - } - else { - if ((isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) - || (!isUndefinedPairSetSet(par_res) && !isUndefinedPairSetSet(result)) - || result.isEmpty()) { - //alle Fehlerfaelle und alle korrekten Ergebnis jeweils adden - writeLog("RES var1 ADD:" + result.toString() + " " + par_res.toString()); - result.addAll(par_res); - } - } - } - //break; - */ - - /* nextSetasList = nextSetasListRest; */ - /* wird bereits vor den unify2-Aufruf durchgefuehrt und nextSetasListRest zugeordnet - */ - System.out.println(""); writeLog("a: " + rekTiefe + " variance: " + variance + a.toString()); writeLog("aParDef: " + aParDef.toString()); @@ -1323,22 +1278,6 @@ public class TypeUnifyTask extends RecursiveTask>> { //nextSetasListIt = nextSetasList.iterator(); Sollte eingefuegt werden PL 2020-04-28 Set a_new = aParDefIt.next(); List> erased = oup.smallerEqThan(a_new, nextSetasList); - - /* loeschen - while (nextSetasListIt.hasNext()) { - Set a_next = nextSetasListIt.next(); - if (a_new.equals(a_next) || - ((oup.compare(a_new, a_next) == 1) && - (!oderConstraint || ((Constraint)a_next).isInherited()))) { - writeLog("Removed: " + a_next.toString()); - nextSetasList.remove(a_next); - } - else { - writeLog("Not Removed: " + a_next.toString()); - System.out.println(""); - } - } - Ende loeschen */ nextSetasList.removeAll(erased); writeLog("Removed: " + erased); @@ -1348,32 +1287,6 @@ public class TypeUnifyTask extends RecursiveTask>> { } } else { if (variance == -1) { - /* vorgezogen vor das if - if (parallel) { - for (Set> par_res : add_res) { - if (!isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) { - //wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen - result = par_res; - if (par_res.iterator().next() instanceof WildcardType) { - System.out.println(""); - } - } - else { - if ((isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) - || (!isUndefinedPairSetSet(par_res) && !isUndefinedPairSetSet(result)) - || result.isEmpty()) { - //alle Fehlerfaelle und alle korrekten Ergebnis jeweils adden - writeLog("RES var-1 ADD:" + result.toString() + " " + par_res.toString()); - result.addAll(par_res); - } - } - } - //break; - } - - } - */ - System.out.println(""); writeLog("a: " + rekTiefe + " variance: " + variance + a.toString()); writeLog("aParDef: " + aParDef.toString()); @@ -1424,21 +1337,6 @@ public class TypeUnifyTask extends RecursiveTask>> { Set a_new = aParDefIt.next(); List> erased = oup.greaterEqThan(a_new, nextSetasList); - /* zu loeschen - while (nextSetasListIt.hasNext()) { - Set a_next = nextSetasListIt.next(); - if (a_new.equals(a_next) || - ((oup.compare(a_new, a_next) == -1) && - (!oderConstraint || ((Constraint)a_new).isInherited()))) { - writeLog("Removed: " + a_next.toString()); - nextSetasList.remove(a_next); //PL geaendert 2019-01-09 - } - else { - System.out.println(""); - writeLog("Not Removed: " + a_next.toString()); - } - } - Ende zu loeschen */ nextSetasList.removeAll(erased); writeLog("Removed: " + erased); @@ -1470,84 +1368,10 @@ public class TypeUnifyTask extends RecursiveTask>> { writeLog("Not Removed: " + nextSetasList); - - - /* zu loeschen PL 2020-05-05 - nextSetasList = nextSetasList.stream() - .filter(x -> !((Constraint)x).isInherited()) - .collect(Collectors.toCollection(ArrayList::new)); - */ - - /* - //TODO: Hier muessen alle kleineren und größeren Elemente von a geloescht werden - writeLog("a: " + rekTiefe + " variance: " + variance + a.toString()); - writeLog("aParDef: " + aParDef.toString()); - aParDef.add(a); - Iterator> aParDefIt = aParDef.iterator(); - while(aParDefIt.hasNext()) { - Set a_new = aParDefIt.next(); - while (nextSetasListIt.hasNext()) { - Set a_next = nextSetasListIt.next(); - if (a_new.equals(a_next) || - ((oup.compare(a_new, a_next) == -1) && - (!oderConstraint || ((Constraint)a_new).isInherited()))){ - writeLog("Removed: " + a_next.toString()); - nextSetasList.remove(a_next); //PL geaendert 2019-01-09 - } - else { - System.out.println(""); - writeLog("Not Removed: " + a_next.toString()); - } - } - - } - writeLog("a: " + rekTiefe + " variance: " + variance + a.toString()); - writeLog("aParDef: " + aParDef.toString()); - aParDefIt = aParDef.iterator(); - while(aParDefIt.hasNext()) { - Set a_new = aParDefIt.next(); - while (nextSetasListIt.hasNext()) { - Set a_next = nextSetasListIt.next(); - if (a_new.equals(a_next) || - ((oup.compare(a_new, a_next) == 1) && - (!oderConstraint || ((Constraint)a_next).isInherited()))){ - writeLog("Removed: " + a_next.toString()); - nextSetasList.remove(a_next); - } - else { - writeLog("Not Removed: " + a_next.toString()); - System.out.println(""); - } - } - } - */ } } else { if (variance == 2) { - /* vorgezogen vor das if - if (parallel) { - for (Set> par_res : add_res) { - if (!isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) { - //wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen - result = par_res; - if (par_res.iterator().next() instanceof WildcardType) { - System.out.println(""); - } - } - else { - if ((isUndefinedPairSetSet(par_res) && isUndefinedPairSetSet(result)) - || (!isUndefinedPairSetSet(par_res) && !isUndefinedPairSetSet(result)) - || result.isEmpty()) { - //alle Fehlerfaelle und alle korrekten Ergebnis jeweils adden - writeLog("RES var2 ADD:" + result.toString() + " " + par_res.toString()); - result.addAll(par_res); - } - } - } - //break; - } - */ }}} writeLog("a: " + rekTiefe + " variance: " + variance + a.toString()); }