modified: src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java

kleiner Fehler korrigiert
	modified:   test/javFiles/Matrix.jav
This commit is contained in:
Martin Plümicke 2018-05-25 11:16:02 +02:00
parent 1de897fb1f
commit 9d53d9d5d1
2 changed files with 18 additions and 6 deletions

View File

@ -194,6 +194,11 @@ public class FiniteClosure extends Ordering<UnifyType> implements IFiniteClosure
@Override
//Eingefuegt PL 2018-05-24 F-Bounded Problematik
public Set<UnifyType> greater(UnifyType type, Set<UnifyType> fBounded) {
if(type instanceof FunNType) {
return computeGreaterFunN((FunNType) type, fBounded);
}
Set<UnifyType> result = new HashSet<>();
Set<Pair<UnifyType,Set<UnifyType>>> PairResultFBounded = new HashSet<>();
@ -224,7 +229,7 @@ public class FiniteClosure extends Ordering<UnifyType> implements IFiniteClosure
Set<UnifyType> fBoundedNew = new HashSet<>(fBounded);
fBoundedNew.add(theta1);
Set<UnifyType> 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<UnifyType> implements IFiniteClosure
// System.out.println("");
//}
BinaryOperator<Boolean> 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<UnifyType> res = new HashSet<UnifyType>();
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;

View File

@ -15,9 +15,9 @@ class Matrix extends Vector<Vector<Integer>> {
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++; }