forked from JavaTX/JavaCompilerCore
nicht lauffaehig
This commit is contained in:
parent
2d5c863008
commit
1f269918fb
@ -103,7 +103,7 @@ public class JavaTXCompiler {
|
|||||||
System.out.println(xConsSet);
|
System.out.println(xConsSet);
|
||||||
Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
|
Set<Set<UnifyPair>> result = unify.unify(xConsSet, finiteClosure);
|
||||||
System.out.println("RESULT: " + result.size());
|
System.out.println("RESULT: " + result.size());
|
||||||
//results.addAll(result);
|
results.addAll(result);
|
||||||
}
|
}
|
||||||
return results.stream().map((unifyPairs ->
|
return results.stream().map((unifyPairs ->
|
||||||
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
|
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
|
||||||
|
@ -156,15 +156,17 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
topLevelSets.add(flat);
|
topLevelSets.add(flat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Set<Set<UnifyPair>> setToFlatten = topLevelSets.stream().map(x -> x.iterator().next()).collect(Collectors.toCollection(HashSet::new));
|
||||||
// Cartesian product over all (up to 10) top level sets
|
// Cartesian product over all (up to 10) top level sets
|
||||||
Set<Set<Set<UnifyPair>>> eqPrimeSet = setOps.cartesianProduct(topLevelSets)
|
//Set<Set<Set<UnifyPair>>> eqPrimeSet = setOps.cartesianProduct(topLevelSets)
|
||||||
.stream().map(x -> new HashSet<>(x))
|
//.stream().map(x -> new HashSet<>(x))
|
||||||
.collect(Collectors.toCollection(HashSet::new));
|
//.collect(Collectors.toCollection(HashSet::new));
|
||||||
|
|
||||||
Set<Set<UnifyPair>> eqPrimePrimeSet = new HashSet<>();
|
Set<Set<UnifyPair>> eqPrimePrimeSet = new HashSet<>();
|
||||||
|
|
||||||
Set<TypeUnifyTask> forks = new HashSet<>();
|
Set<TypeUnifyTask> forks = new HashSet<>();
|
||||||
for(Set<Set<UnifyPair>> setToFlatten : eqPrimeSet) {
|
//for(Set<Set<UnifyPair>> setToFlatten : eqPrimeSet) {
|
||||||
// Flatten the cartesian product
|
// Flatten the cartesian product
|
||||||
Set<UnifyPair> eqPrime = new HashSet<>();
|
Set<UnifyPair> eqPrime = new HashSet<>();
|
||||||
setToFlatten.stream().forEach(x -> eqPrime.addAll(x));
|
setToFlatten.stream().forEach(x -> eqPrime.addAll(x));
|
||||||
@ -208,7 +210,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
else
|
else
|
||||||
eqPrimePrimeSet.addAll(unify(eqPrime, fc, false));
|
eqPrimePrimeSet.addAll(unify(eqPrime, fc, false));
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 6 b) Build the union over everything.
|
* Step 6 b) Build the union over everything.
|
||||||
|
10
test/javFiles/FC_Matrix.jav
Normal file
10
test/javFiles/FC_Matrix.jav
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
|
class Matrix extends Vector<Vector<Integer>> {
|
||||||
|
|
||||||
|
methode(m) {
|
||||||
|
m.add(1);
|
||||||
|
Matrix i;
|
||||||
|
methode(i);
|
||||||
|
}
|
||||||
|
}
|
@ -6,21 +6,21 @@ class Matrix extends Vector<Vector<Integer>> {
|
|||||||
mul(m) {
|
mul(m) {
|
||||||
var ret = new Matrix();
|
var ret = new Matrix();
|
||||||
var i = 0;
|
var i = 0;
|
||||||
//while(i < size()) {
|
while(i < size()) {
|
||||||
var v1 = this.elementAt(i);
|
var v1 = this.elementAt(i);
|
||||||
//var v2 = new Vector<Integer>();
|
var v2 = new Vector<Integer>();
|
||||||
//var j = 0;
|
var j = 0;
|
||||||
//while(j < v1.size()) {
|
while(j < v1.size()) {
|
||||||
//var erg = 0;
|
var erg = 0;
|
||||||
//var k = 0;
|
var k = 0;
|
||||||
//while(k < v1.size()) {
|
while(k < v1.size()) {
|
||||||
//erg = erg + v1.elementAt(k)
|
erg = erg + v1.elementAt(k)
|
||||||
// * m.elementAt(k).elementAt(j);
|
* m.elementAt(k).elementAt(j);
|
||||||
//k++; }
|
k++; }
|
||||||
//v2.addElement(new Integer(erg));
|
v2.addElement(new Integer(erg));
|
||||||
//j++; }
|
j++; }
|
||||||
//ret.addElement(v2);
|
ret.addElement(v2);
|
||||||
//i++; }
|
i++; }
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
test/typeinference/FiniteClosureTest_Matrix.java
Normal file
9
test/typeinference/FiniteClosureTest_Matrix.java
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package typeinference;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class FiniteClosureTest_Matrix extends JavaTXCompilerTest{
|
||||||
|
public FiniteClosureTest_Matrix() {
|
||||||
|
this.fileToTest = new File(rootDirectory+"FC_Matrix.jav");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user