diff --git a/src/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/de/dhbwstuttgart/core/JavaTXCompiler.java index 581ace29c..6f25a763f 100644 --- a/src/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -195,26 +195,14 @@ public class JavaTXCompiler { results.addAll(result); } - /* - Function f = y -> { - if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT); - return y; - }; - - Function, Set> g = x -> new rules().x.stream().map(y -> { - if (y.getPairOp() == PairOperator.SMALLERDOTWC) y.setPairOp(PairOperator.EQUALSDOT); - return y; + results = results.stream().map(x -> { + Optional> 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()) 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();