From 117106a7b35f391b0ae90891feb543638f877272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Sun, 1 Apr 2018 17:07:58 +0200 Subject: [PATCH] modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java ? ext theta bei smaller eingefuegt modified: src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java basiPair und Subsitution nur noch gefuegt, wen wirk etwas eingesetzt wurde modified: src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java unifier umbenannt in substitution getBasePair und getSubsitutuon eingefuegt --- .../typeinference/unify/TypeUnifyTask.java | 12 +++++++++++- .../typeinference/unify/model/Unifier.java | 7 ++++++- .../typeinference/unify/model/UnifyPair.java | 16 +++++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 2c2ca6b2..81c6da3a 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -315,7 +315,7 @@ public class TypeUnifyTask extends RecursiveTask>> { List> nextSetasList =new ArrayList<>(nextSet); try { //List> - nextSetasList = oup.sortedCopy(nextSet);//new ArrayList<>(nextSet); + //nextSetasList = oup.sortedCopy(nextSet);//new ArrayList<>(nextSet); } catch (java.lang.IllegalArgumentException e) { System.out.print(""); @@ -815,6 +815,16 @@ 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)); + //eingefuegt PL 2018-03-29 Anfang ? ext. theta hinzufuegen + Set smaller_ext = smaller.stream() + .map(x -> { + BinaryOperator> combiner = (aa,b) -> { aa.putAll(b); return aa;}; + HashMap hm = x.getInvolvedPlaceholderTypes().stream() + .reduce(new HashMap(), + (aa, b)-> { aa.put(b,PlaceholderType.freshPlaceholder()); return aa; }, combiner); + return new ExtendsType (x.accept(new freshPlaceholder(), hm));}).collect(Collectors.toCollection(HashSet::new)); + smaller.addAll(smaller_ext); + //eingefuegt PL 2018-03-29 Ende ? ext. theta hinzufuegen for(UnifyType theta : smaller) { List freshTphs = new ArrayList<>(); Set resultPrime = new HashSet<>(); diff --git a/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java b/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java index 7b32864d..1ee05264 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java +++ b/src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java @@ -63,7 +63,12 @@ public class Unifier implements Function, Iterable