diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 6eb74d167..cd7288e8d 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -160,7 +160,7 @@ public class TypeUnifyTask extends RecursiveTask>> { writeLog("UndefinedPairs; " + undefinedPairs); Set> error = new HashSet<>(); undefinedPairs = undefinedPairs.stream().map(x -> { x.setUndefinedPair(); return x;}).collect(Collectors.toCollection(HashSet::new)); - error.add(undefinedPairs); + //error.add(undefinedPairs); return error; } @@ -755,8 +755,9 @@ public class TypeUnifyTask extends RecursiveTask>> { HashMap hm = tqp.getInvolvedPlaceholderTypes().stream() .reduce(new HashMap(), (x, y)-> { x.put(y,PlaceholderType.freshPlaceholder()); return x; }, combiner); - Optional opt = stdUnify.unify(tqp.accept(new freshPlaceholder(), hm), thetaPrime); - if (!opt.isPresent()) { //tpq muesse freshtv gesetzt werden PL 2018-03-16 + Optional opt = stdUnify.unify( + tqp.accept(new freshPlaceholder(), hm), thetaPrime); + if (!opt.isPresent()) { //tqp muesse fresh Typvars gesetzt werden PL 2018-03-16 continue; } diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java b/src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java new file mode 100644 index 000000000..bf435f9ca --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java @@ -0,0 +1,23 @@ +package de.dhbwstuttgart.typeinference.unify.interfaces; + +import java.util.HashMap; + +import de.dhbwstuttgart.typeinference.unify.model.ExtendsType; +import de.dhbwstuttgart.typeinference.unify.model.FunNType; +import de.dhbwstuttgart.typeinference.unify.model.PlaceholderType; +import de.dhbwstuttgart.typeinference.unify.model.ReferenceType; +import de.dhbwstuttgart.typeinference.unify.model.SuperType; + +public interface UnifyTypeVisitor { + + public ReferenceType visit(ReferenceType refty, HashMap ht); + + public PlaceholderType visit(PlaceholderType phty, HashMap ht); + + public FunNType visit(FunNType funnty, HashMap ht); + + public SuperType visit(SuperType suty, HashMap ht); + + public ExtendsType visit(ExtendsType extty, HashMap ht); + +} diff --git a/test/javFiles/Matrix.jav b/test/javFiles/Matrix.jav index a680370f4..ec3fdb93a 100644 --- a/test/javFiles/Matrix.jav +++ b/test/javFiles/Matrix.jav @@ -17,7 +17,7 @@ class Matrix extends Vector> { var k = 0; while(k < v1.size()) { //erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); - erg = add1(erg, mul1(v1.elementAt(k), + erg = add(erg, mul1(v1.elementAt(k), m.elementAt(k).elementAt(j))); k++; } v2.addElement(new Integer(erg));