modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java

bei der der Rueckgabe von subst wurde noch Optional beruecksichtigt
This commit is contained in:
Martin Plümicke 2018-09-27 17:17:36 +02:00
parent 8a43839c28
commit 8e220b81d5

View File

@ -195,26 +195,14 @@ public class JavaTXCompiler {
results.addAll(result);
}
/*
Function<UnifyPair, UnifyPair> f = y -> {
results = results.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;
};
Function<Set<UnifyPair>, Set<UnifyPair>> g = x -> new rules().x.stream().map(y -> {
if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT);
return y;
return y; //alle Paare a <.? b erden durch a =. b ersetzt
}).collect(Collectors.toCollection(HashSet::new)));
if (res.isPresent()) return res.get(); //wenn subst ein Erg liefert wurde was veraendert
else return x; //wenn nichts veraendert wurde wird x zurueckgegeben
}).collect(Collectors.toCollection(HashSet::new));
*/
results = results.stream().map(x -> new RuleSet().subst(x.stream().map(y -> {
if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT);
return y;
}).collect(Collectors.toCollection(HashSet::new))).get()).collect(Collectors.toCollection(HashSet::new));
/*results.stream().map(x -> x.stream().map(y -> {
if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT);
return y;
}).collect(Collectors.toCollection(HashSet::new)).collect(Collectors.toCollection(HashSet::new)));
*/
System.out.println("RESULT Final: " + results);
logFile.write("RES_FINAL: " + results.toString()+"\n");
logFile.flush();