diff --git a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java index 5631724b5..ccda31930 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java +++ b/src/de/dhbwstuttgart/typeinference/unify/RuleSet.java @@ -131,7 +131,7 @@ public class RuleSet implements IRuleSet{ if(x instanceof ExtendsType) xFromFc = new ExtendsType(xFromFc); - UnifyType extYFromFc = fc.grArg(xFromFc).stream().filter(t -> t.getName().equals(extY.getName())).filter(t -> t.getTypeParams().arePlaceholders()).findAny().orElse(null); + UnifyType extYFromFc = fc.grArg(xFromFc, new HashSet<>()).stream().filter(t -> t.getName().equals(extY.getName())).filter(t -> t.getTypeParams().arePlaceholders()).findAny().orElse(null); if(extYFromFc == null || extYFromFc.getTypeParams() != xFromFc.getTypeParams()) return Optional.empty(); @@ -183,7 +183,7 @@ public class RuleSet implements IRuleSet{ if(x instanceof SuperType) xFromFc = new SuperType(xFromFc); - UnifyType supYFromFc = fc.grArg(xFromFc).stream().filter(t -> t.getName().equals(supY.getName())).filter(t -> t.getTypeParams().arePlaceholders()).findAny().orElse(null); + UnifyType supYFromFc = fc.grArg(xFromFc, new HashSet<>()).stream().filter(t -> t.getName().equals(supY.getName())).filter(t -> t.getTypeParams().arePlaceholders()).findAny().orElse(null); if(supYFromFc == null || supYFromFc.getTypeParams() != xFromFc.getTypeParams()) return Optional.empty(); @@ -380,7 +380,7 @@ public class RuleSet implements IRuleSet{ if(!(rhsType instanceof ReferenceType) && !(rhsType instanceof PlaceholderType)) return false; - return fc.greater(lhsType).contains(rhsType); + return fc.greater(lhsType, new HashSet<>()).contains(rhsType); } @Override @@ -391,7 +391,7 @@ public class RuleSet implements IRuleSet{ UnifyType lhsType = pair.getLhsType(); UnifyType rhsType = pair.getRhsType(); - return fc.grArg(lhsType).contains(rhsType); + return fc.grArg(lhsType, new HashSet<>()).contains(rhsType); } @Override @@ -497,7 +497,7 @@ public class RuleSet implements IRuleSet{ if(typeDgen == null) return Optional.empty(); - Set grArg = fc.grArg(typeDgen); + Set grArg = fc.grArg(typeDgen, new HashSet<>()); Optional opt = grArg.stream().filter(x -> x.getName().equals(typeExtDs.getName())).findAny(); @@ -543,7 +543,7 @@ public class RuleSet implements IRuleSet{ // Use of smArg instead of grArg because // a in grArg(b) => b in smArg(a) - Set smArg = fc.smArg(typeSupDgen); + Set smArg = fc.smArg(typeSupDgen, new HashSet<>()); opt = smArg.stream().filter(x -> x.getName().equals(typeDs.getName())).findAny(); if(!opt.isPresent()) diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 1d5ca5647..5e6b2ab40 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -944,7 +944,7 @@ public class TypeUnifyTask extends RecursiveTask>> { for(UnifyType c : csPHRenamed) { //PL 18-02-05 getChildren durch smaller ersetzt in getChildren werden die Varianlen nicht ersetzt. - Set thetaQs = fc.smaller(c).stream().collect(Collectors.toCollection(HashSet::new)); + Set thetaQs = fc.smaller(c, new HashSet<>()).stream().collect(Collectors.toCollection(HashSet::new)); //Set thetaQs = fc.getChildren(c).stream().collect(Collectors.toCollection(HashSet::new)); //thetaQs.add(thetaPrime); //PL 18-02-05 wieder geloescht //PL 2017-10-03: War auskommentiert habe ich wieder einkommentiert, @@ -962,7 +962,7 @@ public class TypeUnifyTask extends RecursiveTask>> { ArrayList> candidateParams = new ArrayList<>(); for(UnifyType param : cParams) - candidateParams.add(fc.grArg(param)); + candidateParams.add(fc.grArg(param, new HashSet<>())); for(TypeParams tp : permuteParams(candidateParams)) thetaQPrimes.add(c.setTypeParams(tp)); @@ -985,7 +985,7 @@ public class TypeUnifyTask extends RecursiveTask>> { } //List freshTphs = new ArrayList<>(); PL 18-02-06 in die For-Schleife verschoben for (UnifyType tq : thetaQs) { - Set smaller = fc.smaller(unifier.apply(tq)); + Set smaller = fc.smaller(unifier.apply(tq), new HashSet<>()); //eingefuegt PL 2018-03-29 Anfang ? ext. theta hinzufuegen if (a.isWildcardable()) { Set smaller_ext = smaller.stream().filter(x -> !(x instanceof ExtendsType) && !(x instanceof SuperType)) @@ -1106,7 +1106,7 @@ public class TypeUnifyTask extends RecursiveTask>> { break; } - for(UnifyType thetaS : fc.greater(theta)) { + for(UnifyType thetaS : fc.greater(theta, new HashSet<>())) { Set resultPrime = new HashSet<>(); UnifyType[] freshTphs = new UnifyType[thetaS.getTypeParams().size()]; diff --git a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java b/src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java index e97a40e86..3e20f4332 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java +++ b/src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java @@ -21,42 +21,42 @@ public interface IFiniteClosure { * Returns all types of the finite closure that are subtypes of the argument. * @return The set of subtypes of the argument. */ - public Set smaller(UnifyType type); + public Set smaller(UnifyType type, Set fBounded); /** * Returns all types of the finite closure that are supertypes of the argument. * @return The set of supertypes of the argument. */ - public Set greater(UnifyType type); + public Set greater(UnifyType type, Set fBounded); /** * Wo passt Type rein? * @param type * @return */ - public Set grArg(UnifyType type); + public Set grArg(UnifyType type, Set fBounded); /** * Was passt in Type rein? * @param type * @return */ - public Set smArg(UnifyType type); + public Set smArg(UnifyType type, Set fBounded); - public Set grArg(ReferenceType type); - public Set smArg(ReferenceType type); + public Set grArg(ReferenceType type, Set fBounded); + public Set smArg(ReferenceType type, Set fBounded); - public Set grArg(ExtendsType type); - public Set smArg(ExtendsType type); + public Set grArg(ExtendsType type, Set fBounded); + public Set smArg(ExtendsType type, Set fBounded); - public Set grArg(SuperType type); - public Set smArg(SuperType type); + public Set grArg(SuperType type, Set fBounded); + public Set smArg(SuperType type, Set fBounded); - public Set grArg(PlaceholderType type); - public Set smArg(PlaceholderType type); + public Set grArg(PlaceholderType type, Set fBounded); + public Set smArg(PlaceholderType type, Set fBounded); - public Set grArg(FunNType type); - public Set smArg(FunNType type); + public Set grArg(FunNType type, Set fBounded); + public Set smArg(FunNType type, Set fBounded); public Optional getLeftHandedType(String typeName); public Set getAncestors(UnifyType t); diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java b/src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java index 6c44d2ec6..e9b805c1c 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java @@ -47,13 +47,13 @@ public final class ExtendsType extends WildcardType { } @Override - Set smArg(IFiniteClosure fc) { - return fc.smArg(this); + Set smArg(IFiniteClosure fc, Set fBounded) { + return fc.smArg(this, fBounded); } @Override - Set grArg(IFiniteClosure fc) { - return fc.grArg(this); + Set grArg(IFiniteClosure fc, Set fBounded) { + return fc.grArg(this, fBounded); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java index b45309b84..4ab443e53 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java @@ -4,8 +4,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.Hashtable; import java.util.Optional; import java.util.Set; +import java.util.function.BiFunction; +import java.util.function.BinaryOperator; import java.util.stream.Collectors; import com.google.common.collect.Ordering; @@ -92,36 +95,43 @@ public class FiniteClosure extends Ordering implements IFiniteClosure * @return The set of subtypes of the argument. */ @Override - public Set smaller(UnifyType type) { + public Set smaller(UnifyType type, Set fBounded) { if(type instanceof FunNType) - return computeSmallerFunN((FunNType) type); + return computeSmallerFunN((FunNType) type, fBounded); - Set ts = new HashSet<>(); - ts.add(type); + Set>> ts = new HashSet<>(); + ts.add(new Pair<>(type, fBounded)); return computeSmaller(ts); } /** * Computes the smaller functions for every type except FunNTypes. */ - private Set computeSmaller(Set types) { - HashSet result = new HashSet<>(); + private Set computeSmaller(Set>> types) { + Set>> result = new HashSet<>(); //PL 18-02-05 Unifier durch Matcher ersetzt //IUnify unify = new MartelliMontanariUnify(); Match match = new Match(); - for(UnifyType t : types) { + for(Pair> pt : types) { + UnifyType t = pt.getKey(); + Set fBounded = pt.getValue().get(); // if T = T' then T <* T' - result.add(t); + try { + result.add(new Pair<>(t, fBounded)); + } + catch (StackOverflowError e) { + System.out.println(""); + } // if C<...> <* C<...> then ... (third case in definition of <*) if(t.getTypeParams().size() > 0) { ArrayList> paramCandidates = new ArrayList<>(); for (int i = 0; i < t.getTypeParams().size(); i++) - paramCandidates.add(smArg(t.getTypeParams().get(i))); - permuteParams(paramCandidates).forEach(x -> result.add(t.setTypeParams(x))); + paramCandidates.add(smArg(t.getTypeParams().get(i), fBounded)); + permuteParams(paramCandidates).forEach(x -> result.add(new Pair<>(t.setTypeParams(x), fBounded))); } if(!strInheritanceGraph.containsKey(t.getName())) @@ -147,19 +157,21 @@ public class FiniteClosure extends Ordering implements IFiniteClosure Set theta1Set = candidate.getContentOfDescendants(); for(UnifyType theta1 : theta1Set) - result.add(theta1.apply(sigma)); + result.add(new Pair<>(theta1.apply(sigma), fBounded)); } } - if(result.equals(types)) - return result; + HashSet resut = result.stream().map(x -> x.getKey()).collect(Collectors.toCollection(HashSet::new)); + System.out.println(resut); + if(resut.equals(types.stream().map(x -> x.getKey()).collect(Collectors.toCollection(HashSet::new)))) + return resut; return computeSmaller(result); } /** * Computes the smaller-Function for FunNTypes. */ - private Set computeSmallerFunN(FunNType type) { + private Set computeSmallerFunN(FunNType type, Set fBounded) { Set result = new HashSet<>(); // if T = T' then T <=* T' @@ -168,9 +180,9 @@ public class FiniteClosure extends Ordering implements IFiniteClosure // Because real function types are implicitly variant // it is enough to permute the params with the values of greater / smaller. ArrayList> paramCandidates = new ArrayList<>(); - paramCandidates.add(smaller(type.getTypeParams().get(0))); + paramCandidates.add(smaller(type.getTypeParams().get(0), fBounded)); for (int i = 1; i < type.getTypeParams().size(); i++) - paramCandidates.add(greater(type.getTypeParams().get(i))); + paramCandidates.add(greater(type.getTypeParams().get(i), new HashSet<>())); permuteParams(paramCandidates).forEach(x -> result.add(type.setTypeParams(x))); return result; @@ -181,36 +193,51 @@ public class FiniteClosure extends Ordering implements IFiniteClosure * @return The set of supertypes of the argument. */ @Override - public Set greater(UnifyType type) { + public Set greater(UnifyType type, Set fBounded) { if(type instanceof FunNType) - return computeGreaterFunN((FunNType) type); + return computeGreaterFunN((FunNType) type, fBounded); - Set ts = new HashSet<>(); - ts.add(type); + Set>> ts = new HashSet<>(); + ts.add(new Pair<>(type, fBounded)); return computeGreater(ts); } /** * Computes the greater function for all types except function types. */ - protected Set computeGreater(Set types) { - HashSet result = new HashSet<>(); + protected Set computeGreater(Set>> types) { + Set>> result = new HashSet<>(); //PL 18-04-05 Unifier durch Matcher ersetzt //IUnify unify = new MartelliMontanariUnify(); Match match = new Match(); - for(UnifyType t : types) { - + for(Pair> pt : types) { + UnifyType t = pt.getKey(); + Set fBounded = pt.getValue().get(); // if T = T' then T <=* T' - result.add(t); + result.add(pt); // if C<...> <* C<...> then ... (third case in definition of <*) if(t.getTypeParams().size() > 0) { ArrayList> paramCandidates = new ArrayList<>(); - for (int i = 0; i < t.getTypeParams().size(); i++) - paramCandidates.add(grArg(t.getTypeParams().get(i))); - permuteParams(paramCandidates).forEach(x -> result.add(t.setTypeParams(x))); + for (int i = 0; i < t.getTypeParams().size(); i++) { + UnifyType parai = t.getTypeParams().get(i); + int i_ef = i; + BiFunction f = (x,y) -> + { + ArrayList termList = new ArrayList(); + termList.add(new UnifyPair(y,t.getTypeParams().get(i_ef), PairOperator.EQUALSDOT)); + return ((match.match(termList).isPresent()) || x); + }; + if (parai.getName().equals("java.lang.Integer")) { + System.out.println(""); + } + BinaryOperator bo = (a,b) -> (a || b); + if (fBounded.stream().reduce(false,f,bo)) continue; //F-Bounded Endlosrekursion + paramCandidates.add(grArg(t.getTypeParams().get(i), new HashSet<>(fBounded) )); + } + permuteParams(paramCandidates).forEach(x -> result.add(new Pair<>(t.setTypeParams(x), new HashSet<>(fBounded)))); } if(!strInheritanceGraph.containsKey(t.getName())) @@ -220,6 +247,7 @@ public class FiniteClosure extends Ordering implements IFiniteClosure Set> candidates = strInheritanceGraph.get(t.getName()); for(Node candidate : candidates) { UnifyType theta1 = candidate.getContent(); + //PL 18-04-05 Unifier durch Matcher ersetzt ANFANG ArrayList termList= new ArrayList(); termList.add(new UnifyPair(theta1,t, PairOperator.EQUALSDOT)); @@ -231,23 +259,27 @@ public class FiniteClosure extends Ordering implements IFiniteClosure Unifier sigma = optSigma.get(); sigma.swapPlaceholderSubstitutionsReverse(theta1.getTypeParams()); + Set fBoundedNew = new HashSet<>(fBounded); + fBoundedNew.add(theta1); Set theta2Set = candidate.getContentOfPredecessors(); for(UnifyType theta2 : theta2Set) - result.add(theta2.apply(sigma)); + result.add(new Pair<>(theta2.apply(sigma), fBoundedNew)); } } - if(result.equals(types)) - return result; + HashSet resut = result.stream().map(x -> x.getKey()).collect(Collectors.toCollection(HashSet::new)); + System.out.println(resut); + if(resut.equals(types.stream().map(x -> x.getKey()).collect(Collectors.toCollection(HashSet::new)))) + return resut; return computeGreater(result); } /** * Computes the greater function for FunN-Types */ - protected Set computeGreaterFunN(FunNType type) { + protected Set computeGreaterFunN(FunNType type, Set fBounded) { Set result = new HashSet<>(); // if T = T' then T <=* T' @@ -256,88 +288,88 @@ public class FiniteClosure extends Ordering implements IFiniteClosure // Because real function types are implicitly variant // it is enough to permute the params with the values of greater / smaller. ArrayList> paramCandidates = new ArrayList<>(); - paramCandidates.add(greater(type.getTypeParams().get(0))); + paramCandidates.add(greater(type.getTypeParams().get(0), new HashSet<>())); for (int i = 1; i < type.getTypeParams().size(); i++) - paramCandidates.add(smaller(type.getTypeParams().get(i))); + paramCandidates.add(smaller(type.getTypeParams().get(i), fBounded)); permuteParams(paramCandidates).forEach(x -> result.add(type.setTypeParams(x))); return result; } @Override - public Set grArg(UnifyType type) { - return type.grArg(this); + public Set grArg(UnifyType type, Set fBounded) { + return type.grArg(this, fBounded); } @Override - public Set grArg(ReferenceType type) { + public Set grArg(ReferenceType type, Set fBounded) { Set result = new HashSet(); result.add(type); - smaller(type).forEach(x -> result.add(new SuperType(x))); - greater(type).forEach(x -> result.add(new ExtendsType(x))); + smaller(type, fBounded).forEach(x -> result.add(new SuperType(x))); + greater(type,fBounded).forEach(x -> result.add(new ExtendsType(x))); return result; } @Override - public Set grArg(FunNType type) { + public Set grArg(FunNType type, Set fBounded) { Set result = new HashSet(); result.add(type); - smaller(type).forEach(x -> result.add(new SuperType(x))); - greater(type).forEach(x -> result.add(new ExtendsType(x))); + smaller(type, fBounded).forEach(x -> result.add(new SuperType(x))); + greater(type, fBounded).forEach(x -> result.add(new ExtendsType(x))); return result; } @Override - public Set grArg(ExtendsType type) { + public Set grArg(ExtendsType type, Set fBounded) { Set result = new HashSet(); result.add(type); UnifyType t = type.getExtendedType(); - greater(t).forEach(x -> result.add(new ExtendsType(x))); + greater(t, fBounded).forEach(x -> result.add(new ExtendsType(x))); return result; } @Override - public Set grArg(SuperType type) { + public Set grArg(SuperType type, Set fBounded) { Set result = new HashSet(); result.add(type); UnifyType t = type.getSuperedType(); - smaller(t).forEach(x -> result.add(new SuperType(x))); + smaller(t, fBounded).forEach(x -> result.add(new SuperType(x))); return result; } @Override - public Set grArg(PlaceholderType type) { + public Set grArg(PlaceholderType type, Set fBounded) { HashSet result = new HashSet<>(); result.add(type); return result; } @Override - public Set smArg(UnifyType type) { - return type.smArg(this); + public Set smArg(UnifyType type, Set fBounded) { + return type.smArg(this, fBounded); } @Override - public Set smArg(ReferenceType type) { + public Set smArg(ReferenceType type, Set fBounded) { Set result = new HashSet(); result.add(type); return result; } @Override - public Set smArg(FunNType type) { + public Set smArg(FunNType type, Set fBounded) { Set result = new HashSet(); result.add(type); return result; } @Override - public Set smArg(ExtendsType type) { + public Set smArg(ExtendsType type, Set fBounded) { Set result = new HashSet(); result.add(type); UnifyType t = type.getExtendedType(); result.add(t); - smaller(t).forEach(x -> { + smaller(t, fBounded).forEach(x -> { result.add(new ExtendsType(x)); result.add(x); }); @@ -346,12 +378,13 @@ public class FiniteClosure extends Ordering implements IFiniteClosure @Override - public Set smArg(SuperType type) { + public Set smArg(SuperType type, Set fBounded) { Set result = new HashSet(); result.add(type); UnifyType t = type.getSuperedType(); result.add(t); - greater(t).forEach(x -> { +//*** ACHTUNG das koennte FALSCH sein PL 2018-05-23 evtl. HashSet durch smArg durchschleifen + greater(t, fBounded).forEach(x -> { result.add(new SuperType(x)); result.add(x); }); @@ -359,7 +392,7 @@ public class FiniteClosure extends Ordering implements IFiniteClosure } @Override - public Set smArg(PlaceholderType type) { + public Set smArg(PlaceholderType type, Set fBounded) { HashSet result = new HashSet<>(); result.add(type); return result; diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java b/src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java index 95275a124..3e9f2ae66 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java @@ -55,13 +55,13 @@ public class FunNType extends UnifyType { } @Override - Set smArg(IFiniteClosure fc) { - return fc.smArg(this); + Set smArg(IFiniteClosure fc, Set fBounded) { + return fc.smArg(this, fBounded); } @Override - Set grArg(IFiniteClosure fc) { - return fc.grArg(this); + Set grArg(IFiniteClosure fc, Set fBounded) { + return fc.grArg(this, fBounded); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java b/src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java index bbd3b3e13..ef41de65d 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java @@ -113,13 +113,13 @@ public final class PlaceholderType extends UnifyType{ } @Override - Set smArg(IFiniteClosure fc) { - return fc.smArg(this); + Set smArg(IFiniteClosure fc, Set fBounded) { + return fc.smArg(this, fBounded); } @Override - Set grArg(IFiniteClosure fc) { - return fc.grArg(this); + Set grArg(IFiniteClosure fc, Set fBounded) { + return fc.grArg(this, fBounded); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java b/src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java index 81f6c3b34..5b17538e0 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java @@ -34,13 +34,13 @@ public final class ReferenceType extends UnifyType { } @Override - Set smArg(IFiniteClosure fc) { - return fc.smArg(this); + Set smArg(IFiniteClosure fc, Set fBounded) { + return fc.smArg(this, fBounded); } @Override - Set grArg(IFiniteClosure fc) { - return fc.grArg(this); + Set grArg(IFiniteClosure fc, Set fBounded) { + return fc.grArg(this, fBounded); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java b/src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java index 53762f868..fa5199959 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java @@ -48,13 +48,13 @@ public final class SuperType extends WildcardType { } @Override - Set smArg(IFiniteClosure fc) { - return fc.smArg(this); + Set smArg(IFiniteClosure fc, Set fBounded) { + return fc.smArg(this, fBounded); } @Override - Set grArg(IFiniteClosure fc) { - return fc.grArg(this); + Set grArg(IFiniteClosure fc, Set fBounded) { + return fc.grArg(this, fBounded); } @Override diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java index 715d9880a..bb7bc1c6c 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java @@ -68,7 +68,7 @@ public abstract class UnifyType { * @param fc The FC that is called. * @return The set that is smArg(this) */ - abstract Set smArg(IFiniteClosure fc); + abstract Set smArg(IFiniteClosure fc, Set fBounded); /** * Implementation of the visitor-pattern. Returns the set of grArg @@ -76,7 +76,7 @@ public abstract class UnifyType { * @param fc The FC that is called. * @return The set that is grArg(this) */ - abstract Set grArg(IFiniteClosure fc); + abstract Set grArg(IFiniteClosure fc, Set fBounded); /** * Applies a unifier to this object. diff --git a/test/javFiles/Matrix.jav b/test/javFiles/Matrix.jav index 8b01c235b..18120deb1 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++; }