diff --git a/AlgebraicDataflowArchitectureModel/src/models/dataConstraintModel/DataConstraintModel.java b/AlgebraicDataflowArchitectureModel/src/models/dataConstraintModel/DataConstraintModel.java index a23b6ef..18382a0 100644 --- a/AlgebraicDataflowArchitectureModel/src/models/dataConstraintModel/DataConstraintModel.java +++ b/AlgebraicDataflowArchitectureModel/src/models/dataConstraintModel/DataConstraintModel.java @@ -198,8 +198,7 @@ if (arg0.getType().equals(typeLong) || arg1.getType().equals(typeLong)) { return new Constant(Long.toString(Long.parseLong(sArg0) % Long.parseLong(sArg1)), typeLong); } else if (arg0.getType().equals(typeInt) || arg1.getType().equals(typeInt)) { - return new Constant(Integer.toString(Integer.parseInt(sArg0) % Integer.parseInt(sArg1)), - typeInt); + return new Constant(Integer.toString(Integer.parseInt(sArg0) % Integer.parseInt(sArg1)), typeInt); } } return new Constant(Integer.toString(Integer.parseInt(sArg0) % Integer.parseInt(sArg1))); @@ -551,7 +550,7 @@ } } }); - public static final Symbol cons = new Symbol("cons", 2, Symbol.Type.PREFIX, "($x,$y)->$x.add(0, $y)", Symbol.Type.LAMBDA_WITH_SIDE_EFFECT, new int[] { 1, 0 }); + public static final Symbol cons = new Symbol("cons", 2, Symbol.Type.PREFIX, "($x,$y)->$x.add(0, $y)", Symbol.Type.LAMBDA_WITH_SIDE_EFFECT, new int[] {1, 0}); public static final Symbol append = new Symbol("append", 2, Symbol.Type.PREFIX, "add", Symbol.Type.METHOD_WITH_SIDE_EFFECT); // Don't calculate here (Calculated in simulator). public static final Symbol remove = new Symbol("remove", 2, Symbol.Type.PREFIX, "remove", Symbol.Type.METHOD_WITH_SIDE_EFFECT); // Don't calculate here (Calculated in simulator). public static final Symbol head = new Symbol("head", 1, Symbol.Type.PREFIX, "($x)->$x.get(0)", Symbol.Type.LAMBDA); @@ -652,9 +651,8 @@ public static final Symbol set = new Symbol("set", 3, Symbol.Type.PREFIX, "set", Symbol.Type.METHOD_WITH_SIDE_EFFECT); // Don't calculate here (Calculated in simulator). public static final Symbol contains = new Symbol("contains", 2, Symbol.Type.PREFIX, new Symbol.IImplGenerator() { @Override - public String generate(Type type, Type[] childrenTypes, String[] childrenImpl, String[] childrenSideEffects, - String[] sideEffect) { - for (String s : childrenSideEffects) { + public String generate(Type type, Type[] childrenTypes, String[] childrenImpl, String[] childrenSideEffects, String[] sideEffect) { + for (String s: childrenSideEffects) { sideEffect[0] += s; } if (childrenTypes[0] != null && (typeMap.isAncestorOf(childrenTypes[0]) || typeJson.isAncestorOf(childrenTypes[0]))) { @@ -1304,10 +1302,10 @@ } public boolean isPrimitiveType(Type type) { - if (type == typeInt - || type == typeLong - || type == typeFloat - || type == typeDouble + if (type == typeInt + || type == typeLong + || type == typeFloat + || type == typeDouble || type == typeBoolean) { return true; }