Browse Source

Extend expressions test with comparisons and boolean logic. Use lazy evaluation.

Joeri Exelmans 5 years ago
parent
commit
40647fe803

+ 45 - 20
src/sccd/runtime/expression.py

@@ -74,6 +74,16 @@ class IntLiteral(Expression):
     def render(self):
         return str(self.i)
 
+@dataclass
+class BoolLiteral(Expression):
+    b: bool 
+
+    def eval(self, events, datamodel):
+        return self.b
+
+    def render(self):
+        return "true" if self.b else "false"
+
 @dataclass
 class Array(Expression):
     elements: List[Any]
@@ -84,6 +94,18 @@ class Array(Expression):
     def render(self):
         return '['+','.join([e.render() for e in self.elements])+']'
 
+# Does not add anything semantically, but ensures that when rendering an expression,
+# the parenthesis are not lost
+@dataclass
+class Group(Expression):
+    subexpr: Expression
+
+    def eval(self, events, datamodel):
+        return self.subexpr.eval(events, datamodel)
+
+    def render(self):
+        return '('+self.subexpr.render()+')'
+
 @dataclass
 class BinaryExpression(Expression):
     lhs: Expression
@@ -91,6 +113,7 @@ class BinaryExpression(Expression):
     rhs: Expression
 
     def eval(self, events, datamodel):
+        
         return {
             # "AND": lambda x,y: x and y,
             # "OR": lambda x,y: x or y,
@@ -108,23 +131,22 @@ class BinaryExpression(Expression):
             # "MOD": lambda x,y: x % y,
             # "EXP": lambda x,y: x ** y,
 
-
-            "and": lambda x,y: x and y,
-            "or": lambda x,y: x or y,
-            "==": lambda x,y: x == y,
-            "!=": lambda x,y: x != y,
-            ">": lambda x,y: x > y,
-            ">=": lambda x,y: x >= y,
-            "<": lambda x,y: x < y,
-            "<=": lambda x,y: x <= y,
-            "+": lambda x,y: x + y,
-            "-": lambda x,y: x - y,
-            "*": lambda x,y: x * y,
-            "/": lambda x,y: x / y,
-            "//": lambda x,y: x // y,
-            "%": lambda x,y: x % y,
-            "**": lambda x,y: x ** y,
-        }[self.operator](self.lhs.eval(events, datamodel), self.rhs.eval(events, datamodel))
+            "and": lambda x,y: x.eval(events, datamodel) and y.eval(events, datamodel),
+            "or": lambda x,y: x.eval(events, datamodel) or y.eval(events, datamodel),
+            "==": lambda x,y: x.eval(events, datamodel) == y.eval(events, datamodel),
+            "!=": lambda x,y: x.eval(events, datamodel) != y.eval(events, datamodel),
+            ">": lambda x,y: x.eval(events, datamodel) > y.eval(events, datamodel),
+            ">=": lambda x,y: x.eval(events, datamodel) >= y.eval(events, datamodel),
+            "<": lambda x,y: x.eval(events, datamodel) < y.eval(events, datamodel),
+            "<=": lambda x,y: x.eval(events, datamodel) <= y.eval(events, datamodel),
+            "+": lambda x,y: x.eval(events, datamodel) + y.eval(events, datamodel),
+            "-": lambda x,y: x.eval(events, datamodel) - y.eval(events, datamodel),
+            "*": lambda x,y: x.eval(events, datamodel) * y.eval(events, datamodel),
+            "/": lambda x,y: x.eval(events, datamodel) / y.eval(events, datamodel),
+            "//": lambda x,y: x.eval(events, datamodel) // y.eval(events, datamodel),
+            "%": lambda x,y: x.eval(events, datamodel) % y.eval(events, datamodel),
+            "**": lambda x,y: x.eval(events, datamodel) ** y.eval(events, datamodel),
+        }[self.operator](self.lhs, self.rhs) # Borrow Python's lazy evaluation
 
     def render(self):
         return self.lhs.render() + ' ' + self.operator + ' ' + self.rhs.render()
@@ -136,9 +158,12 @@ class UnaryExpression(Expression):
 
     def eval(self, events, datamodel):
         return {
-            "NOT": lambda x: not x,
-            "MINUS": lambda x: -x,
-        }[self.operator](self.expr.eval(events, datamodel))
+            "not": lambda x: not x.eval(events, datamodel),
+            "-": lambda x: - x.eval(events, datamodel),
+        }[self.operator](self.expr)
+
+    def render(self):
+        return self.operator + ' ' + self.expr.render()
 
 @dataclass
 class Assignment(Statement):

+ 13 - 0
src/sccd/runtime/xml_loader2.py

@@ -28,6 +28,18 @@ class ExpressionTransformer(Transformer):
   def binary_expr(self, node):
     return BinaryExpression(node[0], node[1].value, node[2])
 
+  def unary_expr(self, node):
+    return UnaryExpression(node[0].value, node[1])
+
+  def bool(self, node):
+    return BoolLiteral({
+      "True": True,
+      "False": False,
+      }[node[0].value])
+
+  def group(self, node):
+    return Group(node[0])
+
   array = Array
 
 
@@ -161,6 +173,7 @@ def load_state_tree(namespace: ModelNamespace, tree_node) -> StateTree:
         # print(tree2.pretty())
 
         expr = expr_parser.parse(cond, start="expr")
+        print(expr)
         transition.setGuard(expr)
       except:
         raise Exception("Line %d: <transition> with cond=\"%s\": Parse error." % (t_node.sourceline, cond))

+ 2 - 3
src/sccd/schema/grammar.g

@@ -93,9 +93,8 @@ INT: /[0-9]+/
 func_call: atom "(" param_list ")"
 param_list: ( expr ("," expr)* )?  -> params
 
-TRUE: "true"
-FALSE: "false"
-
+TRUE: "True"
+FALSE: "False"
 
 ?stmt: assignment
 

+ 248 - 72
test/new_test_files/features/expressions/test_expressions.svg

@@ -4,28 +4,38 @@
 <!-- Generated by graphviz version 2.40.1 (20161225.0304)
  -->
 <!-- Title: state transitions Pages: 1 -->
-<svg width="174pt" height="752pt"
- viewBox="0.00 0.00 173.50 752.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 748)">
+<svg width="223pt" height="1742pt"
+ viewBox="0.00 0.00 222.50 1742.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1738)">
 <title>state transitions</title>
-<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-748 169.5,-748 169.5,4 -4,4"/>
+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-1738 218.5,-1738 218.5,4 -4,4"/>
 <g id="clust1" class="cluster">
+<title>cluster__comparisons</title>
+<path fill="none" stroke="#000000" stroke-width="2" d="M117.5,-1228C117.5,-1228 185.5,-1228 185.5,-1228 191.5,-1228 197.5,-1234 197.5,-1240 197.5,-1240 197.5,-1683 197.5,-1683 197.5,-1689 191.5,-1695 185.5,-1695 185.5,-1695 117.5,-1695 117.5,-1695 111.5,-1695 105.5,-1689 105.5,-1683 105.5,-1683 105.5,-1240 105.5,-1240 105.5,-1234 111.5,-1228 117.5,-1228"/>
+<text text-anchor="start" x="117.4968" y="-1676.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">comparisons</text>
+</g>
+<g id="clust2" class="cluster">
 <title>cluster__arithmetic</title>
-<path fill="none" stroke="#000000" stroke-width="2" d="M40.5,-74C40.5,-74 145.5,-74 145.5,-74 151.5,-74 157.5,-80 157.5,-86 157.5,-86 157.5,-693 157.5,-693 157.5,-699 151.5,-705 145.5,-705 145.5,-705 40.5,-705 40.5,-705 34.5,-705 28.5,-699 28.5,-693 28.5,-693 28.5,-86 28.5,-86 28.5,-80 34.5,-74 40.5,-74"/>
-<text text-anchor="start" x="67.5014" y="-686.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">arithmetic</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M76.5,-569C76.5,-569 181.5,-569 181.5,-569 187.5,-569 193.5,-575 193.5,-581 193.5,-581 193.5,-1188 193.5,-1188 193.5,-1194 187.5,-1200 181.5,-1200 181.5,-1200 76.5,-1200 76.5,-1200 70.5,-1200 64.5,-1194 64.5,-1188 64.5,-1188 64.5,-581 64.5,-581 64.5,-575 70.5,-569 76.5,-569"/>
+<text text-anchor="start" x="103.5014" y="-1181.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">arithmetic</text>
+</g>
+<g id="clust3" class="cluster">
+<title>cluster__boolean_logic</title>
+<path fill="none" stroke="#000000" stroke-width="2" d="M40.5,-74C40.5,-74 194.5,-74 194.5,-74 200.5,-74 206.5,-80 206.5,-86 206.5,-86 206.5,-529 206.5,-529 206.5,-535 200.5,-541 194.5,-541 194.5,-541 40.5,-541 40.5,-541 34.5,-541 28.5,-535 28.5,-529 28.5,-529 28.5,-86 28.5,-86 28.5,-80 34.5,-74 40.5,-74"/>
+<text text-anchor="start" x="80.4872" y="-522.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">boolean_logic</text>
 </g>
 <!-- __initial -->
 <g id="node1" class="node">
 <title>__initial</title>
-<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="120.5" cy="-738.5" rx="5.5" ry="5.5"/>
+<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="182.5" cy="-1728.5" rx="5.5" ry="5.5"/>
 </g>
-<!-- _arithmetic -->
-<!-- __initial&#45;&gt;_arithmetic -->
+<!-- _comparisons -->
+<!-- __initial&#45;&gt;_comparisons -->
 <g id="edge1" class="edge">
-<title>__initial&#45;&gt;_arithmetic</title>
-<path fill="none" stroke="#000000" d="M120.5,-732.9623C120.5,-728.7143 120.5,-722.3733 120.5,-715.1925"/>
-<polygon fill="#000000" stroke="#000000" points="124.0001,-714.9976 120.5,-704.9976 117.0001,-714.9976 124.0001,-714.9976"/>
-<text text-anchor="middle" x="121.8895" y="-716" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+<title>__initial&#45;&gt;_comparisons</title>
+<path fill="none" stroke="#000000" d="M182.5,-1722.9623C182.5,-1718.7143 182.5,-1712.3733 182.5,-1705.1925"/>
+<polygon fill="#000000" stroke="#000000" points="186.0001,-1704.9976 182.5,-1694.9976 179.0001,-1704.9976 186.0001,-1704.9976"/>
+<text text-anchor="middle" x="183.8895" y="-1706" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
 </g>
 <!-- _final -->
 <g id="node2" class="node">
@@ -36,112 +46,278 @@
 <polygon fill="#000000" stroke="#000000" points=".5,-23 .5,-23 129.5,-23 129.5,-23 .5,-23"/>
 <path fill="none" stroke="#000000" stroke-width="2" d="M13,-1C13,-1 116,-1 116,-1 122,-1 128,-7 128,-13 128,-13 128,-33 128,-33 128,-39 122,-45 116,-45 116,-45 13,-45 13,-45 7,-45 1,-39 1,-33 1,-33 1,-13 1,-13 1,-7 7,-1 13,-1"/>
 </g>
-<!-- _arithmetic_initial -->
+<!-- _comparisons_initial -->
 <g id="node4" class="node">
+<title>_comparisons_initial</title>
+<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="144.5" cy="-1651.5" rx="5.5" ry="5.5"/>
+</g>
+<!-- _comparisons_s1 -->
+<g id="node5" class="node">
+<title>_comparisons_s1</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="172.5,-1600 116.5,-1600 116.5,-1564 172.5,-1564 172.5,-1600"/>
+<text text-anchor="start" x="138.1646" y="-1578.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s1</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M128.8333,-1565C128.8333,-1565 160.1667,-1565 160.1667,-1565 165.8333,-1565 171.5,-1570.6667 171.5,-1576.3333 171.5,-1576.3333 171.5,-1587.6667 171.5,-1587.6667 171.5,-1593.3333 165.8333,-1599 160.1667,-1599 160.1667,-1599 128.8333,-1599 128.8333,-1599 123.1667,-1599 117.5,-1593.3333 117.5,-1587.6667 117.5,-1587.6667 117.5,-1576.3333 117.5,-1576.3333 117.5,-1570.6667 123.1667,-1565 128.8333,-1565"/>
+</g>
+<!-- _comparisons_initial&#45;&gt;_comparisons_s1 -->
+<g id="edge2" class="edge">
+<title>_comparisons_initial&#45;&gt;_comparisons_s1</title>
+<path fill="none" stroke="#000000" d="M144.5,-1645.5745C144.5,-1637.7003 144.5,-1623.2498 144.5,-1610.1135"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1610.0109 144.5,-1600.011 141.0001,-1610.011 148.0001,-1610.0109"/>
+<text text-anchor="middle" x="145.8895" y="-1620" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+</g>
+<!-- _comparisons_s2 -->
+<g id="node6" class="node">
+<title>_comparisons_s2</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="172.5,-1518 116.5,-1518 116.5,-1482 172.5,-1482 172.5,-1518"/>
+<text text-anchor="start" x="138.1646" y="-1496.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s2</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M128.8333,-1483C128.8333,-1483 160.1667,-1483 160.1667,-1483 165.8333,-1483 171.5,-1488.6667 171.5,-1494.3333 171.5,-1494.3333 171.5,-1505.6667 171.5,-1505.6667 171.5,-1511.3333 165.8333,-1517 160.1667,-1517 160.1667,-1517 128.8333,-1517 128.8333,-1517 123.1667,-1517 117.5,-1511.3333 117.5,-1505.6667 117.5,-1505.6667 117.5,-1494.3333 117.5,-1494.3333 117.5,-1488.6667 123.1667,-1483 128.8333,-1483"/>
+</g>
+<!-- _comparisons_s1&#45;&gt;_comparisons_s2 -->
+<g id="edge3" class="edge">
+<title>_comparisons_s1&#45;&gt;_comparisons_s2</title>
+<path fill="none" stroke="#000000" d="M144.5,-1563.8015C144.5,-1553.3976 144.5,-1540.1215 144.5,-1528.3768"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1528.1476 144.5,-1518.1476 141.0001,-1528.1476 148.0001,-1528.1476"/>
+<text text-anchor="start" x="144.5" y="-1538" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[1 == 1] &#160;&#160;</text>
+</g>
+<!-- _comparisons_s3 -->
+<g id="node7" class="node">
+<title>_comparisons_s3</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="172.5,-1436 116.5,-1436 116.5,-1400 172.5,-1400 172.5,-1436"/>
+<text text-anchor="start" x="138.1646" y="-1414.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s3</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M128.8333,-1401C128.8333,-1401 160.1667,-1401 160.1667,-1401 165.8333,-1401 171.5,-1406.6667 171.5,-1412.3333 171.5,-1412.3333 171.5,-1423.6667 171.5,-1423.6667 171.5,-1429.3333 165.8333,-1435 160.1667,-1435 160.1667,-1435 128.8333,-1435 128.8333,-1435 123.1667,-1435 117.5,-1429.3333 117.5,-1423.6667 117.5,-1423.6667 117.5,-1412.3333 117.5,-1412.3333 117.5,-1406.6667 123.1667,-1401 128.8333,-1401"/>
+</g>
+<!-- _comparisons_s2&#45;&gt;_comparisons_s3 -->
+<g id="edge4" class="edge">
+<title>_comparisons_s2&#45;&gt;_comparisons_s3</title>
+<path fill="none" stroke="#000000" d="M144.5,-1481.8015C144.5,-1471.3976 144.5,-1458.1215 144.5,-1446.3768"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1446.1476 144.5,-1436.1476 141.0001,-1446.1476 148.0001,-1446.1476"/>
+<text text-anchor="start" x="144.5" y="-1456" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[1 != 2] &#160;&#160;</text>
+</g>
+<!-- _comparisons_s4 -->
+<g id="node8" class="node">
+<title>_comparisons_s4</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="172.5,-1354 116.5,-1354 116.5,-1318 172.5,-1318 172.5,-1354"/>
+<text text-anchor="start" x="138.1646" y="-1332.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s4</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M128.8333,-1319C128.8333,-1319 160.1667,-1319 160.1667,-1319 165.8333,-1319 171.5,-1324.6667 171.5,-1330.3333 171.5,-1330.3333 171.5,-1341.6667 171.5,-1341.6667 171.5,-1347.3333 165.8333,-1353 160.1667,-1353 160.1667,-1353 128.8333,-1353 128.8333,-1353 123.1667,-1353 117.5,-1347.3333 117.5,-1341.6667 117.5,-1341.6667 117.5,-1330.3333 117.5,-1330.3333 117.5,-1324.6667 123.1667,-1319 128.8333,-1319"/>
+</g>
+<!-- _comparisons_s3&#45;&gt;_comparisons_s4 -->
+<g id="edge5" class="edge">
+<title>_comparisons_s3&#45;&gt;_comparisons_s4</title>
+<path fill="none" stroke="#000000" d="M144.5,-1399.8015C144.5,-1389.3976 144.5,-1376.1215 144.5,-1364.3768"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1364.1476 144.5,-1354.1476 141.0001,-1364.1476 148.0001,-1364.1476"/>
+<text text-anchor="start" x="144.5" y="-1374" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[1 &lt; 2] &#160;&#160;</text>
+</g>
+<!-- _comparisons_s5 -->
+<g id="node9" class="node">
+<title>_comparisons_s5</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="172.5,-1272 116.5,-1272 116.5,-1236 172.5,-1236 172.5,-1272"/>
+<text text-anchor="start" x="138.1646" y="-1250.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s5</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M128.8333,-1237C128.8333,-1237 160.1667,-1237 160.1667,-1237 165.8333,-1237 171.5,-1242.6667 171.5,-1248.3333 171.5,-1248.3333 171.5,-1259.6667 171.5,-1259.6667 171.5,-1265.3333 165.8333,-1271 160.1667,-1271 160.1667,-1271 128.8333,-1271 128.8333,-1271 123.1667,-1271 117.5,-1265.3333 117.5,-1259.6667 117.5,-1259.6667 117.5,-1248.3333 117.5,-1248.3333 117.5,-1242.6667 123.1667,-1237 128.8333,-1237"/>
+</g>
+<!-- _comparisons_s4&#45;&gt;_comparisons_s5 -->
+<g id="edge6" class="edge">
+<title>_comparisons_s4&#45;&gt;_comparisons_s5</title>
+<path fill="none" stroke="#000000" d="M144.5,-1317.8015C144.5,-1307.3976 144.5,-1294.1215 144.5,-1282.3768"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1282.1476 144.5,-1272.1476 141.0001,-1282.1476 148.0001,-1282.1476"/>
+<text text-anchor="start" x="144.5" y="-1292" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[2 &gt; 1] &#160;&#160;</text>
+</g>
+<!-- _arithmetic -->
+<!-- _comparisons_s5&#45;&gt;_arithmetic -->
+<g id="edge7" class="edge">
+<title>_comparisons_s5&#45;&gt;_arithmetic</title>
+<path fill="none" stroke="#000000" d="M144.5,-1235.661C144.5,-1228.2376 144.5,-1219.2479 144.5,-1210.0279"/>
+<polygon fill="#000000" stroke="#000000" points="148.0001,-1209.9962 144.5,-1199.9962 141.0001,-1209.9963 148.0001,-1209.9962"/>
+<text text-anchor="middle" x="145.8895" y="-1211" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+</g>
+<!-- _arithmetic_initial -->
+<g id="node11" class="node">
 <title>_arithmetic_initial</title>
-<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="64.5" cy="-661.5" rx="5.5" ry="5.5"/>
+<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="100.5" cy="-1156.5" rx="5.5" ry="5.5"/>
 </g>
 <!-- _arithmetic_s1 -->
-<g id="node5" class="node">
+<g id="node12" class="node">
 <title>_arithmetic_s1</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-610 36.5,-610 36.5,-574 92.5,-574 92.5,-610"/>
-<text text-anchor="start" x="58.1646" y="-588.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s1</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-575C48.8333,-575 80.1667,-575 80.1667,-575 85.8333,-575 91.5,-580.6667 91.5,-586.3333 91.5,-586.3333 91.5,-597.6667 91.5,-597.6667 91.5,-603.3333 85.8333,-609 80.1667,-609 80.1667,-609 48.8333,-609 48.8333,-609 43.1667,-609 37.5,-603.3333 37.5,-597.6667 37.5,-597.6667 37.5,-586.3333 37.5,-586.3333 37.5,-580.6667 43.1667,-575 48.8333,-575"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-1105 72.5,-1105 72.5,-1069 128.5,-1069 128.5,-1105"/>
+<text text-anchor="start" x="94.1646" y="-1083.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s1</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-1070C84.8333,-1070 116.1667,-1070 116.1667,-1070 121.8333,-1070 127.5,-1075.6667 127.5,-1081.3333 127.5,-1081.3333 127.5,-1092.6667 127.5,-1092.6667 127.5,-1098.3333 121.8333,-1104 116.1667,-1104 116.1667,-1104 84.8333,-1104 84.8333,-1104 79.1667,-1104 73.5,-1098.3333 73.5,-1092.6667 73.5,-1092.6667 73.5,-1081.3333 73.5,-1081.3333 73.5,-1075.6667 79.1667,-1070 84.8333,-1070"/>
 </g>
 <!-- _arithmetic_initial&#45;&gt;_arithmetic_s1 -->
-<g id="edge2" class="edge">
+<g id="edge8" class="edge">
 <title>_arithmetic_initial&#45;&gt;_arithmetic_s1</title>
-<path fill="none" stroke="#000000" d="M64.5,-655.5745C64.5,-647.7003 64.5,-633.2498 64.5,-620.1135"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-620.0109 64.5,-610.011 61.0001,-620.011 68.0001,-620.0109"/>
-<text text-anchor="middle" x="65.8895" y="-630" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+<path fill="none" stroke="#000000" d="M100.5,-1150.5745C100.5,-1142.7003 100.5,-1128.2498 100.5,-1115.1135"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-1115.0109 100.5,-1105.011 97.0001,-1115.011 104.0001,-1115.0109"/>
+<text text-anchor="middle" x="101.8895" y="-1125" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
 </g>
 <!-- _arithmetic_s2 -->
-<g id="node6" class="node">
+<g id="node13" class="node">
 <title>_arithmetic_s2</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-528 36.5,-528 36.5,-492 92.5,-492 92.5,-528"/>
-<text text-anchor="start" x="58.1646" y="-506.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s2</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-493C48.8333,-493 80.1667,-493 80.1667,-493 85.8333,-493 91.5,-498.6667 91.5,-504.3333 91.5,-504.3333 91.5,-515.6667 91.5,-515.6667 91.5,-521.3333 85.8333,-527 80.1667,-527 80.1667,-527 48.8333,-527 48.8333,-527 43.1667,-527 37.5,-521.3333 37.5,-515.6667 37.5,-515.6667 37.5,-504.3333 37.5,-504.3333 37.5,-498.6667 43.1667,-493 48.8333,-493"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-1023 72.5,-1023 72.5,-987 128.5,-987 128.5,-1023"/>
+<text text-anchor="start" x="94.1646" y="-1001.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s2</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-988C84.8333,-988 116.1667,-988 116.1667,-988 121.8333,-988 127.5,-993.6667 127.5,-999.3333 127.5,-999.3333 127.5,-1010.6667 127.5,-1010.6667 127.5,-1016.3333 121.8333,-1022 116.1667,-1022 116.1667,-1022 84.8333,-1022 84.8333,-1022 79.1667,-1022 73.5,-1016.3333 73.5,-1010.6667 73.5,-1010.6667 73.5,-999.3333 73.5,-999.3333 73.5,-993.6667 79.1667,-988 84.8333,-988"/>
 </g>
 <!-- _arithmetic_s1&#45;&gt;_arithmetic_s2 -->
-<g id="edge3" class="edge">
+<g id="edge9" class="edge">
 <title>_arithmetic_s1&#45;&gt;_arithmetic_s2</title>
-<path fill="none" stroke="#000000" d="M64.5,-573.8015C64.5,-563.3976 64.5,-550.1215 64.5,-538.3768"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-538.1476 64.5,-528.1476 61.0001,-538.1476 68.0001,-538.1476"/>
-<text text-anchor="start" x="64.5" y="-548" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[1 + 1 == 2] &#160;&#160;</text>
+<path fill="none" stroke="#000000" d="M100.5,-1068.8015C100.5,-1058.3976 100.5,-1045.1215 100.5,-1033.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-1033.1476 100.5,-1023.1476 97.0001,-1033.1476 104.0001,-1033.1476"/>
+<text text-anchor="start" x="100.5" y="-1043" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[1 + 1 == 2] &#160;&#160;</text>
 </g>
 <!-- _arithmetic_s3 -->
-<g id="node7" class="node">
+<g id="node14" class="node">
 <title>_arithmetic_s3</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-446 36.5,-446 36.5,-410 92.5,-410 92.5,-446"/>
-<text text-anchor="start" x="58.1646" y="-424.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s3</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-411C48.8333,-411 80.1667,-411 80.1667,-411 85.8333,-411 91.5,-416.6667 91.5,-422.3333 91.5,-422.3333 91.5,-433.6667 91.5,-433.6667 91.5,-439.3333 85.8333,-445 80.1667,-445 80.1667,-445 48.8333,-445 48.8333,-445 43.1667,-445 37.5,-439.3333 37.5,-433.6667 37.5,-433.6667 37.5,-422.3333 37.5,-422.3333 37.5,-416.6667 43.1667,-411 48.8333,-411"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-941 72.5,-941 72.5,-905 128.5,-905 128.5,-941"/>
+<text text-anchor="start" x="94.1646" y="-919.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s3</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-906C84.8333,-906 116.1667,-906 116.1667,-906 121.8333,-906 127.5,-911.6667 127.5,-917.3333 127.5,-917.3333 127.5,-928.6667 127.5,-928.6667 127.5,-934.3333 121.8333,-940 116.1667,-940 116.1667,-940 84.8333,-940 84.8333,-940 79.1667,-940 73.5,-934.3333 73.5,-928.6667 73.5,-928.6667 73.5,-917.3333 73.5,-917.3333 73.5,-911.6667 79.1667,-906 84.8333,-906"/>
 </g>
 <!-- _arithmetic_s2&#45;&gt;_arithmetic_s3 -->
-<g id="edge4" class="edge">
+<g id="edge10" class="edge">
 <title>_arithmetic_s2&#45;&gt;_arithmetic_s3</title>
-<path fill="none" stroke="#000000" d="M64.5,-491.8015C64.5,-481.3976 64.5,-468.1215 64.5,-456.3768"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-456.1476 64.5,-446.1476 61.0001,-456.1476 68.0001,-456.1476"/>
-<text text-anchor="start" x="64.5" y="-466" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[42 == 52 &#45; 11 + 1] &#160;&#160;</text>
+<path fill="none" stroke="#000000" d="M100.5,-986.8015C100.5,-976.3976 100.5,-963.1215 100.5,-951.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-951.1476 100.5,-941.1476 97.0001,-951.1476 104.0001,-951.1476"/>
+<text text-anchor="start" x="100.5" y="-961" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[42 == 52 &#45; 11 + 1] &#160;&#160;</text>
 </g>
 <!-- _arithmetic_s4 -->
-<g id="node8" class="node">
+<g id="node15" class="node">
 <title>_arithmetic_s4</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-364 36.5,-364 36.5,-328 92.5,-328 92.5,-364"/>
-<text text-anchor="start" x="58.1646" y="-342.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s4</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-329C48.8333,-329 80.1667,-329 80.1667,-329 85.8333,-329 91.5,-334.6667 91.5,-340.3333 91.5,-340.3333 91.5,-351.6667 91.5,-351.6667 91.5,-357.3333 85.8333,-363 80.1667,-363 80.1667,-363 48.8333,-363 48.8333,-363 43.1667,-363 37.5,-357.3333 37.5,-351.6667 37.5,-351.6667 37.5,-340.3333 37.5,-340.3333 37.5,-334.6667 43.1667,-329 48.8333,-329"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-859 72.5,-859 72.5,-823 128.5,-823 128.5,-859"/>
+<text text-anchor="start" x="94.1646" y="-837.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s4</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-824C84.8333,-824 116.1667,-824 116.1667,-824 121.8333,-824 127.5,-829.6667 127.5,-835.3333 127.5,-835.3333 127.5,-846.6667 127.5,-846.6667 127.5,-852.3333 121.8333,-858 116.1667,-858 116.1667,-858 84.8333,-858 84.8333,-858 79.1667,-858 73.5,-852.3333 73.5,-846.6667 73.5,-846.6667 73.5,-835.3333 73.5,-835.3333 73.5,-829.6667 79.1667,-824 84.8333,-824"/>
 </g>
 <!-- _arithmetic_s3&#45;&gt;_arithmetic_s4 -->
-<g id="edge5" class="edge">
+<g id="edge11" class="edge">
 <title>_arithmetic_s3&#45;&gt;_arithmetic_s4</title>
-<path fill="none" stroke="#000000" d="M64.5,-409.8015C64.5,-399.3976 64.5,-386.1215 64.5,-374.3768"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-374.1476 64.5,-364.1476 61.0001,-374.1476 68.0001,-374.1476"/>
-<text text-anchor="start" x="64.5" y="-384" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[2 * 3 == 6] &#160;&#160;</text>
+<path fill="none" stroke="#000000" d="M100.5,-904.8015C100.5,-894.3976 100.5,-881.1215 100.5,-869.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-869.1476 100.5,-859.1476 97.0001,-869.1476 104.0001,-869.1476"/>
+<text text-anchor="start" x="100.5" y="-879" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[2 * 3 == 6] &#160;&#160;</text>
 </g>
 <!-- _arithmetic_s5 -->
-<g id="node9" class="node">
+<g id="node16" class="node">
 <title>_arithmetic_s5</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-282 36.5,-282 36.5,-246 92.5,-246 92.5,-282"/>
-<text text-anchor="start" x="58.1646" y="-260.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s5</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-247C48.8333,-247 80.1667,-247 80.1667,-247 85.8333,-247 91.5,-252.6667 91.5,-258.3333 91.5,-258.3333 91.5,-269.6667 91.5,-269.6667 91.5,-275.3333 85.8333,-281 80.1667,-281 80.1667,-281 48.8333,-281 48.8333,-281 43.1667,-281 37.5,-275.3333 37.5,-269.6667 37.5,-269.6667 37.5,-258.3333 37.5,-258.3333 37.5,-252.6667 43.1667,-247 48.8333,-247"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-777 72.5,-777 72.5,-741 128.5,-741 128.5,-777"/>
+<text text-anchor="start" x="94.1646" y="-755.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s5</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-742C84.8333,-742 116.1667,-742 116.1667,-742 121.8333,-742 127.5,-747.6667 127.5,-753.3333 127.5,-753.3333 127.5,-764.6667 127.5,-764.6667 127.5,-770.3333 121.8333,-776 116.1667,-776 116.1667,-776 84.8333,-776 84.8333,-776 79.1667,-776 73.5,-770.3333 73.5,-764.6667 73.5,-764.6667 73.5,-753.3333 73.5,-753.3333 73.5,-747.6667 79.1667,-742 84.8333,-742"/>
 </g>
 <!-- _arithmetic_s4&#45;&gt;_arithmetic_s5 -->
-<g id="edge6" class="edge">
+<g id="edge12" class="edge">
 <title>_arithmetic_s4&#45;&gt;_arithmetic_s5</title>
-<path fill="none" stroke="#000000" d="M64.5,-327.8015C64.5,-317.3976 64.5,-304.1215 64.5,-292.3768"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-292.1476 64.5,-282.1476 61.0001,-292.1476 68.0001,-292.1476"/>
-<text text-anchor="start" x="64.5" y="-302" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[21 / 3 == 7] &#160;&#160;</text>
+<path fill="none" stroke="#000000" d="M100.5,-822.8015C100.5,-812.3976 100.5,-799.1215 100.5,-787.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-787.1476 100.5,-777.1476 97.0001,-787.1476 104.0001,-787.1476"/>
+<text text-anchor="start" x="100.5" y="-797" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[21 / 3 == 7] &#160;&#160;</text>
 </g>
 <!-- _arithmetic_s6 -->
-<g id="node10" class="node">
+<g id="node17" class="node">
 <title>_arithmetic_s6</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-200 36.5,-200 36.5,-164 92.5,-164 92.5,-200"/>
-<text text-anchor="start" x="58.1646" y="-178.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s6</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-165C48.8333,-165 80.1667,-165 80.1667,-165 85.8333,-165 91.5,-170.6667 91.5,-176.3333 91.5,-176.3333 91.5,-187.6667 91.5,-187.6667 91.5,-193.3333 85.8333,-199 80.1667,-199 80.1667,-199 48.8333,-199 48.8333,-199 43.1667,-199 37.5,-193.3333 37.5,-187.6667 37.5,-187.6667 37.5,-176.3333 37.5,-176.3333 37.5,-170.6667 43.1667,-165 48.8333,-165"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-695 72.5,-695 72.5,-659 128.5,-659 128.5,-695"/>
+<text text-anchor="start" x="94.1646" y="-673.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s6</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-660C84.8333,-660 116.1667,-660 116.1667,-660 121.8333,-660 127.5,-665.6667 127.5,-671.3333 127.5,-671.3333 127.5,-682.6667 127.5,-682.6667 127.5,-688.3333 121.8333,-694 116.1667,-694 116.1667,-694 84.8333,-694 84.8333,-694 79.1667,-694 73.5,-688.3333 73.5,-682.6667 73.5,-682.6667 73.5,-671.3333 73.5,-671.3333 73.5,-665.6667 79.1667,-660 84.8333,-660"/>
 </g>
 <!-- _arithmetic_s5&#45;&gt;_arithmetic_s6 -->
-<g id="edge7" class="edge">
+<g id="edge13" class="edge">
 <title>_arithmetic_s5&#45;&gt;_arithmetic_s6</title>
-<path fill="none" stroke="#000000" d="M64.5,-245.8015C64.5,-235.3976 64.5,-222.1215 64.5,-210.3768"/>
-<polygon fill="#000000" stroke="#000000" points="68.0001,-210.1476 64.5,-200.1476 61.0001,-210.1476 68.0001,-210.1476"/>
-<text text-anchor="start" x="64.5" y="-220" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[256 == 2 ** 2 ** 3] &#160;&#160;</text>
+<path fill="none" stroke="#000000" d="M100.5,-740.8015C100.5,-730.3976 100.5,-717.1215 100.5,-705.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-705.1476 100.5,-695.1476 97.0001,-705.1476 104.0001,-705.1476"/>
+<text text-anchor="start" x="100.5" y="-715" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[256 == 2 ** 2 ** 3] &#160;&#160;</text>
 </g>
 <!-- _arithmetic_s7 -->
-<g id="node11" class="node">
+<g id="node18" class="node">
 <title>_arithmetic_s7</title>
-<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-118 36.5,-118 36.5,-82 92.5,-82 92.5,-118"/>
-<text text-anchor="start" x="58.1646" y="-96.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s7</text>
-<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-83C48.8333,-83 80.1667,-83 80.1667,-83 85.8333,-83 91.5,-88.6667 91.5,-94.3333 91.5,-94.3333 91.5,-105.6667 91.5,-105.6667 91.5,-111.3333 85.8333,-117 80.1667,-117 80.1667,-117 48.8333,-117 48.8333,-117 43.1667,-117 37.5,-111.3333 37.5,-105.6667 37.5,-105.6667 37.5,-94.3333 37.5,-94.3333 37.5,-88.6667 43.1667,-83 48.8333,-83"/>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="128.5,-613 72.5,-613 72.5,-577 128.5,-577 128.5,-613"/>
+<text text-anchor="start" x="94.1646" y="-591.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s7</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M84.8333,-578C84.8333,-578 116.1667,-578 116.1667,-578 121.8333,-578 127.5,-583.6667 127.5,-589.3333 127.5,-589.3333 127.5,-600.6667 127.5,-600.6667 127.5,-606.3333 121.8333,-612 116.1667,-612 116.1667,-612 84.8333,-612 84.8333,-612 79.1667,-612 73.5,-606.3333 73.5,-600.6667 73.5,-600.6667 73.5,-589.3333 73.5,-589.3333 73.5,-583.6667 79.1667,-578 84.8333,-578"/>
 </g>
 <!-- _arithmetic_s6&#45;&gt;_arithmetic_s7 -->
-<g id="edge8" class="edge">
+<g id="edge14" class="edge">
 <title>_arithmetic_s6&#45;&gt;_arithmetic_s7</title>
+<path fill="none" stroke="#000000" d="M100.5,-658.8015C100.5,-648.3976 100.5,-635.1215 100.5,-623.3768"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-623.1476 100.5,-613.1476 97.0001,-623.1476 104.0001,-623.1476"/>
+<text text-anchor="start" x="100.5" y="-633" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[5 % 2 == 1] &#160;&#160;</text>
+</g>
+<!-- _boolean_logic -->
+<!-- _arithmetic_s7&#45;&gt;_boolean_logic -->
+<g id="edge15" class="edge">
+<title>_arithmetic_s7&#45;&gt;_boolean_logic</title>
+<path fill="none" stroke="#000000" d="M100.5,-576.661C100.5,-569.2376 100.5,-560.2479 100.5,-551.0279"/>
+<polygon fill="#000000" stroke="#000000" points="104.0001,-550.9962 100.5,-540.9962 97.0001,-550.9963 104.0001,-550.9962"/>
+<text text-anchor="middle" x="101.8895" y="-552" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+</g>
+<!-- _boolean_logic_initial -->
+<g id="node20" class="node">
+<title>_boolean_logic_initial</title>
+<ellipse fill="#000000" stroke="#000000" stroke-width="2" cx="64.5" cy="-497.5" rx="5.5" ry="5.5"/>
+</g>
+<!-- _boolean_logic_s1 -->
+<g id="node21" class="node">
+<title>_boolean_logic_s1</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-446 36.5,-446 36.5,-410 92.5,-410 92.5,-446"/>
+<text text-anchor="start" x="58.1646" y="-424.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s1</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-411C48.8333,-411 80.1667,-411 80.1667,-411 85.8333,-411 91.5,-416.6667 91.5,-422.3333 91.5,-422.3333 91.5,-433.6667 91.5,-433.6667 91.5,-439.3333 85.8333,-445 80.1667,-445 80.1667,-445 48.8333,-445 48.8333,-445 43.1667,-445 37.5,-439.3333 37.5,-433.6667 37.5,-433.6667 37.5,-422.3333 37.5,-422.3333 37.5,-416.6667 43.1667,-411 48.8333,-411"/>
+</g>
+<!-- _boolean_logic_initial&#45;&gt;_boolean_logic_s1 -->
+<g id="edge16" class="edge">
+<title>_boolean_logic_initial&#45;&gt;_boolean_logic_s1</title>
+<path fill="none" stroke="#000000" d="M64.5,-491.5745C64.5,-483.7003 64.5,-469.2498 64.5,-456.1135"/>
+<polygon fill="#000000" stroke="#000000" points="68.0001,-456.0109 64.5,-446.011 61.0001,-456.011 68.0001,-456.0109"/>
+<text text-anchor="middle" x="65.8895" y="-466" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>
+</g>
+<!-- _boolean_logic_s2 -->
+<g id="node22" class="node">
+<title>_boolean_logic_s2</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-364 36.5,-364 36.5,-328 92.5,-328 92.5,-364"/>
+<text text-anchor="start" x="58.1646" y="-342.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s2</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-329C48.8333,-329 80.1667,-329 80.1667,-329 85.8333,-329 91.5,-334.6667 91.5,-340.3333 91.5,-340.3333 91.5,-351.6667 91.5,-351.6667 91.5,-357.3333 85.8333,-363 80.1667,-363 80.1667,-363 48.8333,-363 48.8333,-363 43.1667,-363 37.5,-357.3333 37.5,-351.6667 37.5,-351.6667 37.5,-340.3333 37.5,-340.3333 37.5,-334.6667 43.1667,-329 48.8333,-329"/>
+</g>
+<!-- _boolean_logic_s1&#45;&gt;_boolean_logic_s2 -->
+<g id="edge17" class="edge">
+<title>_boolean_logic_s1&#45;&gt;_boolean_logic_s2</title>
+<path fill="none" stroke="#000000" d="M64.5,-409.8015C64.5,-399.3976 64.5,-386.1215 64.5,-374.3768"/>
+<polygon fill="#000000" stroke="#000000" points="68.0001,-374.1476 64.5,-364.1476 61.0001,-374.1476 68.0001,-374.1476"/>
+<text text-anchor="start" x="64.5" y="-384" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[true] &#160;&#160;</text>
+</g>
+<!-- _boolean_logic_s3 -->
+<g id="node23" class="node">
+<title>_boolean_logic_s3</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-282 36.5,-282 36.5,-246 92.5,-246 92.5,-282"/>
+<text text-anchor="start" x="58.1646" y="-260.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s3</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-247C48.8333,-247 80.1667,-247 80.1667,-247 85.8333,-247 91.5,-252.6667 91.5,-258.3333 91.5,-258.3333 91.5,-269.6667 91.5,-269.6667 91.5,-275.3333 85.8333,-281 80.1667,-281 80.1667,-281 48.8333,-281 48.8333,-281 43.1667,-281 37.5,-275.3333 37.5,-269.6667 37.5,-269.6667 37.5,-258.3333 37.5,-258.3333 37.5,-252.6667 43.1667,-247 48.8333,-247"/>
+</g>
+<!-- _boolean_logic_s2&#45;&gt;_boolean_logic_s3 -->
+<g id="edge18" class="edge">
+<title>_boolean_logic_s2&#45;&gt;_boolean_logic_s3</title>
+<path fill="none" stroke="#000000" d="M64.5,-327.8015C64.5,-317.3976 64.5,-304.1215 64.5,-292.3768"/>
+<polygon fill="#000000" stroke="#000000" points="68.0001,-292.1476 64.5,-282.1476 61.0001,-292.1476 68.0001,-292.1476"/>
+<text text-anchor="start" x="64.5" y="-302" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[false or true] &#160;&#160;</text>
+</g>
+<!-- _boolean_logic_s4 -->
+<g id="node24" class="node">
+<title>_boolean_logic_s4</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-200 36.5,-200 36.5,-164 92.5,-164 92.5,-200"/>
+<text text-anchor="start" x="58.1646" y="-178.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s4</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-165C48.8333,-165 80.1667,-165 80.1667,-165 85.8333,-165 91.5,-170.6667 91.5,-176.3333 91.5,-176.3333 91.5,-187.6667 91.5,-187.6667 91.5,-193.3333 85.8333,-199 80.1667,-199 80.1667,-199 48.8333,-199 48.8333,-199 43.1667,-199 37.5,-193.3333 37.5,-187.6667 37.5,-187.6667 37.5,-176.3333 37.5,-176.3333 37.5,-170.6667 43.1667,-165 48.8333,-165"/>
+</g>
+<!-- _boolean_logic_s3&#45;&gt;_boolean_logic_s4 -->
+<g id="edge19" class="edge">
+<title>_boolean_logic_s3&#45;&gt;_boolean_logic_s4</title>
+<path fill="none" stroke="#000000" d="M64.5,-245.8015C64.5,-235.3976 64.5,-222.1215 64.5,-210.3768"/>
+<polygon fill="#000000" stroke="#000000" points="68.0001,-210.1476 64.5,-200.1476 61.0001,-210.1476 68.0001,-210.1476"/>
+<text text-anchor="start" x="64.5" y="-220" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[true and not false] &#160;&#160;</text>
+</g>
+<!-- _boolean_logic_s5 -->
+<g id="node25" class="node">
+<title>_boolean_logic_s5</title>
+<polygon fill="transparent" stroke="transparent" stroke-width="2" points="92.5,-118 36.5,-118 36.5,-82 92.5,-82 92.5,-118"/>
+<text text-anchor="start" x="58.1646" y="-96.2" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#000000">s5</text>
+<path fill="none" stroke="#000000" stroke-width="2" d="M48.8333,-83C48.8333,-83 80.1667,-83 80.1667,-83 85.8333,-83 91.5,-88.6667 91.5,-94.3333 91.5,-94.3333 91.5,-105.6667 91.5,-105.6667 91.5,-111.3333 85.8333,-117 80.1667,-117 80.1667,-117 48.8333,-117 48.8333,-117 43.1667,-117 37.5,-111.3333 37.5,-105.6667 37.5,-105.6667 37.5,-94.3333 37.5,-94.3333 37.5,-88.6667 43.1667,-83 48.8333,-83"/>
+</g>
+<!-- _boolean_logic_s4&#45;&gt;_boolean_logic_s5 -->
+<g id="edge20" class="edge">
+<title>_boolean_logic_s4&#45;&gt;_boolean_logic_s5</title>
 <path fill="none" stroke="#000000" d="M64.5,-163.8015C64.5,-153.3976 64.5,-140.1215 64.5,-128.3768"/>
 <polygon fill="#000000" stroke="#000000" points="68.0001,-128.1476 64.5,-118.1476 61.0001,-128.1476 68.0001,-128.1476"/>
-<text text-anchor="start" x="64.5" y="-138" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[5 % 2 == 1] &#160;&#160;</text>
+<text text-anchor="start" x="64.5" y="-138" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000">[not ((false or true) and false)] &#160;&#160;</text>
 </g>
-<!-- _arithmetic_s7&#45;&gt;_final -->
-<g id="edge9" class="edge">
-<title>_arithmetic_s7&#45;&gt;_final</title>
+<!-- _boolean_logic_s5&#45;&gt;_final -->
+<g id="edge21" class="edge">
+<title>_boolean_logic_s5&#45;&gt;_final</title>
 <path fill="none" stroke="#000000" d="M64.5,-81.7521C64.5,-74.0806 64.5,-64.9093 64.5,-56.1197"/>
 <polygon fill="#000000" stroke="#000000" points="68.0001,-56.0895 64.5,-46.0895 61.0001,-56.0895 68.0001,-56.0895"/>
 <text text-anchor="middle" x="65.8895" y="-57" font-family="Helvetica,sans-Serif" font-size="10.00" fill="#000000"> </text>

+ 37 - 2
test/new_test_files/features/expressions/test_expressions.xml

@@ -6,7 +6,25 @@
         big_step_maximality="take_many"
         combo_step_maximality="*"/>
     <tree>
-      <state initial="arithmetic">
+      <state initial="comparisons">
+
+        <state id="comparisons" initial="s1">
+          <state id="s1">
+            <transition cond="1 == 1" target="../s2"/>
+          </state>
+          <state id="s2">
+            <transition cond="1 != 2" target="../s3"/>
+          </state>
+          <state id="s3">
+            <transition cond="1 &lt; 2" target="../s4"/>
+          </state>
+          <state id="s4">
+            <transition cond="2 &gt; 1" target="../s5"/>
+          </state>
+          <state id="s5">
+            <transition target="/arithmetic"/>
+          </state>
+        </state>
 
         <state id="arithmetic" initial="s1">
           <state id="s1">
@@ -28,9 +46,26 @@
             <transition cond="5 % 2 == 1" target="../s7"/>
           </state>
           <state id="s7">
-            <transition target="/final"/>
+            <transition target="/boolean_logic"/>
           </state>
+        </state>
 
+        <state id="boolean_logic" initial="s1">
+          <state id="s1">
+            <transition cond="True" target="../s2"/>
+          </state>
+          <state id="s2">
+            <transition cond="False or True" target="../s3"/>
+          </state>
+          <state id="s3">
+            <transition cond="True and not False" target="../s4"/>
+          </state>
+          <state id="s4">
+            <transition cond="not ((False or True) and False)" target="../s5"/>
+          </state>
+          <state id="s5">
+            <transition target="/final"/>
+          </state>
         </state>
 
         <state id="final">