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

Variance =2 eingefuehrt, wenn Variancen einer Menge unterschiedlich sind (Oer-Constraints)
	modified:   ../bytecode/MatrixOpTest.java
wieder zum Ausfuehren eingeschaltet
This commit is contained in:
Martin Plümicke 2018-11-13 16:08:07 +01:00
parent 74ad081e78
commit 07c679a598
2 changed files with 5 additions and 5 deletions

View File

@ -711,7 +711,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
Optional<Integer> xi = nextSetasList.stream().map(x -> x.stream().filter(y -> y.getLhsType() instanceof PlaceholderType) Optional<Integer> xi = nextSetasList.stream().map(x -> x.stream().filter(y -> y.getLhsType() instanceof PlaceholderType)
.filter(z -> ((PlaceholderType)z.getLhsType()).getVariance() != 0) .filter(z -> ((PlaceholderType)z.getLhsType()).getVariance() != 0)
.map(c -> ((PlaceholderType)c.getLhsType()).getVariance()) .map(c -> ((PlaceholderType)c.getLhsType()).getVariance())
.reduce((a,b)-> {if (a==b) return a; else return 0; })) .reduce((a,b)-> {if (a==b) return a; else return 2; })) //2 kommt insbesondere bei Oder-Constraints vor
.filter(d -> d.isPresent()) .filter(d -> d.isPresent())
.map(e -> e.get()) .map(e -> e.get())
.findAny(); .findAny();
@ -758,7 +758,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
a = oup.min(nextSetasList.iterator()); a = oup.min(nextSetasList.iterator());
nextSetasList.remove(a); nextSetasList.remove(a);
} }
else if (variance == 0) { else if (variance == 0 || variance == 2) {
a = nextSetasList.remove(0); a = nextSetasList.remove(0);
} }
//writeLog("nextSet: " + nextSetasList.toString()+ "\n"); //writeLog("nextSet: " + nextSetasList.toString()+ "\n");

View File

@ -32,9 +32,9 @@ public class MatrixOpTest {
fileToTest = new File(path); fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest); compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/"; pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/";
// compiler.generateBytecode(pathToClassFile); compiler.generateBytecode(pathToClassFile);
// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
// classToTest = loader.loadClass("MatrixOP"); classToTest = loader.loadClass("MatrixOP");
/* /*
Vector<Vector<Integer>> vv = new Vector<Vector<Integer>>(); Vector<Vector<Integer>> vv = new Vector<Vector<Integer>>();
Vector<Integer> v1 = new Vector<Integer> (); Vector<Integer> v1 = new Vector<Integer> ();