forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Erste Version mit Recursiv oder modified: ../bytecode/javFiles/Matrix.jav
This commit is contained in:
parent
141194c983
commit
d7e59ecdc7
@ -88,6 +88,8 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
Integer noAllErasedElements = 0;
|
Integer noAllErasedElements = 0;
|
||||||
|
|
||||||
|
static Integer noou = 0;
|
||||||
|
|
||||||
static int noBacktracking;
|
static int noBacktracking;
|
||||||
|
|
||||||
public TypeUnifyTask() {
|
public TypeUnifyTask() {
|
||||||
@ -279,11 +281,20 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
i++;
|
i++;
|
||||||
Set<Set<UnifyPair>> elems = new HashSet<Set<UnifyPair>>(fstElems);
|
Set<Set<UnifyPair>> elems = new HashSet<Set<UnifyPair>>(fstElems);
|
||||||
elems.add(a);
|
elems.add(a);
|
||||||
|
Set<Set<UnifyPair>> res = new HashSet<>();
|
||||||
if (remainingSets.isEmpty()) {
|
if (remainingSets.isEmpty()) {
|
||||||
|
noou++;
|
||||||
writeLog("Vor unify Aufruf: " + eq.toString());
|
writeLog("Vor unify Aufruf: " + eq.toString());
|
||||||
|
writeLog("No of Unify " + noou);
|
||||||
|
System.out.println(noou);
|
||||||
Set<UnifyPair> eq = new HashSet<>();
|
Set<UnifyPair> eq = new HashSet<>();
|
||||||
fstElems.stream().forEach(x -> eq.addAll(x));
|
fstElems.stream().forEach(x -> eq.addAll(x));
|
||||||
Set<Set<UnifyPair>> res = unify(eq, fc, parallel);
|
res = unify(eq, fc, parallel);
|
||||||
|
}
|
||||||
|
else {//duerfte gar nicht mehr vorkommen PL 2018-04-03
|
||||||
|
res = computeCartesianRecursiveOderConstraints(elems, remainingSets, fc, parallel);
|
||||||
|
|
||||||
|
}
|
||||||
if (!isUndefinedPairSetSet(res) && isUndefinedPairSetSet(result)) {
|
if (!isUndefinedPairSetSet(res) && isUndefinedPairSetSet(result)) {
|
||||||
//wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen
|
//wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen
|
||||||
result = res;
|
result = res;
|
||||||
@ -301,7 +312,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
// result = result;
|
// result = result;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* auskommentiert um alle Max und min Betrachtung auszuschalten ANFANG */
|
/* auskommentiert um alle Max und min Betrachtung auszuschalten ANFANG */
|
||||||
@ -400,13 +413,10 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
// result.removeIf(y -> isUndefinedPairSet(y));
|
// result.removeIf(y -> isUndefinedPairSet(y));
|
||||||
//}
|
//}
|
||||||
//else result.stream().filter(y -> !isUndefinedPairSet(y));
|
//else result.stream().filter(y -> !isUndefinedPairSet(y));
|
||||||
} // End of if (remainingSets.isEmpty())
|
|
||||||
else {//duerfte gar nicht mehr vorkommen PL 2018-04-03
|
|
||||||
result.addAll(computeCartesianRecursiveOderConstraints(elems, remainingSets, fc, parallel));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} // End of while (nextSetasList.size() > 0)
|
} // End of while (nextSetasList.size() > 0)
|
||||||
return null; //kann nicht erreicht werden, da der Fall bei dem nextSet == empty bereits am Anfang abgefangen wird
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class Matrix extends Vector<Vector<Integer>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix mul(java.util.Vector<java.util.Vector<java.lang.Integer>> m) {
|
mul(m) {
|
||||||
var ret = new Matrix();
|
var ret = new Matrix();
|
||||||
var i = 0;
|
var i = 0;
|
||||||
while(i < size()) {
|
while(i < size()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user