forked from JavaTX/JavaCompilerCore
Merge branch 'parallelUnifyResultModel' into unif23NoOptParallel_Lehmann
This commit is contained in:
commit
d71e67cfdd
@ -369,7 +369,7 @@ public class JavaTXCompiler {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public UnifyResultModel typeInferenceAsync(UnifyResultListener resultListener, Writer logFile)
|
public UnifyResultModelParallel typeInferenceAsync(UnifyResultListener resultListener, Writer logFile)
|
||||||
throws ClassNotFoundException, IOException {
|
throws ClassNotFoundException, IOException {
|
||||||
List<ClassOrInterface> allClasses = new ArrayList<>();// environment.getAllAvailableClasses();
|
List<ClassOrInterface> allClasses = new ArrayList<>();// environment.getAllAvailableClasses();
|
||||||
// Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
// Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
|
||||||
@ -382,7 +382,7 @@ public class JavaTXCompiler {
|
|||||||
|
|
||||||
final ConstraintSet<Pair> cons = getConstraints();
|
final ConstraintSet<Pair> cons = getConstraints();
|
||||||
Set<Set<UnifyPair>> results = new HashSet<>();
|
Set<Set<UnifyPair>> results = new HashSet<>();
|
||||||
UnifyResultModel urm = null;
|
UnifyResultModelParallel urm = null;
|
||||||
// urm.addUnifyResultListener(resultListener);
|
// urm.addUnifyResultListener(resultListener);
|
||||||
try {
|
try {
|
||||||
logFile = logFile == null
|
logFile = logFile == null
|
||||||
@ -390,7 +390,7 @@ public class JavaTXCompiler {
|
|||||||
: logFile;
|
: logFile;
|
||||||
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses, logFile, classLoader);
|
IFiniteClosure finiteClosure = UnifyTypeFactory.generateFC(allClasses, logFile, classLoader);
|
||||||
System.out.println(finiteClosure);
|
System.out.println(finiteClosure);
|
||||||
urm = new UnifyResultModel(cons, finiteClosure);
|
urm = new UnifyResultModelParallel(cons, finiteClosure);
|
||||||
urm.addUnifyResultListener(resultListener);
|
urm.addUnifyResultListener(resultListener);
|
||||||
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(cons);
|
ConstraintSet<UnifyPair> unifyCons = UnifyTypeFactory.convert(cons);
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ public class JavaTXCompiler {
|
|||||||
}).collect(Collectors.toCollection(ArrayList::new))*/;
|
}).collect(Collectors.toCollection(ArrayList::new))*/;
|
||||||
if (resultmodel) {
|
if (resultmodel) {
|
||||||
/* UnifyResultModel Anfang */
|
/* UnifyResultModel Anfang */
|
||||||
UnifyResultModel urm = new UnifyResultModel(cons, finiteClosure);
|
UnifyResultModelParallel urm = new UnifyResultModelParallel(cons, finiteClosure);
|
||||||
UnifyResultListenerImpl li = new UnifyResultListenerImpl();
|
UnifyResultListenerImpl li = new UnifyResultListenerImpl();
|
||||||
urm.addUnifyResultListener(li);
|
urm.addUnifyResultListener(li);
|
||||||
unify.unifyParallel(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, urm,
|
unify.unifyParallel(unifyCons.getUndConstraints(), oderConstraints, finiteClosure, logFile, log, urm,
|
||||||
@ -738,7 +738,7 @@ public class JavaTXCompiler {
|
|||||||
// oderConstraints, finiteClosure, logFile, log, new UnifyResultModel(cons,
|
// oderConstraints, finiteClosure, logFile, log, new UnifyResultModel(cons,
|
||||||
// finiteClosure));
|
// finiteClosure));
|
||||||
Set<Set<UnifyPair>> result = unify.unifyOderConstraints(unifyCons.getUndConstraints(), oderConstraints,
|
Set<Set<UnifyPair>> result = unify.unifyOderConstraints(unifyCons.getUndConstraints(), oderConstraints,
|
||||||
finiteClosure, logFile, log, new UnifyResultModel(cons, finiteClosure), usedTasks);
|
finiteClosure, logFile, log, new UnifyResultModelParallel(cons, finiteClosure), usedTasks);
|
||||||
System.out.println("RESULT: " + result);
|
System.out.println("RESULT: " + result);
|
||||||
logFile.write("RES: " + result.toString() + "\n");
|
logFile.write("RES: " + result.toString() + "\n");
|
||||||
logFile.flush();
|
logFile.flush();
|
||||||
|
@ -23,10 +23,11 @@ public class TypeUnify {
|
|||||||
* @param cons
|
* @param cons
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Set<Set<UnifyPair>> unify(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret, UnifyTaskModelParallel taskModel) {
|
public Set<Set<UnifyPair>> unify(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModelParallel resultModel, UnifyTaskModelParallel taskModel) {
|
||||||
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
||||||
taskModel.setPool(pool);
|
taskModel.setPool(pool);
|
||||||
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, ret, pool);
|
resultModel.setPool(pool);
|
||||||
|
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, resultModel, pool);
|
||||||
pool.invoke(unifyTask);
|
pool.invoke(unifyTask);
|
||||||
Set<Set<UnifyPair>> res = unifyTask.join();
|
Set<Set<UnifyPair>> res = unifyTask.join();
|
||||||
try {
|
try {
|
||||||
@ -50,12 +51,13 @@ public class TypeUnify {
|
|||||||
* @param ret
|
* @param ret
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public UnifyResultModel unifyAsync(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret, UnifyTaskModelParallel taskModel) {
|
public UnifyResultModelParallel unifyAsync(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModelParallel resultModel, UnifyTaskModelParallel taskModel) {
|
||||||
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
||||||
taskModel.setPool(pool);
|
taskModel.setPool(pool);
|
||||||
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, ret, pool);
|
resultModel.setPool(pool);
|
||||||
|
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, resultModel, pool);
|
||||||
pool.invoke(unifyTask);
|
pool.invoke(unifyTask);
|
||||||
return ret;
|
return resultModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,11 +71,12 @@ public class TypeUnify {
|
|||||||
* @param ret
|
* @param ret
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public UnifyResultModel unifyParallel(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret, UnifyTaskModelParallel taskModel) {
|
public UnifyResultModelParallel unifyParallel(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModelParallel resultModel, UnifyTaskModelParallel taskModel) {
|
||||||
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true);
|
||||||
taskModel.setPool(pool);
|
taskModel.setPool(pool);
|
||||||
|
resultModel.setPool(pool);
|
||||||
TypeUnifyTask unifyTask = //new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret, usedTasks);
|
TypeUnifyTask unifyTask = //new TypeUnifyTask(undConstrains, oderConstraints, fc, true, logFile, log, 0, ret, usedTasks);
|
||||||
new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, ret, pool, statistics);
|
new TypeUnifyTask(undConstrains, oderConstraints, fc, true, new WriterActiveObject(logFile, pool), log, 0, resultModel, pool, statistics);
|
||||||
|
|
||||||
pool.invoke(unifyTask);
|
pool.invoke(unifyTask);
|
||||||
Set<Set<UnifyPair>> res = unifyTask.join();
|
Set<Set<UnifyPair>> res = unifyTask.join();
|
||||||
@ -86,7 +89,7 @@ public class TypeUnify {
|
|||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
System.err.println("no log-File");
|
System.err.println("no log-File");
|
||||||
}
|
}
|
||||||
return ret;
|
return resultModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -107,8 +110,9 @@ public class TypeUnify {
|
|||||||
* @param cons
|
* @param cons
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Set<Set<UnifyPair>> unifyOderConstraints(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModel ret, UnifyTaskModelParallel taskModel) {
|
public Set<Set<UnifyPair>> unifyOderConstraints(Set<UnifyPair> undConstrains, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, Writer logFile, Boolean log, UnifyResultModelParallel resultModel, UnifyTaskModelParallel taskModel) {
|
||||||
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, false, new WriterActiveObject(logFile, ForkJoinPool.commonPool()), log, 0, ret, ForkJoinPool.commonPool());
|
resultModel.setPool(ForkJoinPool.commonPool());
|
||||||
|
TypeUnifyTask unifyTask = new TypeUnifyTask(undConstrains, oderConstraints, fc, false, new WriterActiveObject(logFile, ForkJoinPool.commonPool()), log, 0, resultModel, ForkJoinPool.commonPool());
|
||||||
unifyTask.statisticsFile = statistics;
|
unifyTask.statisticsFile = statistics;
|
||||||
Set<Set<UnifyPair>> res = unifyTask.compute();
|
Set<Set<UnifyPair>> res = unifyTask.compute();
|
||||||
try {
|
try {
|
||||||
|
@ -24,13 +24,13 @@ public class TypeUnify2Task extends TypeUnifyTask {
|
|||||||
TypeUnify2Task(Set<Set<UnifyPair>> setToFlatten, Set<UnifyPair> eq,
|
TypeUnify2Task(Set<Set<UnifyPair>> setToFlatten, Set<UnifyPair> eq,
|
||||||
List<Set<Constraint<UnifyPair>>> oderConstraints,
|
List<Set<Constraint<UnifyPair>>> oderConstraints,
|
||||||
Set<UnifyPair> nextSetElement,
|
Set<UnifyPair> nextSetElement,
|
||||||
IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModel urm,
|
IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModelParallel urm,
|
||||||
Set<UnifyPair> methodSignatureConstraintUebergabe, ForkJoinPool pool, Writer statistics) {
|
Set<UnifyPair> methodSignatureConstraintUebergabe, ForkJoinPool pool, Writer statistics) {
|
||||||
this(setToFlatten, eq, oderConstraints, nextSetElement, fc, parallel, logFile, log, rekTiefe, urm, methodSignatureConstraintUebergabe, pool );
|
this(setToFlatten, eq, oderConstraints, nextSetElement, fc, parallel, logFile, log, rekTiefe, urm, methodSignatureConstraintUebergabe, pool );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TypeUnify2Task(Set<Set<UnifyPair>> setToFlatten, Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, Set<UnifyPair> nextSetElement, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModel urm, Set<UnifyPair> methodSignatureConstraintUebergabe, ForkJoinPool pool) {
|
public TypeUnify2Task(Set<Set<UnifyPair>> setToFlatten, Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, Set<UnifyPair> nextSetElement, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModelParallel urm, Set<UnifyPair> methodSignatureConstraintUebergabe, ForkJoinPool pool) {
|
||||||
super(eq, oderConstraints, fc, parallel, logFile, log, rekTiefe, urm, pool);
|
super(eq, oderConstraints, fc, parallel, logFile, log, rekTiefe, urm, pool);
|
||||||
this.setToFlatten = setToFlatten;
|
this.setToFlatten = setToFlatten;
|
||||||
this.nextSetElement = nextSetElement;
|
this.nextSetElement = nextSetElement;
|
||||||
|
@ -71,7 +71,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
/**
|
/**
|
||||||
* Fuer die Threads
|
* Fuer die Threads
|
||||||
*/
|
*/
|
||||||
UnifyResultModel urm;
|
protected UnifyResultModelParallel urm;
|
||||||
protected static int noOfThread = 0;
|
protected static int noOfThread = 0;
|
||||||
private static int totalnoOfThread = 0;
|
private static int totalnoOfThread = 0;
|
||||||
int thNo;
|
int thNo;
|
||||||
@ -146,11 +146,11 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//statistics
|
//statistics
|
||||||
public TypeUnifyTask(Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModel urm, ForkJoinPool pool, Writer statisticsFile) {
|
public TypeUnifyTask(Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModelParallel urm, ForkJoinPool pool, Writer statisticsFile) {
|
||||||
this(eq,oderConstraints, fc, parallel, logFile, log, rekTiefe, urm, pool);
|
this(eq,oderConstraints, fc, parallel, logFile, log, rekTiefe, urm, pool);
|
||||||
this.statisticsFile = statisticsFile;
|
this.statisticsFile = statisticsFile;
|
||||||
}
|
}
|
||||||
public TypeUnifyTask(Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModel urm, ForkJoinPool pool) {
|
public TypeUnifyTask(Set<UnifyPair> eq, List<Set<Constraint<UnifyPair>>> oderConstraints, IFiniteClosure fc, boolean parallel, WriterActiveObject logFile, Boolean log, int rekTiefe, UnifyResultModelParallel urm, ForkJoinPool pool) {
|
||||||
this.eq = eq;
|
this.eq = eq;
|
||||||
//this.oderConstraints = oderConstraints.stream().map(x -> x.stream().map(y -> new HashSet<>(y)).collect(Collectors.toSet(HashSet::new))).collect(Collectors.toList(ArrayList::new));
|
//this.oderConstraints = oderConstraints.stream().map(x -> x.stream().map(y -> new HashSet<>(y)).collect(Collectors.toSet(HashSet::new))).collect(Collectors.toList(ArrayList::new));
|
||||||
this.oderConstraintsField = oderConstraints; /*.stream().map(x -> {
|
this.oderConstraintsField = oderConstraints; /*.stream().map(x -> {
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package de.dhbwstuttgart.typeinference.unify;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.factory.UnifyTypeFactory;
|
||||||
|
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
||||||
|
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||||
|
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||||
|
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
||||||
|
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
|
||||||
|
import de.dhbwstuttgart.typeinference.unify.model.UnifyPair;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ForkJoinPool;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class UnifyResultModelParallel {
|
||||||
|
private ForkJoinPool pool;
|
||||||
|
private ConstraintSet<Pair> cons;
|
||||||
|
private IFiniteClosure fc;
|
||||||
|
private List<UnifyResultListener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
|
public UnifyResultModelParallel(ConstraintSet<Pair> cons, IFiniteClosure fc){
|
||||||
|
this.cons = cons;
|
||||||
|
this.fc = fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPool(ForkJoinPool pool){
|
||||||
|
this.pool = pool;
|
||||||
|
}
|
||||||
|
public void addUnifyResultListener(UnifyResultListener listenerToAdd) {
|
||||||
|
listeners.add(listenerToAdd);
|
||||||
|
}
|
||||||
|
public void removeUnifyResultListener(UnifyResultListener listenerToRemove) {
|
||||||
|
listeners.remove(listenerToRemove);
|
||||||
|
}
|
||||||
|
public void notify(Set<Set<UnifyPair>> eqPrimePrimeSet){
|
||||||
|
pool.execute(()->{
|
||||||
|
Set<Set<UnifyPair>> eqPrimePrimeSetRet = eqPrimePrimeSet.stream().map(x -> {
|
||||||
|
Optional<Set<UnifyPair>> res = new RuleSet().subst(x.stream().map(y -> {
|
||||||
|
if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT);
|
||||||
|
return y; //alle Paare a <.? b erden durch a =. b ersetzt
|
||||||
|
}).collect(Collectors.toCollection(HashSet::new)));
|
||||||
|
if (res.isPresent()) {//wenn subst ein Erg liefert wurde was veraendert
|
||||||
|
return new TypeUnifyTask().applyTypeUnificationRules(res.get(), fc);
|
||||||
|
}
|
||||||
|
else return x; //wenn nichts veraendert wurde wird x zurueckgegeben
|
||||||
|
}).collect(Collectors.toCollection(HashSet::new));
|
||||||
|
List<ResultSet> newResult = eqPrimePrimeSetRet.stream().map(unifyPairs ->
|
||||||
|
new ResultSet(UnifyTypeFactory.convert(unifyPairs, de.dhbwstuttgart.typeinference.constraints.Pair.generateTPHMap(cons))))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
UnifyResultEvent evt = new UnifyResultEvent(newResult);
|
||||||
|
|
||||||
|
for (UnifyResultListener listener : listeners) {
|
||||||
|
listener.onNewTypeResultFound(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@ import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
|
|||||||
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
import de.dhbwstuttgart.typeinference.constraints.Pair;
|
||||||
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||||
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
|
import de.dhbwstuttgart.typeinference.unify.TypeUnify;
|
||||||
import de.dhbwstuttgart.typeinference.unify.UnifyResultModel;
|
import de.dhbwstuttgart.typeinference.unify.UnifyResultModelParallel;
|
||||||
import de.dhbwstuttgart.typeinference.unify.UnifyTaskModelParallel;
|
import de.dhbwstuttgart.typeinference.unify.UnifyTaskModelParallel;
|
||||||
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
||||||
import de.dhbwstuttgart.typeinference.unify.model.*;
|
import de.dhbwstuttgart.typeinference.unify.model.*;
|
||||||
@ -87,7 +87,7 @@ public class UnifyTest {
|
|||||||
|
|
||||||
TypeUnify unifyAlgo = new TypeUnify();
|
TypeUnify unifyAlgo = new TypeUnify();
|
||||||
ConstraintSet< Pair> cons = new ConstraintSet<>();
|
ConstraintSet< Pair> cons = new ConstraintSet<>();
|
||||||
UnifyResultModel urm = new UnifyResultModel(cons, finiteClosure);
|
UnifyResultModelParallel urm = new UnifyResultModelParallel(cons, finiteClosure);
|
||||||
UnifyTaskModelParallel tasks = new UnifyTaskModelParallel();
|
UnifyTaskModelParallel tasks = new UnifyTaskModelParallel();
|
||||||
Set<Set<UnifyPair>> solution = unifyAlgo.unify(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
|
Set<Set<UnifyPair>> solution = unifyAlgo.unify(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
|
||||||
System.out.println(solution.size());
|
System.out.println(solution.size());
|
||||||
@ -150,7 +150,7 @@ public class UnifyTest {
|
|||||||
|
|
||||||
TypeUnify unifyAlgo = new TypeUnify();
|
TypeUnify unifyAlgo = new TypeUnify();
|
||||||
ConstraintSet< Pair> cons = new ConstraintSet<>();
|
ConstraintSet< Pair> cons = new ConstraintSet<>();
|
||||||
UnifyResultModel urm = new UnifyResultModel(cons, finiteClosure);
|
UnifyResultModelParallel urm = new UnifyResultModelParallel(cons, finiteClosure);
|
||||||
UnifyTaskModelParallel tasks = new UnifyTaskModelParallel();
|
UnifyTaskModelParallel tasks = new UnifyTaskModelParallel();
|
||||||
Set<Set<UnifyPair>> solution = unifyAlgo.unify(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
|
Set<Set<UnifyPair>> solution = unifyAlgo.unify(undConstraints, oderConstraints, finiteClosure, new NullWriter(), false, urm, tasks);
|
||||||
System.out.println(solution.size());
|
System.out.println(solution.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user