modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

Errorrueckgabe auskommentiert
	new file:   src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java
eingecheckt vorher vergessen
	modified:   test/javFiles/Matrix.jav
add und mul aktiviert
This commit is contained in:
Martin Plümicke 2018-03-19 09:38:37 +01:00
parent b0b1426e20
commit 78db0f0177
3 changed files with 28 additions and 4 deletions

View File

@ -160,7 +160,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
writeLog("UndefinedPairs; " + undefinedPairs);
Set<Set<UnifyPair>> 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<Set<Set<UnifyPair>>> {
HashMap<PlaceholderType,PlaceholderType> hm = tqp.getInvolvedPlaceholderTypes().stream()
.reduce(new HashMap<PlaceholderType,PlaceholderType>(),
(x, y)-> { x.put(y,PlaceholderType.freshPlaceholder()); return x; }, combiner);
Optional<Unifier> opt = stdUnify.unify(tqp.accept(new freshPlaceholder(), hm), thetaPrime);
if (!opt.isPresent()) { //tpq muesse freshtv gesetzt werden PL 2018-03-16
Optional<Unifier> opt = stdUnify.unify(
tqp.accept(new freshPlaceholder(), hm), thetaPrime);
if (!opt.isPresent()) { //tqp muesse fresh Typvars gesetzt werden PL 2018-03-16
continue;
}

View File

@ -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<PlaceholderType,PlaceholderType> ht);
public PlaceholderType visit(PlaceholderType phty, HashMap<PlaceholderType,PlaceholderType> ht);
public FunNType visit(FunNType funnty, HashMap<PlaceholderType,PlaceholderType> ht);
public SuperType visit(SuperType suty, HashMap<PlaceholderType,PlaceholderType> ht);
public ExtendsType visit(ExtendsType extty, HashMap<PlaceholderType,PlaceholderType> ht);
}

View File

@ -17,7 +17,7 @@ class Matrix extends Vector<Vector<Integer>> {
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));