From 67195be048d9ec4b2d19890abd61700ff7b112d1 Mon Sep 17 00:00:00 2001
From: Michael Leuschel <leuschel@uni-duesseldorf.de>
Date: Thu, 30 Apr 2020 10:57:35 +0200
Subject: [PATCH] add Grammar G2

---
 info4/kapitel-1/Grammatiken.ipynb | 550 ++++++++++++++++++++++++++----
 1 file changed, 482 insertions(+), 68 deletions(-)

diff --git a/info4/kapitel-1/Grammatiken.ipynb b/info4/kapitel-1/Grammatiken.ipynb
index afe1ca1..92625bb 100644
--- a/info4/kapitel-1/Grammatiken.ipynb
+++ b/info4/kapitel-1/Grammatiken.ipynb
@@ -161,25 +161,62 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 44,
+   "execution_count": 75,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Loaded machine: Grammatik"
+      ]
+     },
+     "execution_count": 75,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "::load\n",
+    "MACHINE Grammatik\n",
+    "SETS ΣN = {a,b,c, S}\n",
+    "CONSTANTS Σ, N, P\n",
+    "ABSTRACT_CONSTANTS abl\n",
+    "PROPERTIES\n",
+    "   Σ = {a,b,c} ∧\n",
+    "   Σ ∩ N = {} ∧\n",
+    "   Σ ∪ N = ΣN ∧\n",
+    "   S ∈ N ∧\n",
+    "   P ⊆ seq1(ΣN) × seq(ΣN) ∧\n",
+    "   \n",
+    "   // Die Beispiel Grammatik G1 von den Folien\n",
+    "   P = { [S] ↦ [],\n",
+    "         [S] ↦ [a,S,b]\n",
+    "       }\n",
+    "       \n",
+    "   ∧ \n",
+    "   abl = {u,v | ∃(x,z,p,q).( p↦q ∈ P ∧ u = x^p^z ∧ v = x^q^z )}\n",
+    "DEFINITIONS SET_PREF_PP_SEQUENCES == TRUE\n",
+    "END"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 76,
    "metadata": {},
    "outputs": [
     {
      "data": {
-      "text/markdown": [
-       "$\\newcommand{\\qdot}{\\mathord{\\mkern1mu\\cdot\\mkern1mu}}/*@symbolic*/ \\{\\mathit{u},\\mathit{v}\\mid\\exists(\\mathit{x},\\mathit{z},\\mathit{p},\\mathit{q})\\qdot(\\mathit{p} \\mapsto \\mathit{q} \\in \\{([S]\\mapsto []),([S]\\mapsto [a,\\mathit{S},b])\\} \\land \\mathit{u} = \\mathit{x} ⌒ \\mathit{p} ⌒ \\mathit{z} \\land \\mathit{v} = \\mathit{x} ⌒ \\mathit{q} ⌒ \\mathit{z})\\}$"
-      ],
       "text/plain": [
-       "/*@symbolic*/ {u,v∣∃(x,z,p,q)·(p ↦ q ∈ {([S]↦[]),([S]↦[a,S,b])} ∧ u = x ⌒ p ⌒ z ∧ v = x ⌒ q ⌒ z)}"
+       "Machine constants set up using operation 0: $setup_constants()"
       ]
      },
-     "execution_count": 44,
+     "execution_count": 76,
      "metadata": {},
      "output_type": "execute_result"
     }
    ],
    "source": [
-    ":let abl {u,v | ∃(x,z,p,q).( p↦q ∈ P ∧ u = x^p^z ∧ v = x^q^z )}"
+    ":constants"
    ]
   },
   {
@@ -604,67 +641,7 @@
     }
    ],
    "source": [
-    "UNION(i).(i:0..4|iterate(abl,i)[ {[S]} ]) /\\ seq(Σ)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 62,
-   "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "Loaded machine: Grammatik"
-      ]
-     },
-     "execution_count": 62,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "source": [
-    "::load\n",
-    "MACHINE Grammatik\n",
-    "SETS ΣN = {a,b,c, S}\n",
-    "CONSTANTS Σ, N, P\n",
-    "ABSTRACT_CONSTANTS abl\n",
-    "PROPERTIES\n",
-    "   Σ = {a,b,c} ∧\n",
-    "   Σ ∩ N = {} ∧\n",
-    "   Σ ∪ N = ΣN ∧\n",
-    "   S ∈ N ∧\n",
-    "   P ⊆ seq1(ΣN) × seq(ΣN) ∧\n",
-    "   \n",
-    "   // Die Beispiel Grammatik G1 von den Folien\n",
-    "   P = { [S] ↦ [],\n",
-    "         [S] ↦ [a,S,b]\n",
-    "       }\n",
-    "       \n",
-    "   ∧ \n",
-    "   abl = {u,v | ∃(x,z,p,q).( p↦q ∈ P ∧ u = x^p^z ∧ v = x^q^z )}\n",
-    "DEFINITIONS SET_PREF_PP_SEQUENCES == TRUE\n",
-    "END"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 63,
-   "metadata": {},
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "Machine constants set up using operation 0: $setup_constants()"
-      ]
-     },
-     "execution_count": 63,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "source": [
-    ":constants"
+    "UNION(i).(i:0..4|iterate(abl,i)[ {[S]} ]) ∩ seq(Σ)"
    ]
   },
   {
@@ -845,6 +822,443 @@
     ":dot expr_as_graph (\"abl\",SF <| abl |> SF)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Die Grammatik G2 können wir wie folgt umsetzen:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 79,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Loaded machine: Grammatik2"
+      ]
+     },
+     "execution_count": 79,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "::load\n",
+    "MACHINE Grammatik2\n",
+    "SETS ΣN = {a,b,c, S, B,C}\n",
+    "CONSTANTS Σ, N, P\n",
+    "ABSTRACT_CONSTANTS abl\n",
+    "PROPERTIES\n",
+    "   Σ = {a,b,c} ∧\n",
+    "   Σ ∩ N = {} ∧\n",
+    "   Σ ∪ N = ΣN ∧\n",
+    "   S ∈ N ∧\n",
+    "   P ⊆ seq1(ΣN) × seq(ΣN) ∧\n",
+    "   \n",
+    "   // Die Beispiel Grammatik G1 von den Folien\n",
+    "   P = { [S] ↦ [a,B,C],\n",
+    "         [S] ↦ [a,S,B,C],\n",
+    "         [C,B] ↦ [B,C],\n",
+    "         [a,B] ↦ [a,b],\n",
+    "         [b,B] ↦ [b,b],\n",
+    "         [b,C] ↦ [b,c],\n",
+    "         [c,C] ↦ [c,c]\n",
+    "       }\n",
+    "       \n",
+    "   ∧ \n",
+    "   abl = {u,v | ∃(x,z,p,q).( p↦q ∈ P ∧ u = x^p^z ∧ v = x^q^z )}\n",
+    "DEFINITIONS SET_PREF_PP_SEQUENCES == TRUE\n",
+    "END"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 80,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Machine constants set up using operation 0: $setup_constants()"
+      ]
+     },
+     "execution_count": 80,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    ":constants"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 81,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/markdown": [
+       "$\\{[S],[a,\\mathit{b},c],[a,\\mathit{b},C],[a,\\mathit{S},\\mathit{B},C],[a,\\mathit{B},C],[a,\\mathit{a},\\mathit{b},\\mathit{c},\\mathit{B},C],[a,\\mathit{a},\\mathit{b},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{b},\\mathit{B},\\mathit{C},C],[a,\\mathit{a},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{B},\\mathit{B},\\mathit{C},C],[a,\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{B},\\mathit{C},C],[a,\\mathit{a},\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{B},\\mathit{C},C],[a,\\mathit{a},\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{B},\\mathit{C},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{B},\\mathit{B},\\mathit{C},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{b},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{B},\\mathit{C},C],[a,\\mathit{a},\\mathit{a},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{a},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},C],[a,\\mathit{a},\\mathit{a},\\mathit{a},\\mathit{S},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},\\mathit{C},\\mathit{B},C]\\}$"
+      ],
+      "text/plain": [
+       "{[S],[a,b,c],[a,b,C],[a,S,B,C],[a,B,C],[a,a,b,c,B,C],[a,a,b,C,B,C],[a,a,b,B,C,C],[a,a,B,C,B,C],[a,a,B,B,C,C],[a,a,S,B,C,B,C],[a,a,S,B,B,C,C],[a,a,a,S,B,C,B,B,C,C],[a,a,a,S,B,B,C,C,B,C],[a,a,a,S,B,C,B,C,B,C],[a,a,a,B,B,C,C,B,C],[a,a,a,b,C,B,C,B,C],[a,a,a,B,C,B,B,C,C],[a,a,a,B,C,B,C,B,C],[a,a,a,a,B,C,B,C,B,C,B,C],[a,a,a,a,S,B,C,B,C,B,C,B,C]}"
+      ]
+     },
+     "execution_count": 81,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    ":let SF UNION(i).(i:0..4|iterate(abl,i)[ {[S]} ])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 84,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/markdown": [
+       "$\\{[a,\\mathit{b},c]\\}$"
+      ],
+      "text/plain": [
+       "{[a,b,c]}"
+      ]
+     },
+     "execution_count": 84,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "SF ∩ seq(Σ)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 82,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Preference changed: DOT_DECOMPOSE_NODES = FALSE\n"
+      ]
+     },
+     "execution_count": 82,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    ":pref DOT_DECOMPOSE_NODES=FALSE"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 83,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "image/svg+xml": [
+       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
+       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
+       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
+       "<!-- Generated by graphviz version 2.28.0 (20110509.1545)\n",
+       " -->\n",
+       "<!-- Title: state Pages: 1 -->\n",
+       "<svg width=\"1329pt\" height=\"404pt\"\n",
+       " viewBox=\"0.00 0.00 1329.00 404.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
+       "<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 400)\">\n",
+       "<title>state</title>\n",
+       "<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-400 1326,-400 1326,5 -4,5\"/>\n",
+       "<!-- [a,a,a,B,C,B,C,B,C] -->\n",
+       "<g id=\"node1\" class=\"node\"><title>[a,a,a,B,C,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1031.49,-126 904.511,-126 904.511,-90 1031.49,-90 1031.49,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"968\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,B,C,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,B,C,B,B,C,C] -->\n",
+       "<g id=\"node3\" class=\"node\"><title>[a,a,a,B,C,B,B,C,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1031.49,-36 904.511,-36 904.511,-0 1031.49,-0 1031.49,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"968\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,B,C,B,B,C,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,B,C,B,B,C,C] -->\n",
+       "<g id=\"edge2\" class=\"edge\"><title>[a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,B,C,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M968,-89.614C968,-77.2403 968,-60.3686 968,-46.2198\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"971.5,-46.0504 968,-36.0504 964.5,-46.0504 971.5,-46.0504\"/>\n",
+       "<text text-anchor=\"middle\" x=\"976.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,b,C,B,C,B,C] -->\n",
+       "<g id=\"node5\" class=\"node\"><title>[a,a,a,b,C,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1175.24,-36 1050.76,-36 1050.76,-0 1175.24,-0 1175.24,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1113\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,b,C,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,b,C,B,C,B,C] -->\n",
+       "<g id=\"edge4\" class=\"edge\"><title>[a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,b,C,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M996.302,-89.8238C1019.06,-76.0139 1051.2,-56.5033 1076,-41.4559\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"1078.04,-44.3132 1084.77,-36.1329 1074.4,-38.3291 1078.04,-44.3132\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1062.55\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,B,B,C,C,B,C] -->\n",
+       "<g id=\"node7\" class=\"node\"><title>[a,a,a,B,B,C,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1321.49,-36 1194.51,-36 1194.51,-0 1321.49,-0 1321.49,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1258\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,B,B,C,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,B,B,C,C,B,C] -->\n",
+       "<g id=\"edge6\" class=\"edge\"><title>[a,a,a,B,C,B,C,B,C]&#45;&gt;[a,a,a,B,B,C,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M1024.26,-89.9284C1072.28,-75.3554 1141.41,-54.379 1192.03,-39.0179\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"1193.34,-42.2771 1201.9,-36.0241 1191.31,-35.5787 1193.34,-42.2771\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1147.55\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,C,B,C] -->\n",
+       "<g id=\"node8\" class=\"node\"><title>[a,a,a,S,B,C,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"716.45,-126 577.55,-126 577.55,-90 716.45,-90 716.45,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"647\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,S,B,C,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,a,S,B,C,B,C,B,C,B,C] -->\n",
+       "<g id=\"node10\" class=\"node\"><title>[a,a,a,a,S,B,C,B,C,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"546.992,-36 373.008,-36 373.008,-0 546.992,-0 546.992,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"460\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,a,S,B,C,B,C,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,a,S,B,C,B,C,B,C,B,C] -->\n",
+       "<g id=\"edge8\" class=\"edge\"><title>[a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,a,S,B,C,B,C,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M610.501,-89.8238C580.511,-75.7111 537.87,-55.6449 505.629,-40.4725\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"506.946,-37.224 496.407,-36.1329 503.965,-43.5578 506.946,-37.224\"/>\n",
+       "<text text-anchor=\"middle\" x=\"579.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,a,B,C,B,C,B,C,B,C] -->\n",
+       "<g id=\"node12\" class=\"node\"><title>[a,a,a,a,B,C,B,C,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"728.529,-36 565.471,-36 565.471,-0 728.529,-0 728.529,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"647\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,a,B,C,B,C,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,a,B,C,B,C,B,C,B,C] -->\n",
+       "<g id=\"edge10\" class=\"edge\"><title>[a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,a,B,C,B,C,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M647,-89.614C647,-77.2403 647,-60.3686 647,-46.2198\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"650.5,-46.0504 647,-36.0504 643.5,-46.0504 650.5,-46.0504\"/>\n",
+       "<text text-anchor=\"middle\" x=\"655.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,B,C,C,B,C] -->\n",
+       "<g id=\"node14\" class=\"node\"><title>[a,a,a,S,B,B,C,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"354.45,-36 215.55,-36 215.55,-0 354.45,-0 354.45,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"285\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,S,B,B,C,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,S,B,B,C,C,B,C] -->\n",
+       "<g id=\"edge12\" class=\"edge\"><title>[a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,S,B,B,C,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M577.631,-90.1368C516.733,-75.3329 428.176,-53.8051 364.449,-38.3135\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"364.986,-34.8422 354.442,-35.8809 363.332,-41.6441 364.986,-34.8422\"/>\n",
+       "<text text-anchor=\"middle\" x=\"507.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,B,C,C] -->\n",
+       "<g id=\"node16\" class=\"node\"><title>[a,a,a,S,B,C,B,B,C,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"885.45,-36 746.55,-36 746.55,-0 885.45,-0 885.45,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"816\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,a,S,B,C,B,B,C,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,S,B,C,B,B,C,C] -->\n",
+       "<g id=\"edge14\" class=\"edge\"><title>[a,a,a,S,B,C,B,C,B,C]&#45;&gt;[a,a,a,S,B,C,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M679.986,-89.8238C706.856,-75.8322 744.964,-55.9889 774.011,-40.8643\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"775.844,-43.8558 783.097,-36.1329 772.611,-37.647 775.844,-43.8558\"/>\n",
+       "<text text-anchor=\"middle\" x=\"755.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,B,C,C] -->\n",
+       "<g id=\"node17\" class=\"node\"><title>[a,a,S,B,B,C,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"880.41,-126 777.59,-126 777.59,-90 880.41,-90 880.41,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"829\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,S,B,B,C,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,B,C,C]&#45;&gt;[a,a,a,B,C,B,B,C,C] -->\n",
+       "<g id=\"edge16\" class=\"edge\"><title>[a,a,S,B,B,C,C]&#45;&gt;[a,a,a,B,C,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M856.131,-89.8238C877.848,-76.0745 908.492,-56.6744 932.217,-41.6541\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"934.361,-44.4392 940.938,-36.1329 930.617,-38.5248 934.361,-44.4392\"/>\n",
+       "<text text-anchor=\"middle\" x=\"919.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,B,C,C]&#45;&gt;[a,a,a,S,B,C,B,B,C,C] -->\n",
+       "<g id=\"edge18\" class=\"edge\"><title>[a,a,S,B,B,C,C]&#45;&gt;[a,a,a,S,B,C,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M826.432,-89.614C824.604,-77.2403 822.111,-60.3686 820.021,-46.2198\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"823.443,-45.4315 818.519,-36.0504 816.518,-46.4546 823.443,-45.4315\"/>\n",
+       "<text text-anchor=\"middle\" x=\"832.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,C,B,C] -->\n",
+       "<g id=\"node20\" class=\"node\"><title>[a,a,S,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"880.41,-216 777.59,-216 777.59,-180 880.41,-180 880.41,-216\"/>\n",
+       "<text text-anchor=\"middle\" x=\"829\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,S,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,C,B,C]&#45;&gt;[a,a,a,B,C,B,C,B,C] -->\n",
+       "<g id=\"edge20\" class=\"edge\"><title>[a,a,S,B,C,B,C]&#45;&gt;[a,a,a,B,C,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M856.131,-179.824C877.848,-166.075 908.492,-146.674 932.217,-131.654\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"934.361,-134.439 940.938,-126.133 930.617,-128.525 934.361,-134.439\"/>\n",
+       "<text text-anchor=\"middle\" x=\"919.553\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,C,B,C]&#45;&gt;[a,a,a,S,B,C,B,C,B,C] -->\n",
+       "<g id=\"edge22\" class=\"edge\"><title>[a,a,S,B,C,B,C]&#45;&gt;[a,a,a,S,B,C,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M793.477,-179.824C764.414,-165.772 723.144,-145.817 691.814,-130.668\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"692.96,-127.335 682.434,-126.133 689.913,-133.637 692.96,-127.335\"/>\n",
+       "<text text-anchor=\"middle\" x=\"763.553\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,S,B,C,B,C]&#45;&gt;[a,a,S,B,B,C,C] -->\n",
+       "<g id=\"edge24\" class=\"edge\"><title>[a,a,S,B,C,B,C]&#45;&gt;[a,a,S,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M829,-179.614C829,-167.24 829,-150.369 829,-136.22\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"832.5,-136.05 829,-126.05 825.5,-136.05 832.5,-136.05\"/>\n",
+       "<text text-anchor=\"middle\" x=\"837.553\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,B,B,C,C] -->\n",
+       "<g id=\"node24\" class=\"node\"><title>[a,a,B,B,C,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"91.9491,-126 0.0508791,-126 0.0508791,-90 91.9491,-90 91.9491,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"46\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,B,B,C,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,b,B,C,C] -->\n",
+       "<g id=\"node26\" class=\"node\"><title>[a,a,b,B,C,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"92.1953,-36 1.80466,-36 1.80466,-0 92.1953,-0 92.1953,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"47\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,b,B,C,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,B,B,C,C]&#45;&gt;[a,a,b,B,C,C] -->\n",
+       "<g id=\"edge26\" class=\"edge\"><title>[a,a,B,B,C,C]&#45;&gt;[a,a,b,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M46.1976,-89.614C46.3382,-77.2403 46.5299,-60.3686 46.6907,-46.2198\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"50.1923,-46.0896 46.8062,-36.0504 43.1927,-46.01 50.1923,-46.0896\"/>\n",
+       "<text text-anchor=\"middle\" x=\"55.5526\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,B,C,B,C] -->\n",
+       "<g id=\"node27\" class=\"node\"><title>[a,a,B,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"200.949,-216 109.051,-216 109.051,-180 200.949,-180 200.949,-216\"/>\n",
+       "<text text-anchor=\"middle\" x=\"155\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,B,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,B,C,B,C]&#45;&gt;[a,a,B,B,C,C] -->\n",
+       "<g id=\"edge28\" class=\"edge\"><title>[a,a,B,C,B,C]&#45;&gt;[a,a,B,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M133.725,-179.824C117.07,-166.377 93.72,-147.526 75.2974,-132.653\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"77.2008,-129.691 67.2214,-126.133 72.8036,-135.138 77.2008,-129.691\"/>\n",
+       "<text text-anchor=\"middle\" x=\"119.553\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,b,C,B,C] -->\n",
+       "<g id=\"node30\" class=\"node\"><title>[a,a,b,C,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"200.195,-126 109.805,-126 109.805,-90 200.195,-90 200.195,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"155\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,b,C,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,B,C,B,C]&#45;&gt;[a,a,b,C,B,C] -->\n",
+       "<g id=\"edge30\" class=\"edge\"><title>[a,a,B,C,B,C]&#45;&gt;[a,a,b,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M155,-179.614C155,-167.24 155,-150.369 155,-136.22\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"158.5,-136.05 155,-126.05 151.5,-136.05 158.5,-136.05\"/>\n",
+       "<text text-anchor=\"middle\" x=\"163.553\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,b,C,B,C]&#45;&gt;[a,a,b,B,C,C] -->\n",
+       "<g id=\"edge32\" class=\"edge\"><title>[a,a,b,C,B,C]&#45;&gt;[a,a,b,B,C,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M133.92,-89.8238C117.418,-76.3774 94.2822,-57.5263 76.0286,-42.6529\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"77.9899,-39.7363 68.0267,-36.1329 73.5682,-45.163 77.9899,-39.7363\"/>\n",
+       "<text text-anchor=\"middle\" x=\"119.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,a,b,c,B,C] -->\n",
+       "<g id=\"node33\" class=\"node\"><title>[a,a,b,c,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"197.353,-36 110.647,-36 110.647,-0 197.353,-0 197.353,-36\"/>\n",
+       "<text text-anchor=\"middle\" x=\"154\" y=\"-13.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,a,b,c,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,a,b,C,B,C]&#45;&gt;[a,a,b,c,B,C] -->\n",
+       "<g id=\"edge34\" class=\"edge\"><title>[a,a,b,C,B,C]&#45;&gt;[a,a,b,c,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M154.802,-89.614C154.662,-77.2403 154.47,-60.3686 154.309,-46.2198\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"157.807,-46.01 154.194,-36.0504 150.808,-46.0896 157.807,-46.01\"/>\n",
+       "<text text-anchor=\"middle\" x=\"163.553\" y=\"-58.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,B,C] -->\n",
+       "<g id=\"node34\" class=\"node\"><title>[a,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"962.406,-306 905.594,-306 905.594,-270 962.406,-270 962.406,-306\"/>\n",
+       "<text text-anchor=\"middle\" x=\"934\" y=\"-283.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,b,C] -->\n",
+       "<g id=\"node36\" class=\"node\"><title>[a,b,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1035.15,-216 980.845,-216 980.845,-180 1035.15,-180 1035.15,-216\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1008\" y=\"-193.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,b,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,B,C]&#45;&gt;[a,b,C] -->\n",
+       "<g id=\"edge36\" class=\"edge\"><title>[a,B,C]&#45;&gt;[a,b,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M948.62,-269.614C959.637,-256.512 974.895,-238.368 987.185,-223.753\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"989.905,-225.957 993.662,-216.05 984.547,-221.451 989.905,-225.957\"/>\n",
+       "<text text-anchor=\"middle\" x=\"986.553\" y=\"-238.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,b,c] -->\n",
+       "<g id=\"node41\" class=\"node\"><title>[a,b,c]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"1104,-126 1050,-126 1050,-90 1104,-90 1104,-126\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1077\" y=\"-103.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,b,c]</text>\n",
+       "</g>\n",
+       "<!-- [a,b,C]&#45;&gt;[a,b,c] -->\n",
+       "<g id=\"edge42\" class=\"edge\"><title>[a,b,C]&#45;&gt;[a,b,c]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M1021.63,-179.614C1031.81,-166.634 1045.87,-148.704 1057.27,-134.16\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"1060.21,-136.079 1063.63,-126.05 1054.71,-131.76 1060.21,-136.079\"/>\n",
+       "<text text-anchor=\"middle\" x=\"1057.55\" y=\"-148.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,S,B,C] -->\n",
+       "<g id=\"node37\" class=\"node\"><title>[a,S,B,C]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"863.37,-306 794.63,-306 794.63,-270 863.37,-270 863.37,-306\"/>\n",
+       "<text text-anchor=\"middle\" x=\"829\" y=\"-283.8\" font-family=\"Times,serif\" font-size=\"14.00\">[a,S,B,C]</text>\n",
+       "</g>\n",
+       "<!-- [a,S,B,C]&#45;&gt;[a,a,S,B,C,B,C] -->\n",
+       "<g id=\"edge38\" class=\"edge\"><title>[a,S,B,C]&#45;&gt;[a,a,S,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M829,-269.614C829,-257.24 829,-240.369 829,-226.22\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"832.5,-226.05 829,-216.05 825.5,-226.05 832.5,-226.05\"/>\n",
+       "<text text-anchor=\"middle\" x=\"837.553\" y=\"-238.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [a,S,B,C]&#45;&gt;[a,a,B,C,B,C] -->\n",
+       "<g id=\"edge40\" class=\"edge\"><title>[a,S,B,C]&#45;&gt;[a,a,B,C,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M794.65,-282.515C685.626,-268.281 346.654,-224.023 211.481,-206.374\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"211.708,-202.874 201.339,-205.05 210.802,-209.816 211.708,-202.874\"/>\n",
+       "<text text-anchor=\"middle\" x=\"561.553\" y=\"-238.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [S] -->\n",
+       "<g id=\"node42\" class=\"node\"><title>[S]</title>\n",
+       "<polygon fill=\"#cae1ff\" stroke=\"#cae1ff\" points=\"916,-396 862,-396 862,-360 916,-360 916,-396\"/>\n",
+       "<text text-anchor=\"middle\" x=\"889\" y=\"-373.8\" font-family=\"Times,serif\" font-size=\"14.00\">[S]</text>\n",
+       "</g>\n",
+       "<!-- [S]&#45;&gt;[a,B,C] -->\n",
+       "<g id=\"edge44\" class=\"edge\"><title>[S]&#45;&gt;[a,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M897.891,-359.614C904.404,-346.876 913.355,-329.372 920.715,-314.979\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"923.844,-316.547 925.281,-306.05 917.612,-313.36 923.844,-316.547\"/>\n",
+       "<text text-anchor=\"middle\" x=\"924.553\" y=\"-328.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "<!-- [S]&#45;&gt;[a,S,B,C] -->\n",
+       "<g id=\"edge46\" class=\"edge\"><title>[S]&#45;&gt;[a,S,B,C]</title>\n",
+       "<path fill=\"none\" stroke=\"firebrick\" d=\"M877.146,-359.614C868.378,-346.755 856.299,-329.038 846.433,-314.568\"/>\n",
+       "<polygon fill=\"firebrick\" stroke=\"firebrick\" points=\"849.15,-312.341 840.625,-306.05 843.367,-316.284 849.15,-312.341\"/>\n",
+       "<text text-anchor=\"middle\" x=\"873.553\" y=\"-328.8\" font-family=\"Times,serif\" font-size=\"14.00\">abl</text>\n",
+       "</g>\n",
+       "</g>\n",
+       "</svg>"
+      ],
+      "text/plain": [
+       "<Dot visualization: expr_as_graph [SFSF={[S],[a,b,c],[a,b,C],[a,S,B,C],[a,B,C],[a,a,b,c,B,C],[a,a,b,C,B,C],[a,a,b,B,C,C],[a,a,B,C,B,C],[a,a,B,B,C,C],[a,a,S,B,C,B,C],[a,a,S,B,B,C,C],[a,a,a,S,B,C,B,B,C,C],[a,a,a,S,B,B,C,C,B,C],[a,a,a,S,B,C,B,C,B,C],[a,a,a,B,B,C,C,B,C],[a,a,a,b,C,B,C,B,C],[a,a,a,B,C,B,B,C,C],[a,a,a,B,C,B,C,B,C],[a,a,a,a,B,C,B,C,B,C,B,C],[a,a,a,a,S,B,C,B,C,B,C,B,C]}(\"abl\",SF<|abl|>SF)]>"
+      ]
+     },
+     "execution_count": 83,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    ":dot expr_as_graph (\"abl\",SF <| abl |> SF)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 87,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/markdown": [
+       "$\\{[a,\\mathit{b},c],[a,\\mathit{a},\\mathit{b},\\mathit{b},\\mathit{c},c]\\}$"
+      ],
+      "text/plain": [
+       "{[a,b,c],[a,a,b,b,c,c]}"
+      ]
+     },
+     "execution_count": 87,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": []
+  },
   {
    "cell_type": "code",
    "execution_count": null,
-- 
GitLab