diff --git a/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java b/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java index f9cd4b6f..5e866781 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java @@ -673,7 +673,8 @@ public class TYPEStmt implements StatementVisitor { Set methodSignatureConstraint = generatemethodSignatureConstraint(forMethod, assumption, info, resolver); - System.out.println("methodSignatureConstraint; " + methodSignatureConstraint); + //System.out.println("methodSignatureConstraint: " + methodSignatureConstraint); + //System.out.println("methodConstraint: " + methodConstraint); methodConstraint.setmethodSignatureConstraint(methodSignatureConstraint); extendsMethodConstraint.setmethodSignatureConstraint(methodSignatureConstraint); diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 110886dd..130658dc 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -594,7 +594,7 @@ public class TypeUnifyTask extends RecursiveTask>> { /* methodconstraintsets werden zum Ergebnis hinzugefuegt * Anfang */ - //System.out.println("methodSignatureConstraint Return: " + methodSignatureConstraint); + //System.out.println("methodSignatureConstraint Return: " + methodSignatureConstraint + "\n"); eqPrimePrimeSet.forEach(x -> x.addAll(methodSignatureConstraint)); //Substitutionen in methodcontraintsets werdne ausgeführt @@ -885,7 +885,11 @@ public class TypeUnifyTask extends RecursiveTask>> { if (oderConstraint) {//Methodconstraints werden abgespeichert für die Bytecodegenerierung von Methodenaufrufen methodSignatureConstraint.addAll(((Constraint)a).getmethodSignatureConstraint()); - //System.out.println("ERSTELLUNG: " +methodSignatureConstraint); + writeLog("ERSTELLUNG methodSignatureConstraint: " + methodSignatureConstraint); + //System.out.println("ERSTELLUNG methodSignatureConstraint: " +noOfThread+" "+methodSignatureConstraint); + //System.out.println("a: " +a); + //System.out.println("eq: " +eq); + //System.out.println(); } i++; @@ -1134,14 +1138,22 @@ public class TypeUnifyTask extends RecursiveTask>> { writeLog("a in " + variance + " "+ a); writeLog("nextSetasListRest: " + nextSetasListRest.toString()); } + + //Fuer parallele Berechnung der Oder-Contraints wird methodSignature kopiert + //und jeweils die methodSignature von a bzw. nSaL wieder gelöscht, wenn es keine Lösung ist. + Set methodSignatureConstraintForParallel = new HashSet<>(methodSignatureConstraint); + Set nSaL = a; + while (!nextSetasListRest.isEmpty()) { - Set nSaL = nextSetasListRest.remove(0); + methodSignatureConstraintForParallel.removeAll(((Constraint)nSaL).getmethodSignatureConstraint()); + nSaL = nextSetasListRest.remove(0); nextSetasList.remove(nSaL); //PL einkommentiert 20-02-03 + methodSignatureConstraintForParallel.addAll(((Constraint)nSaL).getmethodSignatureConstraint()); Set newEq = new HashSet<>(eq); Set> newElems = new HashSet<>(elems); List>> newOderConstraints = new ArrayList<>(oderConstraints); newElems.add(nSaL); - TypeUnify2Task fork = new TypeUnify2Task(newElems, newEq, newOderConstraints, nSaL, fc, parallel, logFile, log, rekTiefe, urm, usedTasks, methodSignatureConstraint); + TypeUnify2Task fork = new TypeUnify2Task(newElems, newEq, newOderConstraints, nSaL, fc, parallel, logFile, log, rekTiefe, urm, usedTasks, new HashSet<>(methodSignatureConstraintForParallel)); forks.add(fork); synchronized(usedTasks) { if (this.myIsCancelled()) { diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java index f1c2b77f..f3455c9b 100644 --- a/src/test/java/TestComplete.java +++ b/src/test/java/TestComplete.java @@ -10,7 +10,7 @@ import java.util.Vector; import targetast.TestCodegen; import static org.junit.Assert.*; -import static targetast.TestCodegen.generateClassFiles; +import static targetast.TestCodegen.generateClassFiles; public class TestComplete { @Test