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

Erste Version mit Recursiv oder

	modified:   ../bytecode/javFiles/Matrix.jav
This commit is contained in:
Martin Plümicke 2018-10-20 17:42:44 +02:00
parent 141194c983
commit d7e59ecdc7
2 changed files with 19 additions and 9 deletions

View File

@ -88,6 +88,8 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
Integer noAllErasedElements = 0;
static Integer noou = 0;
static int noBacktracking;
public TypeUnifyTask() {
@ -279,11 +281,20 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
i++;
Set<Set<UnifyPair>> elems = new HashSet<Set<UnifyPair>>(fstElems);
elems.add(a);
Set<Set<UnifyPair>> res = new HashSet<>();
if (remainingSets.isEmpty()) {
noou++;
writeLog("Vor unify Aufruf: " + eq.toString());
writeLog("No of Unify " + noou);
System.out.println(noou);
Set<UnifyPair> eq = new HashSet<>();
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)) {
//wenn korrektes Ergebnis gefunden alle Fehlerfaelle loeschen
result = res;
@ -304,6 +315,8 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
}
/* auskommentiert um alle Max und min Betrachtung auszuschalten ANFANG */
if (!result.isEmpty() && !isUndefinedPairSetSet(res)) {
if (nextSetasList.iterator().hasNext() && nextSetasList.iterator().next().stream().filter(x -> x.getLhsType().getName().equals("B")).findFirst().isPresent() && nextSetasList.size()>1)
@ -400,13 +413,10 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
// result.removeIf(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)
return null; //kann nicht erreicht werden, da der Fall bei dem nextSet == empty bereits am Anfang abgefangen wird
return result;
}

View File

@ -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 i = 0;
while(i < size()) {