modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java

modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   test/javFiles/Matrix.jav
This commit is contained in:
Martin Plümicke 2018-02-21 14:02:48 +01:00
parent 5270cecec9
commit 89246ece5c
3 changed files with 15 additions and 9 deletions

View File

@ -101,8 +101,8 @@ public class JavaTXCompiler {
} }
System.out.println(xConsSet); System.out.println(xConsSet);
Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure); //Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure);
//Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure); Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
System.out.println("RESULT: " + result); System.out.println("RESULT: " + result);
results.addAll(result); results.addAll(result);
} }

View File

@ -421,10 +421,16 @@ public class RuleSet implements IRuleSet{
TypeParams typeDParams = typeD.getTypeParams(); TypeParams typeDParams = typeD.getTypeParams();
TypeParams typeDgenParams = typeDgen.getTypeParams(); TypeParams typeDgenParams = typeDgen.getTypeParams();
System.out.println("Pair: " +pair);
System.out.println("typeD: " +typeD);
//System.out.println("typeDParams: " +typeDParams);
System.out.println("typeDgen: " +typeD);
//System.out.println("typeDgenParams: " +typeDgenParams);
Unifier unif = Unifier.identity(); Unifier unif = Unifier.identity();
for(int i = 0; i < typeDParams.size(); i++) for(int i = 0; i < typeDParams.size(); i++) {
System.out.println("ADAPT" +typeDgenParams);
unif.add((PlaceholderType) typeDgenParams.get(i), typeDParams.get(i)); unif.add((PlaceholderType) typeDgenParams.get(i), typeDParams.get(i));
}
return Optional.of(new UnifyPair(unif.apply(newLhs), typeDs, PairOperator.SMALLERDOT)); return Optional.of(new UnifyPair(unif.apply(newLhs), typeDs, PairOperator.SMALLERDOT));
} }

View File

@ -13,11 +13,11 @@ class Matrix extends Vector<Vector<Integer>> {
while(j < v1.size()) { while(j < v1.size()) {
var erg = 0; var erg = 0;
var k = 0; var k = 0;
//while(k < v1.size()) { while(k < v1.size()) {
//erg = erg + v1.elementAt(k) erg = erg + v1.elementAt(k)
// * m.elementAt(k).elementAt(j); * m.elementAt(k).elementAt(j);
//k++; } k++; }
//v2.addElement(new Integer(erg)); v2.addElement(new Integer(erg));
j++; } j++; }
ret.addElement(v2); ret.addElement(v2);
i++; } i++; }