From 89246ece5cae488e08d7f9a7fa5d4198558c4441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Wed, 21 Feb 2018 14:02:48 +0100 Subject: [PATCH] modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java modified: test/javFiles/Matrix.jav --- src/de/dhbwstuttgart/core/JavaTXCompiler.java | 4 ++-- src/de/dhbwstuttgart/typeinference/unify/RuleSet.java | 10 ++++++++-- test/javFiles/Matrix.jav | 10 +++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java index 4b2e8c9ce..e2dd56a1b 100644 --- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -101,8 +101,8 @@ public class JavaTXCompiler { } System.out.println(xConsSet); - Set> result = unify.unifySequential(xConsSet, finiteClosure); - //Set> result = unify.unify(xConsSet, finiteClosure); + //Set> result = unify.unifySequential(xConsSet, finiteClosure); + Set> result = unify.unify(xConsSet, finiteClosure); System.out.println("RESULT: " + result); results.addAll(result); } diff --git a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java index b699bdb27..0b51a25e4 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java @@ -421,10 +421,16 @@ public class RuleSet implements IRuleSet{ TypeParams typeDParams = typeD.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(); - 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)); - + } return Optional.of(new UnifyPair(unif.apply(newLhs), typeDs, PairOperator.SMALLERDOT)); } diff --git a/test/javFiles/Matrix.jav b/test/javFiles/Matrix.jav index 4b5d259fd..e11835359 100644 --- a/test/javFiles/Matrix.jav +++ b/test/javFiles/Matrix.jav @@ -13,11 +13,11 @@ class Matrix extends Vector> { while(j < v1.size()) { var erg = 0; var k = 0; - //while(k < v1.size()) { - //erg = erg + v1.elementAt(k) - // * m.elementAt(k).elementAt(j); - //k++; } - //v2.addElement(new Integer(erg)); + while(k < v1.size()) { + erg = erg + v1.elementAt(k) + * m.elementAt(k).elementAt(j); + k++; } + v2.addElement(new Integer(erg)); j++; } ret.addElement(v2); i++; }