forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Variance distribut korrigiert modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java Fehler im computeCartesianRecursiveOderConstraints beseitigt modified: ../bytecode/javFiles/Matrix.jav
This commit is contained in:
parent
d5d49ad30e
commit
d08708878f
@ -315,17 +315,24 @@ public class JavaTXCompiler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return x;//HIER DIE JEWEILS RECHT BZW. LINKE SEITE AUF GLEICHE VARIANZ SETZEN WIE DIE JEWEILS ANDERE SEITE
|
return x;//HIER DIE JEWEILS RECHT BZW. LINKE SEITE AUF GLEICHE VARIANZ SETZEN WIE DIE JEWEILS ANDERE SEITE
|
||||||
}).map( y -> {
|
});
|
||||||
if ((y.getLhsType() instanceof PlaceholderType) && (y.getRhsType() instanceof PlaceholderType)) {
|
Set<PlaceholderType> varianceTPHold;
|
||||||
if (((PlaceholderType)y.getLhsType()).getVariance() != 0 && ((PlaceholderType)y.getRhsType()).getVariance() == 0) {
|
Set<PlaceholderType> varianceTPH = new HashSet<>();
|
||||||
((PlaceholderType)y.getRhsType()).setVariance(((PlaceholderType)y.getLhsType()).getVariance());
|
do { //PL 2018-11-05 Huellenbildung Variance auf alle TPHs der Terme auf der jeweiligen
|
||||||
}
|
//anderen Seite übertragen
|
||||||
if (((PlaceholderType)y.getLhsType()).getVariance() == 0 && ((PlaceholderType)y.getRhsType()).getVariance() != 0) {
|
varianceTPHold = new HashSet<>(varianceTPH);
|
||||||
((PlaceholderType)y.getLhsType()).setVariance(((PlaceholderType)y.getRhsType()).getVariance());
|
varianceTPH = varianceInheritanceConstraintSet(unifyCons);
|
||||||
}
|
unifyCons.map( y -> {
|
||||||
}
|
if ((y.getLhsType() instanceof PlaceholderType) && (y.getRhsType() instanceof PlaceholderType)) {
|
||||||
return y; } );
|
if (((PlaceholderType)y.getLhsType()).getVariance() != 0 && ((PlaceholderType)y.getRhsType()).getVariance() == 0) {
|
||||||
varianceInheritanceConstraintSet(unifyCons);
|
((PlaceholderType)y.getRhsType()).setVariance(((PlaceholderType)y.getLhsType()).getVariance());
|
||||||
|
}
|
||||||
|
if (((PlaceholderType)y.getLhsType()).getVariance() == 0 && ((PlaceholderType)y.getRhsType()).getVariance() != 0) {
|
||||||
|
((PlaceholderType)y.getLhsType()).setVariance(((PlaceholderType)y.getRhsType()).getVariance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return y; } ); }
|
||||||
|
while (!varianceTPHold.equals(varianceTPH));
|
||||||
//Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure, logFile, log);
|
//Set<Set<UnifyPair>> result = unify.unifySequential(xConsSet, finiteClosure, logFile, log);
|
||||||
//Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
|
//Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
|
||||||
Set<Set<UnifyPair>> result = unify.unifyOderConstraints(unifyCons.getUndConstraints(), unifyCons.getOderConstraints(), finiteClosure, logFile, log);
|
Set<Set<UnifyPair>> result = unify.unifyOderConstraints(unifyCons.getUndConstraints(), unifyCons.getOderConstraints(), finiteClosure, logFile, log);
|
||||||
@ -360,7 +367,7 @@ public class JavaTXCompiler {
|
|||||||
* wenn a eine Variance !=0 hat auf alle Typvariablen in Theta.
|
* wenn a eine Variance !=0 hat auf alle Typvariablen in Theta.
|
||||||
* @param eq The set of constraints
|
* @param eq The set of constraints
|
||||||
*/
|
*/
|
||||||
private void varianceInheritanceConstraintSet(ConstraintSet<UnifyPair> cons) {
|
private Set<PlaceholderType> varianceInheritanceConstraintSet(ConstraintSet<UnifyPair> cons) {
|
||||||
Set<UnifyPair> eq = cons.getAll();
|
Set<UnifyPair> eq = cons.getAll();
|
||||||
Set<PlaceholderType> usedTPH = new HashSet<>();
|
Set<PlaceholderType> usedTPH = new HashSet<>();
|
||||||
Set<PlaceholderType> phSet = eq.stream().map(x -> {
|
Set<PlaceholderType> phSet = eq.stream().map(x -> {
|
||||||
@ -396,6 +403,7 @@ public class JavaTXCompiler {
|
|||||||
//phSetVariance = new ArrayList<>(phSet); macht vermutlich keinen Sinn PL 2018-10-18
|
//phSetVariance = new ArrayList<>(phSet); macht vermutlich keinen Sinn PL 2018-10-18
|
||||||
//phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x)));
|
//phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x)));
|
||||||
}
|
}
|
||||||
|
return usedTPH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -354,6 +354,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
}
|
}
|
||||||
/* auskommentiert um alle Max und min Betrachtung auszuschalten ENDE */
|
/* auskommentiert um alle Max und min Betrachtung auszuschalten ENDE */
|
||||||
|
|
||||||
|
/* PL 2018-11-05 wird falsch weil es auf der obersten Ebene ist.
|
||||||
if (isUndefinedPairSetSet(res)) {
|
if (isUndefinedPairSetSet(res)) {
|
||||||
int nofstred= 0;
|
int nofstred= 0;
|
||||||
Set<UnifyPair> abhSubst = res.stream()
|
Set<UnifyPair> abhSubst = res.stream()
|
||||||
@ -406,6 +407,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
writeLog("Number of Backtracking: " + noBacktracking);
|
writeLog("Number of Backtracking: " + noBacktracking);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//if (nextSetasList.size() == 0 && isUndefinedPairSetSet(result) && nextSet.size() > 1) {
|
//if (nextSetasList.size() == 0 && isUndefinedPairSetSet(result) && nextSet.size() > 1) {
|
||||||
// return result;
|
// return result;
|
||||||
//}
|
//}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
//import java.lang.Float;
|
import java.lang.Float;
|
||||||
//import java.lang.Byte;
|
//import java.lang.Byte;
|
||||||
import java.lang.Boolean;
|
//import java.lang.Boolean;
|
||||||
|
|
||||||
public class Matrix extends Vector<Vector<Integer>> {
|
public class Matrix extends Vector<Vector<Integer>> {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user