modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
auskommentierten Code geloescht
This commit is contained in:
parent
670e3ed99f
commit
2e03b5b10c
@ -745,7 +745,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
}
|
||||
}
|
||||
//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<Set<Set<UnifyPair>>> {
|
||||
}
|
||||
//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<Set<Set<UnifyPair>>> {
|
||||
System.out.print("");
|
||||
Iterator<Set<UnifyPair>> nextSetasListIt = new ArrayList<Set<UnifyPair>>(nextSetasList).iterator();
|
||||
if (variance == 1) {
|
||||
/* vorgezogen vor das if
|
||||
if (parallel) {
|
||||
for (Set<Set<UnifyPair>> 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<Set<Set<UnifyPair>>> {
|
||||
//nextSetasListIt = nextSetasList.iterator(); Sollte eingefuegt werden PL 2020-04-28
|
||||
Set<UnifyPair> a_new = aParDefIt.next();
|
||||
List<Set<UnifyPair>> erased = oup.smallerEqThan(a_new, nextSetasList);
|
||||
|
||||
/* loeschen
|
||||
while (nextSetasListIt.hasNext()) {
|
||||
Set<UnifyPair> 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<Set<Set<UnifyPair>>> {
|
||||
}
|
||||
}
|
||||
else { if (variance == -1) {
|
||||
/* vorgezogen vor das if
|
||||
if (parallel) {
|
||||
for (Set<Set<UnifyPair>> 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<Set<UnifyPair>>> {
|
||||
Set<UnifyPair> a_new = aParDefIt.next();
|
||||
List<Set<UnifyPair>> erased = oup.greaterEqThan(a_new, nextSetasList);
|
||||
|
||||
/* zu loeschen
|
||||
while (nextSetasListIt.hasNext()) {
|
||||
Set<UnifyPair> 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<Set<Set<UnifyPair>>> {
|
||||
|
||||
writeLog("Not Removed: " + nextSetasList);
|
||||
|
||||
|
||||
|
||||
/* zu loeschen PL 2020-05-05
|
||||
nextSetasList = nextSetasList.stream()
|
||||
.filter(x -> !((Constraint<UnifyPair>)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<Set<UnifyPair>> aParDefIt = aParDef.iterator();
|
||||
while(aParDefIt.hasNext()) {
|
||||
Set<UnifyPair> a_new = aParDefIt.next();
|
||||
while (nextSetasListIt.hasNext()) {
|
||||
Set<UnifyPair> 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<UnifyPair> a_new = aParDefIt.next();
|
||||
while (nextSetasListIt.hasNext()) {
|
||||
Set<UnifyPair> 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<Set<UnifyPair>> 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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user