forked from JavaTX/JavaCompilerCore
modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
auskommentierter Code der nach checkA verschoben wurde geloescht
This commit is contained in:
parent
44ed1d8e8d
commit
a01779d6df
@ -790,7 +790,8 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
synchronized (this) { nextSetasList.remove(nSaL);
|
||||
writeLog("1 RM" + nSaL.toString());
|
||||
}
|
||||
/* PL 2019-03-11 Anfang eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
|
||||
/* PL 2019-03-13 Anfang eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
optAPair = nSaL.stream().filter(x -> (x.getBasePair() != null && x.getBasePair().getPairOp().equals(PairOperator.SMALLERDOT)
|
||||
&& ((x.getBasePair().getLhsType() instanceof PlaceholderType
|
||||
&& x.getLhsType().equals(x.getBasePair().getLhsType()))
|
||||
@ -808,63 +809,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* PL 2019-03-11 Ende eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
|
||||
/* LOESCHEN, WENN KEINE FEHLER AUFTRETEN
|
||||
optAPair = nSaL.stream().filter(x -> (x.getBasePair() != null
|
||||
&& x.getBasePair().getLhsType() instanceof PlaceholderType
|
||||
&& x.getLhsType().equals(x.getBasePair().getLhsType()))).findFirst();
|
||||
if (optAPair.isPresent()) {
|
||||
UnifyPair aPair = optAPair.get();
|
||||
if (aPair.getBasePair().getPairOp().equals(PairOperator.SMALLERDOT)) {
|
||||
//Set<UnifyPair> sameEqSet = elems.stream().map(xx -> xx.iterator().next())
|
||||
// .filter(x -> ((x.getLhsType().equals(aPair.getLhsType()) || x.getRhsType().equals(aPair.getLhsType()))))
|
||||
// .collect(Collectors.toCollection(HashSet::new));
|
||||
//consideredElements.addAll(sameEqSet);
|
||||
Boolean wrong = false;
|
||||
writeLog("optOrigPair: " + optOrigPair + " " + "aPair: " + aPair+ " " + "aPair.basePair(): " + aPair.getBasePair());
|
||||
writeLog("nSaL: " + nSaL + " " + nSaL.iterator().next().getBasePair());
|
||||
for (UnifyPair sameEq : sameEqSet) {
|
||||
//writeLog("x1 Original:\n" + x1.toString());
|
||||
if (sameEq.getLhsType() instanceof PlaceholderType) {
|
||||
//UnifyPair type = a.stream().filter(z -> z.getLhsType().equals(lhsType)).findFirst().get();
|
||||
Set<UnifyPair> localEq = new HashSet<>();
|
||||
Set<UnifyPair> unitedSubst = new HashSet<>(aPair.getSubstitution());
|
||||
unitedSubst.addAll(sameEq.getSubstitution());
|
||||
localEq.add(new UnifyPair(aPair.getRhsType(), sameEq.getRhsType(), sameEq.getPairOp(), unitedSubst, null));
|
||||
Set<Set<UnifyPair>> localRes = unify(localEq, new ArrayList<>(), fc, false, 0, false);
|
||||
if (isUndefinedPairSetSet(localRes)) {
|
||||
if (result.isEmpty() || isUndefinedPairSetSet(result)) {
|
||||
result.addAll(localRes);
|
||||
}
|
||||
wrong = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//UnifyPair type = y.stream().filter(z -> z.getLhsType().equals(lhsType)).findFirst().get();
|
||||
Set<UnifyPair> localEq = new HashSet<>();
|
||||
Set<UnifyPair> unitedSubst = new HashSet<>(aPair.getSubstitution());
|
||||
unitedSubst.addAll(sameEq.getSubstitution());
|
||||
localEq.add(new UnifyPair(sameEq.getLhsType(), aPair.getRhsType(), sameEq.getPairOp(), unitedSubst, null));
|
||||
Set<Set<UnifyPair>> localRes = unify(localEq, new ArrayList<>(), fc, false, 0, false);
|
||||
if (isUndefinedPairSetSet(localRes)) {
|
||||
if (result.isEmpty() || isUndefinedPairSetSet(result)) {
|
||||
result.addAll(localRes);
|
||||
}
|
||||
wrong = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//writeLog("x1 nach Loeschung von " + sameEq.toString()+" :\n" + x1.toString());
|
||||
}
|
||||
if (wrong) {
|
||||
nSaL = null;
|
||||
noShortendElements++;
|
||||
continue;
|
||||
}
|
||||
}}
|
||||
*/
|
||||
/* PL 2019-03-13 Ende eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
|
||||
Set<UnifyPair> newEq = new HashSet<>(eq);
|
||||
Set<Set<UnifyPair>> newElems = new HashSet<>(elems);
|
||||
@ -931,7 +876,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
writeLog("-1 RM" + nSaL.toString());
|
||||
}
|
||||
|
||||
/* PL 2019-03-11 Anfang eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
/* PL 2019-03-13 Anfang eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
optAPair = nSaL.stream().filter(x -> (x.getBasePair() != null && x.getBasePair().getPairOp().equals(PairOperator.SMALLERDOT)
|
||||
&& ((x.getBasePair().getLhsType() instanceof PlaceholderType
|
||||
&& x.getLhsType().equals(x.getBasePair().getLhsType()))
|
||||
@ -949,61 +894,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* PL 2019-03-11 Ende eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
|
||||
/* LOESCHEN, WENN KEINE FEHLER AUFTRETEN
|
||||
optAPair = nSaL.stream().filter(x -> (x.getBasePair() != null
|
||||
&& x.getBasePair().getLhsType() instanceof PlaceholderType
|
||||
&& x.getLhsType().equals(x.getBasePair().getLhsType()))).findFirst();
|
||||
if (optAPair.isPresent()) {
|
||||
UnifyPair aPair = optAPair.get();
|
||||
if (aPair.getBasePair().getPairOp().equals(PairOperator.SMALLERDOT)) {
|
||||
//Set<UnifyPair> sameEqSet = elems.stream().map(xx -> xx.iterator().next())
|
||||
// .filter(x -> ((x.getLhsType().equals(aPair.getLhsType()) || x.getRhsType().equals(aPair.getLhsType()))))
|
||||
// .collect(Collectors.toCollection(HashSet::new));
|
||||
//consideredElements.addAll(sameEqSet);
|
||||
Boolean wrong = false;
|
||||
for (UnifyPair sameEq : sameEqSet) {
|
||||
//writeLog("x1 Original:\n" + x1.toString());
|
||||
if (sameEq.getLhsType() instanceof PlaceholderType) {
|
||||
//UnifyPair type = a.stream().filter(z -> z.getLhsType().equals(lhsType)).findFirst().get();
|
||||
Set<UnifyPair> localEq = new HashSet<>();
|
||||
Set<UnifyPair> unitedSubst = new HashSet<>(aPair.getSubstitution());
|
||||
unitedSubst.addAll(sameEq.getSubstitution());
|
||||
localEq.add(new UnifyPair(aPair.getRhsType(), sameEq.getRhsType(), sameEq.getPairOp(), unitedSubst, null));
|
||||
Set<Set<UnifyPair>> localRes = unify(localEq, new ArrayList<>(), fc, false, 0, false);
|
||||
if (isUndefinedPairSetSet(localRes)) {
|
||||
if (result.isEmpty() || isUndefinedPairSetSet(result)) {
|
||||
result.addAll(localRes);
|
||||
}
|
||||
wrong = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//UnifyPair type = y.stream().filter(z -> z.getLhsType().equals(lhsType)).findFirst().get();
|
||||
Set<UnifyPair> localEq = new HashSet<>();
|
||||
Set<UnifyPair> unitedSubst = new HashSet<>(aPair.getSubstitution());
|
||||
unitedSubst.addAll(sameEq.getSubstitution());
|
||||
localEq.add(new UnifyPair(sameEq.getLhsType(), aPair.getRhsType(), sameEq.getPairOp(), unitedSubst, null));
|
||||
Set<Set<UnifyPair>> localRes = unify(localEq, new ArrayList<>(), fc, false, 0, false);
|
||||
if (isUndefinedPairSetSet(localRes)) {
|
||||
if (result.isEmpty() || isUndefinedPairSetSet(result)) {
|
||||
result.addAll(localRes);
|
||||
}
|
||||
wrong = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//writeLog("x1 nach Loeschung von " + sameEq.toString()+" :\n" + x1.toString());
|
||||
}
|
||||
if (wrong) {
|
||||
nSaL = null;
|
||||
noShortendElements++;
|
||||
continue;
|
||||
}
|
||||
}}
|
||||
*/
|
||||
/* PL 2019-03-13 Ende eingefuegt Vergleich mit anderen Paaren ggf. loeschen */
|
||||
|
||||
Set<UnifyPair> newEq = new HashSet<>(eq);
|
||||
Set<Set<UnifyPair>> newElems = new HashSet<>(elems);
|
||||
|
Loading…
Reference in New Issue
Block a user