From 9d53d9d5d15a406b107e0c9530d0a2979cc29538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Fri, 25 May 2018 11:16:02 +0200 Subject: [PATCH] modified: src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java kleiner Fehler korrigiert modified: test/javFiles/Matrix.jav --- .../unify/model/FiniteClosure.java | 18 +++++++++++++++--- test/javFiles/Matrix.jav | 6 +++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java index 817ef3f4..5eef0308 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java @@ -194,6 +194,11 @@ public class FiniteClosure extends Ordering implements IFiniteClosure @Override //Eingefuegt PL 2018-05-24 F-Bounded Problematik public Set greater(UnifyType type, Set fBounded) { + + if(type instanceof FunNType) { + return computeGreaterFunN((FunNType) type, fBounded); + } + Set result = new HashSet<>(); Set>> PairResultFBounded = new HashSet<>(); @@ -224,7 +229,7 @@ public class FiniteClosure extends Ordering implements IFiniteClosure Set fBoundedNew = new HashSet<>(fBounded); fBoundedNew.add(theta1); Set theta2Set = candidate.getContentOfPredecessors(); - + //System.out.println(""); for(UnifyType theta2 : theta2Set) { result.add(theta2.apply(sigma)); PairResultFBounded.add(new Pair<>(theta2.apply(sigma), fBoundedNew)); @@ -253,10 +258,17 @@ public class FiniteClosure extends Ordering implements IFiniteClosure // System.out.println(""); //} BinaryOperator bo = (a,b) -> (a || b); - if (lfBounded.stream().reduce(false,f,bo)) continue; //F-Bounded Endlosrekursion - paramCandidates.add(grArg(t.getTypeParams().get(i), new HashSet<>(fBounded) )); + if (lfBounded.stream().reduce(false,f,bo)) { + //F-Bounded Endlosrekursion + HashSet res = new HashSet(); + paramCandidates.add(res); + } + else { + paramCandidates.add(grArg(t.getTypeParams().get(i), new HashSet<>(fBounded) )); + } } permuteParams(paramCandidates).forEach(x -> result.add(t.setTypeParams(x))); + //System.out.println(""); } } return result; diff --git a/test/javFiles/Matrix.jav b/test/javFiles/Matrix.jav index 18120deb..4c55c410 100644 --- a/test/javFiles/Matrix.jav +++ b/test/javFiles/Matrix.jav @@ -15,9 +15,9 @@ class Matrix extends Vector> { var erg = 0; var k = 0; while(k < v1.size()) { - //erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); - erg = add1(erg, mul1(v1.elementAt(k), - m.elementAt(k).elementAt(j))); + erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); + // erg = add1(erg, mul1(v1.elementAt(k), + // m.elementAt(k).elementAt(j))); k++; } v2.addElement(new Integer(erg)); j++; }