modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java Reihenfolge geaendert, so dass bei Variance 1 (x <. theta) vorne und bei Variance -1 (theta <. x) vorne
This commit is contained in:
parent
8bdb7e7b13
commit
577faa88af
@ -73,7 +73,7 @@ public class JavaTXCompiler {
|
|||||||
|
|
||||||
public static JavaTXCompiler INSTANCE;
|
public static JavaTXCompiler INSTANCE;
|
||||||
final CompilationEnvironment environment;
|
final CompilationEnvironment environment;
|
||||||
Boolean resultmodel = false;
|
Boolean resultmodel = true;
|
||||||
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
|
public final Map<File, SourceFile> sourceFiles = new HashMap<>();
|
||||||
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+"src/test/java/logFiles" geschrieben werden soll?
|
Boolean log = true; //gibt an ob ein Log-File nach System.getProperty("user.dir")+"src/test/java/logFiles" geschrieben werden soll?
|
||||||
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
|
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
|
||||||
|
@ -696,7 +696,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
List<Set<UnifyPair>> nextSetasListRest = new ArrayList<>();
|
List<Set<UnifyPair>> nextSetasListRest = new ArrayList<>();
|
||||||
//List<Set<UnifyPair>> nextSetasListRestMin = new ArrayList<>();
|
//List<Set<UnifyPair>> nextSetasListRestMin = new ArrayList<>();
|
||||||
//List<Set<UnifyPair>> nextSetasListRestOder = new ArrayList<>();
|
//List<Set<UnifyPair>> nextSetasListRestOder = new ArrayList<>();
|
||||||
writeLog("WhileAnfangNextSet: " + nextSet.toString());
|
writeLog("qextSet: " + nextSet.toString());
|
||||||
writeLog("WhileAnfangNextSetasList: " + nextSetasList.toString());
|
writeLog("WhileAnfangNextSetasList: " + nextSetasList.toString());
|
||||||
if (variance == 1) {
|
if (variance == 1) {
|
||||||
a = oup.max(nextSetasList.iterator());
|
a = oup.max(nextSetasList.iterator());
|
||||||
@ -1824,21 +1824,43 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
Iterator<UnifyPair> eq2sprimeit = eq2sprime.iterator();
|
Iterator<UnifyPair> eq2sprimeit = eq2sprime.iterator();
|
||||||
ArrayList<UnifyPair> eq2sAsListFst = new ArrayList<>();
|
ArrayList<UnifyPair> eq2sAsListFst = new ArrayList<>();
|
||||||
ArrayList<UnifyPair> eq2sAsListSnd = new ArrayList<>();
|
ArrayList<UnifyPair> eq2sAsListSnd = new ArrayList<>();
|
||||||
|
ArrayList<UnifyPair> eq2sAsListThird = new ArrayList<>();
|
||||||
|
ArrayList<UnifyPair> eq2sAsListFourth = new ArrayList<>();
|
||||||
ArrayList<UnifyPair> eq2sAsListBack = new ArrayList<>();
|
ArrayList<UnifyPair> eq2sAsListBack = new ArrayList<>();
|
||||||
ArrayList<UnifyPair> eq2sAsList = new ArrayList<>();
|
ArrayList<UnifyPair> eq2sAsList = new ArrayList<>();
|
||||||
Boolean first = true;
|
Boolean first = true;
|
||||||
while(eq2sprimeit.hasNext()) {// alle mit Variance != 0 nach vorne schieben
|
while(eq2sprimeit.hasNext()) {// alle mit Variance != 0 nach vorne schieben
|
||||||
UnifyPair up = eq2sprimeit.next();
|
UnifyPair up = eq2sprimeit.next();
|
||||||
if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).getVariance() != 0 && !((PlaceholderType)up.getLhsType()).isInnerType())
|
if ((up.getLhsType() instanceof PlaceholderType &&
|
||||||
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).getVariance() != 0) && !((PlaceholderType)up.getRhsType()).isInnerType()) {
|
((PlaceholderType)up.getLhsType()).getVariance() == 1 &&
|
||||||
|
!((PlaceholderType)up.getLhsType()).isInnerType()) ||
|
||||||
|
(up.getRhsType() instanceof PlaceholderType &&
|
||||||
|
((PlaceholderType)up.getRhsType()).getVariance() == -1) &&
|
||||||
|
!((PlaceholderType)up.getRhsType()).isInnerType())
|
||||||
|
{
|
||||||
eq2sAsListFst.add(up);
|
eq2sAsListFst.add(up);
|
||||||
eq2s.remove(up);
|
eq2s.remove(up);
|
||||||
}
|
}
|
||||||
else if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).getVariance() != 0 && ((PlaceholderType)up.getLhsType()).isInnerType())
|
else if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).getVariance() == 1 && ((PlaceholderType)up.getLhsType()).isInnerType())
|
||||||
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).getVariance() != 0) && ((PlaceholderType)up.getRhsType()).isInnerType()) {
|
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).getVariance() == -1) && ((PlaceholderType)up.getRhsType()).isInnerType()) {
|
||||||
eq2sAsListSnd.add(up);
|
eq2sAsListSnd.add(up);
|
||||||
eq2s.remove(up);
|
eq2s.remove(up);
|
||||||
}
|
}
|
||||||
|
else if ((up.getLhsType() instanceof PlaceholderType &&
|
||||||
|
((PlaceholderType)up.getLhsType()).getVariance() == -1 &&
|
||||||
|
!((PlaceholderType)up.getLhsType()).isInnerType()) ||
|
||||||
|
(up.getRhsType() instanceof PlaceholderType &&
|
||||||
|
((PlaceholderType)up.getRhsType()).getVariance() == -1) &&
|
||||||
|
!((PlaceholderType)up.getRhsType()).isInnerType())
|
||||||
|
{
|
||||||
|
eq2sAsListThird.add(up);
|
||||||
|
eq2s.remove(up);
|
||||||
|
}
|
||||||
|
else if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).getVariance() == -1 && ((PlaceholderType)up.getLhsType()).isInnerType())
|
||||||
|
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).getVariance() == 1) && ((PlaceholderType)up.getRhsType()).isInnerType()) {
|
||||||
|
eq2sAsListFourth.add(up);
|
||||||
|
eq2s.remove(up);
|
||||||
|
}
|
||||||
else if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).isInnerType())
|
else if ((up.getLhsType() instanceof PlaceholderType && ((PlaceholderType)up.getLhsType()).isInnerType())
|
||||||
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).isInnerType())) {
|
|| (up.getRhsType() instanceof PlaceholderType && ((PlaceholderType)up.getRhsType()).isInnerType())) {
|
||||||
eq2sAsListBack.add(up);
|
eq2sAsListBack.add(up);
|
||||||
@ -1876,6 +1898,8 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
eq2sAsList.addAll(eq2sAsListFst);
|
eq2sAsList.addAll(eq2sAsListFst);
|
||||||
eq2sAsList.addAll(eq2sAsListSnd);
|
eq2sAsList.addAll(eq2sAsListSnd);
|
||||||
|
eq2sAsList.addAll(eq2sAsListThird);
|
||||||
|
eq2sAsList.addAll(eq2sAsListFourth);
|
||||||
eq2sAsList.addAll(eq2s);
|
eq2sAsList.addAll(eq2s);
|
||||||
eq2sAsList.addAll(eq2sAsListBack);
|
eq2sAsList.addAll(eq2sAsListBack);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user