From c5ed660943bd41a88f481f199adaa7be5bf0a1aa Mon Sep 17 00:00:00 2001 From: Chris <Christopher.Happe@uni-duesseldorf.de> Date: Sat, 31 Oct 2020 11:21:27 +0100 Subject: [PATCH] =?UTF-8?q?Visualisierung=20komplexer=20Automaten=20=C3=BC?= =?UTF-8?q?berarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- info4/kapitel-2/Abschlusseigenschaften.ipynb | 672 +++++++++++++------ info4/kapitel-2/img/konkatenation_M1.svg | 1 + info4/kapitel-2/img/konkatenation_M2.svg | 1 + 3 files changed, 486 insertions(+), 188 deletions(-) create mode 100644 info4/kapitel-2/img/konkatenation_M1.svg create mode 100644 info4/kapitel-2/img/konkatenation_M2.svg diff --git a/info4/kapitel-2/Abschlusseigenschaften.ipynb b/info4/kapitel-2/Abschlusseigenschaften.ipynb index 2e37762..85fa82c 100644 --- a/info4/kapitel-2/Abschlusseigenschaften.ipynb +++ b/info4/kapitel-2/Abschlusseigenschaften.ipynb @@ -609,6 +609,22 @@ ":constants" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<table align=\"LEFT\">\n", + " <tr>\n", + " <td width=50%>Der Automat $M_1$</td>\n", + " <td width=50%>Der Automat $M_2$</td>\n", + " </tr>\n", + " <tr>\n", + " <td width=50%><img src=\"./img/konkatenation_M1.svg\" width=100%></td>\n", + " <td width=50%><img src=\"./img/konkatenation_M2.svg\" width=100%></td>\n", + " </tr>\n", + "</table>" + ] + }, { "cell_type": "code", "execution_count": 9, @@ -1081,7 +1097,7 @@ "MACHINE NFA\n", "SETS\n", " Z = {z10,z11, z12, z20,z21,z22}\n", - "CONSTANTS Σ, M, Z_gesamt, δ, S, F, f,\n", + "CONSTANTS Σ, M, Z_gesamt, δ, S, F,\n", " M1, Z1, δ1, S1, F1,\n", " M2, Z2, δ2, S2, F2\n", " \n", @@ -1103,16 +1119,16 @@ " (z11,0)↦{z12}, (z11,1)↦{z11},\n", " (z12,0)↦{z12}, (z12,1)↦{z11}} ∧\n", " \n", - " // Der Automat M2 (L(M2)={1^n|n∈ℕ_0}):\n", + " // Der Automat M2 (L(M2)={0^n|n∈ℕ_0}):\n", " M2 = (Σ, Z2, δ2, S2, F2) ∧\n", " Z2 ⊆ Z ∧\n", " δ2 ∈ (Z2×Σ) → ℙ(Z2) ∧\n", " S2 ⊆ Z2 ∧ F2 ⊆ Z2\n", " ∧\n", " Z2 = {z20,z21,z22} ∧\n", - " S2 = {z20, z21} ∧ F2 = {z20, z21} ∧\n", - " δ2 = { (z20,0)↦{z22}, (z20,1)↦{z21},\n", - " (z21,0)↦{z22}, (z21,1)↦{z21},\n", + " S2 = {z20} ∧ F2 = {z20, z21} ∧\n", + " δ2 = { (z20,0)↦{z21}, (z20,1)↦{z22},\n", + " (z21,0)↦{z21}, (z21,1)↦{z22},\n", " (z22,0)↦{z22}, (z22,1)↦{z22}} ∧\n", "\n", " //Der Automat nach \"Grundkurs Theoretische Informatik\"\n", @@ -1124,15 +1140,17 @@ " ∃zustand1,zustand2,symbol,menge.(\n", " x=((zustand1, zustand2), symbol)↦menge ∧\n", " zustand1∈Z1 ∧ zustand2∈Z2 ∧ symbol∈Σ ∧\n", - " menge = δ1(zustand1, symbol)*δ2(zustand2, symbol))} ∧\n", - " \n", - " //Eine Hilfsfunktion zur Visualisierung\n", - " f ∈ seq(Z_gesamt) ∧ ran(f) = Z_gesamt \n", + " menge = δ1(zustand1, symbol)*δ2(zustand2, symbol))}\n", + "\n", "DEFINITIONS // Für den Zustandsgraphen:\n", - " ANIMATION_FUNCTION1 == {r,c,i| r∈dom(f) ∧ c=0 ∧ i=f(r)};\n", - " ANIMATION_FUNCTION2 == {(0,0,\"Zustand\"),(0,1,\"δ(Zustand,0)\"),(0,2,\"δ(Zustand,1)\")};\n", - " ANIMATION_FUNCTION3 == {r,c,i| r∈dom(f) ∧ c=1 ∧ i=δ(f(r), 0)};\n", - " ANIMATION_FUNCTION4 == {r,c,i| r∈dom(f) ∧ c=2 ∧ i=δ(f(r), 1)};\n", + " \"LibraryStrings.def\";\n", + " CUSTOM_GRAPH_NODES1 == rec(shape:\"doublecircle\",nodes:{x | ∃y.(x=TO_STRING(y) ∧ y:F)}); //Endzustände\n", + " CUSTOM_GRAPH_NODES2 == rec(shape:\"circle\",nodes:{x | ∃y.(x=TO_STRING(y) ∧ y:Z_gesamt\\F)}); // andere Zustände\n", + " CUSTOM_GRAPH_NODES3 == rec(shape:\"none\",color:\"white\",style:\"none\",nodes:{\"\"});\n", + " CUSTOM_GRAPH_EDGES1 == rec(color:\"black\",label:\"\",edges:{\"\"}*{x | ∃y.(x=TO_STRING(y) ∧ y:S)}); // Kanten für Startknoten\n", + " CUSTOM_GRAPH_EDGES2 == rec(color:\"green\",label:\"0\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,0) ∧ y∉δ(x,1) ∧ a=TO_STRING(x) ∧ b=TO_STRING(y))}); \n", + " CUSTOM_GRAPH_EDGES3 == rec(color:\"green\",label:\"1\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,1) ∧ y∉δ(x,0) ∧ a=TO_STRING(x) ∧ b=TO_STRING(y))});\n", + " CUSTOM_GRAPH_EDGES4 == rec(color:\"green\",label:\"0, 1\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,0) ∧ y∈δ(x,1)∧ a=TO_STRING(x) ∧ b=TO_STRING(y))})\n", "END" ] }, @@ -1163,91 +1181,224 @@ "outputs": [ { "data": { - "text/plain": [ - "Machine initialised using operation 1: $initialise_machine()" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - ":init" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "data": { - "text/markdown": [ - "<table style=\"font-family:monospace\"><tbody>\n", - "<tr>\n", - "<td style=\"padding:10px\">Zustand</td>\n", - "<td style=\"padding:10px\">δ(Zustand,0)</td>\n", - "<td style=\"padding:10px\">δ(Zustand,1)</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "</tbody></table>" + "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.44.1 (0)\n", + " -->\n", + "<!-- Title: prob_graph Pages: 1 -->\n", + "<svg width=\"540pt\" height=\"719pt\"\n", + " viewBox=\"0.00 0.00 540.00 718.76\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(0.73 0.73) rotate(0) translate(4 975.17)\">\n", + "<title>prob_graph</title>\n", + "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-975.17 731.65,-975.17 731.65,4 -4,4\"/>\n", + "<!-- 0 -->\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>0</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"56.32\" cy=\"-720\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"56.32\" cy=\"-720\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"56.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z22)</text>\n", + "</g>\n", + "<!-- 1 -->\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>1</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"138.32\" cy=\"-407\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"138.32\" cy=\"-407\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"138.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z22)</text>\n", + "</g>\n", + "<!-- 0->1 -->\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>0->1</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M70.51,-665.18C84.7,-611.39 106.5,-528.68 121.54,-471.66\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"125.01,-472.24 124.17,-461.68 118.24,-470.46 125.01,-472.24\"/>\n", + "<text text-anchor=\"middle\" x=\"101.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 6 -->\n", + "<g id=\"node7\" class=\"node\">\n", + "<title>6</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"300.32\" cy=\"-101\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"300.32\" y=\"-97.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z22)</text>\n", + "</g>\n", + "<!-- 0->6 -->\n", + "<g id=\"edge13\" class=\"edge\">\n", + "<title>0->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M45.9,-664.38C34.3,-590.21 22.38,-454.91 65.32,-350.68 103.28,-258.54 192.4,-180.38 249.33,-137.43\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"251.56,-140.14 257.49,-131.36 247.38,-134.53 251.56,-140.14\"/>\n", + "<text text-anchor=\"middle\" x=\"69.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 1->1 -->\n", + "<g id=\"edge9\" class=\"edge\">\n", + "<title>1->1</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M186.58,-436.21C201.21,-435.47 212.65,-425.74 212.65,-407 212.65,-392.8 206.08,-383.77 196.53,-379.91\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"197.09,-376.45 186.58,-377.79 195.63,-383.3 197.09,-376.45\"/>\n", + "<text text-anchor=\"middle\" x=\"216.65\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 1->6 -->\n", + "<g id=\"edge19\" class=\"edge\">\n", + "<title>1->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M164.53,-356.82C193.77,-301.95 240.95,-213.42 271.29,-156.49\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"274.39,-158.1 276.01,-147.63 268.22,-154.81 274.39,-158.1\"/>\n", + "<text text-anchor=\"middle\" x=\"228.32\" y=\"-246.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 2 -->\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>2</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"183.32\" cy=\"-720\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"183.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z20)</text>\n", + "</g>\n", + "<!-- 2->6 -->\n", + "<g id=\"edge11\" class=\"edge\">\n", + "<title>2->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M192.9,-668.51C214.27,-555.83 265.77,-284.25 288.82,-162.65\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"292.28,-163.23 290.7,-152.76 285.4,-161.93 292.28,-163.23\"/>\n", + "<text text-anchor=\"middle\" x=\"256.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 8 -->\n", + "<g id=\"node9\" class=\"node\">\n", + "<title>8</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"438.32\" cy=\"-407\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"438.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z21)</text>\n", + "</g>\n", + "<!-- 2->8 -->\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>2->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M216.14,-678.98C263,-621.83 348.95,-517 399.1,-455.83\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"402,-457.82 405.64,-447.87 396.59,-453.38 402,-457.82\"/>\n", + "<text text-anchor=\"middle\" x=\"314.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 3 -->\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>3</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"306.32\" cy=\"-720\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"306.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z21)</text>\n", + "</g>\n", + "<!-- 3->6 -->\n", + "<g id=\"edge12\" class=\"edge\">\n", + "<title>3->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M305.82,-667.46C304.72,-554.46 302.11,-285.36 300.92,-163.65\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"304.42,-163.36 300.82,-153.4 297.42,-163.43 304.42,-163.36\"/>\n", + "<text text-anchor=\"middle\" x=\"307.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 3->8 -->\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>3->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M326.52,-671.43C350.1,-615.87 389.08,-524.03 414.22,-464.79\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"417.45,-466.14 418.14,-455.57 411.01,-463.41 417.45,-466.14\"/>\n", + "<text text-anchor=\"middle\" x=\"376.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 4 -->\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>4</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"429.32\" cy=\"-720\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"429.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z20)</text>\n", + "</g>\n", + "<!-- 4->6 -->\n", + "<g id=\"edge14\" class=\"edge\">\n", + "<title>4->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M416.86,-668.69C404.27,-617.23 384.55,-534.9 369.32,-463.32 346.94,-358.09 324.14,-234.89 311.16,-162.94\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"314.53,-161.92 309.32,-152.7 307.64,-163.16 314.53,-161.92\"/>\n", + "<text text-anchor=\"middle\" x=\"373.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 4->8 -->\n", + "<g id=\"edge4\" class=\"edge\">\n", + "<title>4->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M430.81,-667.64C432.38,-613.29 434.87,-527.5 436.54,-469.56\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"440.05,-469.53 436.84,-459.43 433.05,-469.33 440.05,-469.53\"/>\n", + "<text text-anchor=\"middle\" x=\"437.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 5 -->\n", + "<g id=\"node6\" class=\"node\">\n", + "<title>5</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"552.32\" cy=\"-720\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"552.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z21)</text>\n", + "</g>\n", + "<!-- 5->6 -->\n", + "<g id=\"edge15\" class=\"edge\">\n", + "<title>5->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M558.69,-668.02C565.67,-594.61 570.54,-456.34 525.32,-350.68 487.31,-261.83 404.01,-183.66 350.12,-139.66\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"352.05,-136.72 342.07,-133.16 347.65,-142.17 352.05,-136.72\"/>\n", + "<text text-anchor=\"middle\" x=\"558.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 5->8 -->\n", + "<g id=\"edge5\" class=\"edge\">\n", + "<title>5->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M534.64,-670.75C514.38,-615.47 481.2,-524.95 459.56,-465.92\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"462.78,-464.55 456.05,-456.37 456.21,-466.96 462.78,-464.55\"/>\n", + "<text text-anchor=\"middle\" x=\"499.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 6->1 -->\n", + "<g id=\"edge6\" class=\"edge\">\n", + "<title>6->1</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M264.08,-139.12C239.43,-166.14 207.71,-204.67 187.32,-243.5 171.2,-274.22 159.54,-311.06 151.65,-341.9\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"148.24,-341.13 149.22,-351.68 155.03,-342.82 148.24,-341.13\"/>\n", + "<text text-anchor=\"middle\" x=\"191.32\" y=\"-246.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 6->6 -->\n", + "<g id=\"edge16\" class=\"edge\">\n", + "<title>6->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M344.96,-128.74C359.29,-128.46 370.65,-119.21 370.65,-101 370.65,-87.34 364.26,-78.73 355.02,-75.15\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"355.44,-71.67 344.96,-73.26 354.14,-78.55 355.44,-71.67\"/>\n", + "<text text-anchor=\"middle\" x=\"374.65\" y=\"-97.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 7 -->\n", + "<g id=\"node8\" class=\"node\">\n", + "<title>7</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"675.32\" cy=\"-720\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"675.32\" y=\"-716.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z20)</text>\n", + "</g>\n", + "<!-- 7->6 -->\n", + "<g id=\"edge17\" class=\"edge\">\n", + "<title>7->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M667.2,-668.19C653.95,-594.68 623.28,-455.96 566.32,-350.68 515.19,-256.14 414.67,-177.5 352.9,-135.33\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"354.69,-132.32 344.45,-129.62 350.78,-138.12 354.69,-132.32\"/>\n", + "<text text-anchor=\"middle\" x=\"618.32\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 7->8 -->\n", + "<g id=\"edge7\" class=\"edge\">\n", + "<title>7->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M643.85,-677.7C600.56,-620.89 522.73,-518.76 476.27,-457.79\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"478.77,-455.3 469.93,-449.47 473.2,-459.54 478.77,-455.3\"/>\n", + "<text text-anchor=\"middle\" x=\"560.32\" y=\"-560.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 8->6 -->\n", + "<g id=\"edge18\" class=\"edge\">\n", + "<title>8->6</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M420.75,-357.44C408.58,-324.85 391.52,-281.15 374.32,-243.5 360.88,-214.06 344.31,-182.05 330.26,-155.93\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"333.24,-154.08 325.4,-146.95 327.08,-157.41 333.24,-154.08\"/>\n", + "<text text-anchor=\"middle\" x=\"383.32\" y=\"-246.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 8->8 -->\n", + "<g id=\"edge8\" class=\"edge\">\n", + "<title>8->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M481.93,-436.25C496.75,-436.4 508.65,-426.65 508.65,-407 508.65,-392.11 501.81,-382.9 492.06,-379.38\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"492.36,-375.89 481.93,-377.75 491.25,-382.8 492.36,-375.89\"/>\n", + "<text text-anchor=\"middle\" x=\"512.65\" y=\"-403.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 9 -->\n", + "<g id=\"node10\" class=\"node\">\n", + "<title>9</title>\n", + "</g>\n", + "<!-- 9->2 -->\n", + "<g id=\"edge10\" class=\"edge\">\n", + "<title>9->2</title>\n", + "<path fill=\"none\" stroke=\"black\" d=\"M183.32,-917.85C183.32,-888.9 183.32,-828.97 183.32,-782.8\"/>\n", + "<polygon fill=\"black\" stroke=\"black\" points=\"186.82,-782.58 183.32,-772.58 179.82,-782.58 186.82,-782.58\"/>\n", + "</g>\n", + "</g>\n", + "</svg>" ], "text/plain": [ - "<Animation function visualisation>" + "<Dot visualization: custom_graph []>" ] }, - "execution_count": 16, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ - ":show" + ":dot custom_graph" ] }, { @@ -1259,7 +1410,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -1268,7 +1419,7 @@ "Loaded machine: NFA" ] }, - "execution_count": 17, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -1278,7 +1429,7 @@ "MACHINE NFA\n", "SETS\n", " Z = {z10,z11, z12, z20,z21,z22}\n", - "CONSTANTS Σ, M, Z_gesamt, δ, S, F, f,\n", + "CONSTANTS Σ, M, Z_gesamt, δ, S, F,\n", " M1, Z1, δ1, S1, F1,\n", " M2, Z2, δ2, S2, F2\n", " \n", @@ -1299,16 +1450,16 @@ " (z11,0)↦{z12}, (z11,1)↦{z11},\n", " (z12,0)↦{z12}, (z12,1)↦{z11}} ∧\n", "\n", - " // Der Automat M2 (L(M2)={1^n|n∈ℕ_0}):\n", + " // Der Automat M2 (L(M2)={0^n|n∈ℕ_0}):\n", " M2 = (Σ, Z2, δ2, S2, F2) ∧\n", " Z2 ⊆ Z ∧\n", " δ2 ∈ (Z2×Σ) → ℙ(Z2) ∧\n", " S2 ⊆ Z2 ∧ F2 ⊆ Z2 \n", " ∧\n", " Z2 = {z20,z21,z22} ∧\n", - " S2 = {z20, z21} ∧ F2 = {z20, z21} ∧\n", - " δ2 = { (z20,0)↦{z22}, (z20,1)↦{z21},\n", - " (z21,0)↦{z22}, (z21,1)↦{z21},\n", + " S2 = {z20} ∧ F2 = {z20, z21} ∧\n", + " δ2 = { (z20,0)↦{z21}, (z20,1)↦{z22},\n", + " (z21,0)↦{z21}, (z21,1)↦{z22},\n", " (z22,0)↦{z22}, (z22,1)↦{z22}} ∧\n", "\n", " //Eigene Konstruktion analog zu \"Grundkurs Theoretische Informatik\" (s.o.)\n", @@ -1322,20 +1473,21 @@ " zustand1∈Z1 ∧ zustand2∈Z2 ∧ symbol∈Σ ∧\n", " menge = δ1(zustand1, symbol)*δ2(zustand2, symbol))}\n", " \n", - " //Eine Hilfsfunktion zur Visualisierung\n", - " ∧ f ∈ seq(Z_gesamt) ∧ ran(f) = Z_gesamt \n", "DEFINITIONS // Für den Zustandsgraphen:\n", " \"LibraryStrings.def\";\n", - " ANIMATION_FUNCTION1 == {r,c,i| r∈dom(f) ∧ c=0 ∧ i=f(r)};\n", - " ANIMATION_FUNCTION2 == {(0,0,\"Zustand\"),(0,1,\"δ(Zustand,0)\"),(0,2,\"δ(Zustand,1)\")};\n", - " ANIMATION_FUNCTION3 == {r,c,i| r∈dom(f) ∧ c=1 ∧ i=δ(f(r), 0)};\n", - " ANIMATION_FUNCTION4 == {r,c,i| r∈dom(f) ∧ c=2 ∧ i=δ(f(r), 1)};\n", + " CUSTOM_GRAPH_NODES1 == rec(shape:\"doublecircle\",nodes:{x | ∃y.(x=TO_STRING(y) ∧ y:F)}); //Endzustände\n", + " CUSTOM_GRAPH_NODES2 == rec(shape:\"circle\",nodes:{x | ∃y.(x=TO_STRING(y) ∧ y:Z_gesamt\\F)}); // andere Zustände\n", + " CUSTOM_GRAPH_NODES3 == rec(shape:\"none\",color:\"white\",style:\"none\",nodes:{\"\"});\n", + " CUSTOM_GRAPH_EDGES1 == rec(color:\"black\",label:\"\",edges:{\"\"}*{x | ∃y.(x=TO_STRING(y) ∧ y:S)}); // Kanten für Startknoten\n", + " CUSTOM_GRAPH_EDGES2 == rec(color:\"green\",label:\"0\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,0) ∧ y∉δ(x,1) ∧ a=TO_STRING(x) ∧ b=TO_STRING(y))}); \n", + " CUSTOM_GRAPH_EDGES3 == rec(color:\"green\",label:\"1\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,1) ∧ y∉δ(x,0) ∧ a=TO_STRING(x) ∧ b=TO_STRING(y))});\n", + " CUSTOM_GRAPH_EDGES4 == rec(color:\"green\",label:\"0, 1\",edges:{a,b|∃x,y.({(x,0),(x,1)} <:dom(δ) ∧ y∈δ(x,0) ∧ y∈δ(x,1)∧ a=TO_STRING(x) ∧ b=TO_STRING(y))})\n", "END" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -1344,7 +1496,7 @@ "Machine constants set up using operation 0: $setup_constants()" ] }, - "execution_count": 18, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -1355,96 +1507,231 @@ }, { "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Machine initialised using operation 1: $initialise_machine()" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - ":init" - ] - }, - { - "cell_type": "code", - "execution_count": 20, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { - "text/markdown": [ - "<table style=\"font-family:monospace\"><tbody>\n", - "<tr>\n", - "<td style=\"padding:10px\">Zustand</td>\n", - "<td style=\"padding:10px\">δ(Zustand,0)</td>\n", - "<td style=\"padding:10px\">δ(Zustand,1)</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z10|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z11|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z20)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z21)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z21)}</td>\n", - "</tr>\n", - "<tr>\n", - "<td style=\"padding:10px\">(z12|->z22)</td>\n", - "<td style=\"padding:10px\">{(z12|->z22)}</td>\n", - "<td style=\"padding:10px\">{(z11|->z22)}</td>\n", - "</tr>\n", - "</tbody></table>" + "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.44.1 (0)\n", + " -->\n", + "<!-- Title: prob_graph Pages: 1 -->\n", + "<svg width=\"540pt\" height=\"718pt\"\n", + " viewBox=\"0.00 0.00 540.00 717.68\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", + "<g id=\"graph0\" class=\"graph\" transform=\"scale(0.84 0.84) rotate(0) translate(4 850.11)\">\n", + "<title>prob_graph</title>\n", + "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-850.11 638.65,-850.11 638.65,4 -4,4\"/>\n", + "<!-- 0 -->\n", + "<g id=\"node1\" class=\"node\">\n", + "<title>0</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"201.32\" cy=\"-679\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"201.32\" cy=\"-679\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"201.32\" y=\"-675.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z20)</text>\n", + "</g>\n", + "<!-- 3 -->\n", + "<g id=\"node4\" class=\"node\">\n", + "<title>3</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"266.32\" cy=\"-470\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"266.32\" cy=\"-470\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"266.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z21)</text>\n", + "</g>\n", + "<!-- 0->3 -->\n", + "<g id=\"edge1\" class=\"edge\">\n", + "<title>0->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M218.83,-625.45C223.6,-610.91 228.73,-595.11 233.32,-580.5 238.04,-565.51 243,-549.32 247.59,-534.1\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"251.02,-534.85 250.56,-524.27 244.32,-532.83 251.02,-534.85\"/>\n", + "<text text-anchor=\"middle\" x=\"240.32\" y=\"-570.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 7 -->\n", + "<g id=\"node8\" class=\"node\">\n", + "<title>7</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"213.32\" cy=\"-266\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"213.32\" y=\"-262.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z22)</text>\n", + "</g>\n", + "<!-- 0->7 -->\n", + "<g id=\"edge11\" class=\"edge\">\n", + "<title>0->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M196.51,-622.76C192.59,-569.24 188.43,-485.82 193.32,-413.68 195.25,-385.38 199.23,-354.22 203.13,-327.93\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"206.64,-328.15 204.68,-317.74 199.72,-327.1 206.64,-328.15\"/>\n", + "<text text-anchor=\"middle\" x=\"197.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 1 -->\n", + "<g id=\"node2\" class=\"node\">\n", + "<title>1</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"332.32\" cy=\"-679\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"332.32\" cy=\"-679\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"332.32\" y=\"-675.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z21)</text>\n", + "</g>\n", + "<!-- 1->3 -->\n", + "<g id=\"edge2\" class=\"edge\">\n", + "<title>1->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M315.5,-625.23C306.61,-597.36 295.65,-562.96 286.33,-533.73\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"289.61,-532.5 283.23,-524.03 282.94,-534.62 289.61,-532.5\"/>\n", + "<text text-anchor=\"middle\" x=\"303.32\" y=\"-570.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 1->7 -->\n", + "<g id=\"edge12\" class=\"edge\">\n", + "<title>1->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M351.24,-625.72C367.96,-570.82 385.67,-483.01 357.32,-413.68 338.65,-368 298.14,-328.87 264.82,-302.55\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"266.58,-299.48 256.53,-296.13 262.3,-305.02 266.58,-299.48\"/>\n", + "<text text-anchor=\"middle\" x=\"375.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 2 -->\n", + "<g id=\"node3\" class=\"node\">\n", + "<title>2</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"70.32\" cy=\"-679\" rx=\"52.16\" ry=\"52.16\"/>\n", + "<ellipse fill=\"none\" stroke=\"black\" cx=\"70.32\" cy=\"-679\" rx=\"56.15\" ry=\"56.15\"/>\n", + "<text text-anchor=\"middle\" x=\"70.32\" y=\"-675.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z20)</text>\n", + "</g>\n", + "<!-- 2->3 -->\n", + "<g id=\"edge7\" class=\"edge\">\n", + "<title>2->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M108.58,-637.6C140.72,-603.65 186.72,-555.07 220.76,-519.12\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"223.5,-521.32 227.83,-511.65 218.41,-516.51 223.5,-521.32\"/>\n", + "<text text-anchor=\"middle\" x=\"178.32\" y=\"-570.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 2->7 -->\n", + "<g id=\"edge17\" class=\"edge\">\n", + "<title>2->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M88.58,-625.53C115.39,-548.48 165.23,-405.23 193.11,-325.09\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"196.42,-326.24 196.4,-315.64 189.81,-323.94 196.42,-326.24\"/>\n", + "<text text-anchor=\"middle\" x=\"165.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 3->3 -->\n", + "<g id=\"edge8\" class=\"edge\">\n", + "<title>3->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M319.44,-489.07C331.67,-487.43 340.65,-481.07 340.65,-470 340.65,-462.22 336.21,-456.76 329.32,-453.64\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"330.01,-450.2 319.44,-450.93 328.16,-456.95 330.01,-450.2\"/>\n", + "<text text-anchor=\"middle\" x=\"344.65\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 3->7 -->\n", + "<g id=\"edge18\" class=\"edge\">\n", + "<title>3->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M252.26,-415.4C245.07,-388 236.31,-354.6 228.91,-326.42\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"232.29,-325.47 226.36,-316.69 225.51,-327.25 232.29,-325.47\"/>\n", + "<text text-anchor=\"middle\" x=\"243.32\" y=\"-362.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 4 -->\n", + "<g id=\"node5\" class=\"node\">\n", + "<title>4</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"52.32\" cy=\"-470\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"52.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z10|->z22)</text>\n", + "</g>\n", + "<!-- 4->7 -->\n", + "<g id=\"edge13\" class=\"edge\">\n", + "<title>4->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M76.36,-423.33C87.92,-403 102.67,-379.24 118.32,-359.5 132.72,-341.36 150.46,-323.19 166.71,-307.82\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"169.13,-310.35 174.05,-300.96 164.36,-305.23 169.13,-310.35\"/>\n", + "<text text-anchor=\"middle\" x=\"122.32\" y=\"-362.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 8 -->\n", + "<g id=\"node9\" class=\"node\">\n", + "<title>8</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"182.32\" cy=\"-68\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"182.32\" y=\"-64.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z12|->z22)</text>\n", + "</g>\n", + "<!-- 4->8 -->\n", + "<g id=\"edge3\" class=\"edge\">\n", + "<title>4->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M68.27,-419.95C92.23,-346.23 137.45,-207.09 163.17,-127.95\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"166.59,-128.73 166.36,-118.14 159.94,-126.56 166.59,-128.73\"/>\n", + "<text text-anchor=\"middle\" x=\"139.32\" y=\"-262.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 5 -->\n", + "<g id=\"node6\" class=\"node\">\n", + "<title>5</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"459.32\" cy=\"-679\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"459.32\" y=\"-675.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z20)</text>\n", + "</g>\n", + "<!-- 5->3 -->\n", + "<g id=\"edge4\" class=\"edge\">\n", + "<title>5->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M423.93,-640.03C392.33,-606.14 345.89,-556.33 311.6,-519.56\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"313.85,-516.84 304.47,-511.92 308.73,-521.62 313.85,-516.84\"/>\n", + "<text text-anchor=\"middle\" x=\"366.32\" y=\"-570.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 5->7 -->\n", + "<g id=\"edge14\" class=\"edge\">\n", + "<title>5->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M462.94,-626.54C463.07,-607.74 461.83,-586.45 457.32,-567.5 432.91,-464.73 417.97,-433.23 342.32,-359.5 319.37,-337.13 290.66,-316 266.14,-299.59\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"267.94,-296.59 257.67,-293.99 264.08,-302.43 267.94,-296.59\"/>\n", + "<text text-anchor=\"middle\" x=\"450.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 6 -->\n", + "<g id=\"node7\" class=\"node\">\n", + "<title>6</title>\n", + "<ellipse fill=\"lightgrey\" stroke=\"black\" cx=\"582.32\" cy=\"-679\" rx=\"52.15\" ry=\"52.15\"/>\n", + "<text text-anchor=\"middle\" x=\"582.32\" y=\"-675.9\" font-family=\"Times,serif\" font-size=\"12.00\">(z11|->z21)</text>\n", + "</g>\n", + "<!-- 6->3 -->\n", + "<g id=\"edge5\" class=\"edge\">\n", + "<title>6->3</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M544.59,-642.29C536.79,-635.5 528.46,-628.65 520.32,-622.68 502.41,-609.52 392.6,-544.81 323.35,-504.28\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"325.1,-501.25 314.7,-499.22 321.56,-507.29 325.1,-501.25\"/>\n", + "<text text-anchor=\"middle\" x=\"450.32\" y=\"-570.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 6->7 -->\n", + "<g id=\"edge15\" class=\"edge\">\n", + "<title>6->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M568.76,-628.42C551.09,-571.22 515.51,-476.94 458.32,-413.68 406.11,-355.91 325.74,-313.81 271.42,-289.9\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"272.49,-286.56 261.93,-285.79 269.71,-292.98 272.49,-286.56\"/>\n", + "<text text-anchor=\"middle\" x=\"532.32\" y=\"-466.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 7->7 -->\n", + "<g id=\"edge16\" class=\"edge\">\n", + "<title>7->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M262.62,-284.09C274.68,-282.75 283.65,-276.72 283.65,-266 283.65,-258.46 279.21,-253.25 272.39,-250.35\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"273.17,-246.93 262.62,-247.91 271.48,-253.73 273.17,-246.93\"/>\n", + "<text text-anchor=\"middle\" x=\"287.65\" y=\"-262.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 7->8 -->\n", + "<g id=\"edge6\" class=\"edge\">\n", + "<title>7->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M205.3,-214.27C201.23,-188.52 196.25,-157.05 191.97,-129.99\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"195.39,-129.19 190.37,-119.86 188.47,-130.28 195.39,-129.19\"/>\n", + "<text text-anchor=\"middle\" x=\"202.32\" y=\"-163.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 8->7 -->\n", + "<g id=\"edge19\" class=\"edge\">\n", + "<title>8->7</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M180.38,-120.29C180.51,-137.32 181.5,-156.31 184.32,-173.5 186.13,-184.45 188.95,-195.9 192.15,-206.84\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"188.9,-208.18 195.17,-216.72 195.6,-206.14 188.9,-208.18\"/>\n", + "<text text-anchor=\"middle\" x=\"188.32\" y=\"-163.9\" font-family=\"Times,serif\" font-size=\"12.00\">1</text>\n", + "</g>\n", + "<!-- 8->8 -->\n", + "<g id=\"edge9\" class=\"edge\">\n", + "<title>8->8</title>\n", + "<path fill=\"none\" stroke=\"green\" d=\"M231.62,-86.09C243.68,-84.75 252.65,-78.72 252.65,-68 252.65,-60.46 248.21,-55.25 241.39,-52.35\"/>\n", + "<polygon fill=\"green\" stroke=\"green\" points=\"242.17,-48.93 231.62,-49.91 240.48,-55.73 242.17,-48.93\"/>\n", + "<text text-anchor=\"middle\" x=\"256.65\" y=\"-64.9\" font-family=\"Times,serif\" font-size=\"12.00\">0</text>\n", + "</g>\n", + "<!-- 9 -->\n", + "<g id=\"node10\" class=\"node\">\n", + "<title>9</title>\n", + "</g>\n", + "<!-- 9->0 -->\n", + "<g id=\"edge10\" class=\"edge\">\n", + "<title>9->0</title>\n", + "<path fill=\"none\" stroke=\"black\" d=\"M201.32,-804.87C201.32,-790.03 201.32,-767.58 201.32,-745.79\"/>\n", + "<polygon fill=\"black\" stroke=\"black\" points=\"204.82,-745.52 201.32,-735.52 197.82,-745.52 204.82,-745.52\"/>\n", + "</g>\n", + "</g>\n", + "</svg>" ], "text/plain": [ - "<Animation function visualisation>" + "<Dot visualization: custom_graph []>" ] }, - "execution_count": 20, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ - ":show" + ":dot custom_graph" ] }, { @@ -1456,7 +1743,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -1465,7 +1752,7 @@ "Loaded machine: DFA" ] }, - "execution_count": 21, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -1501,7 +1788,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -1510,7 +1797,7 @@ "Machine constants set up using operation 0: $setup_constants()" ] }, - "execution_count": 22, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -1527,8 +1814,10 @@ }, { "cell_type": "code", - "execution_count": 23, - "metadata": {}, + "execution_count": 21, + "metadata": { + "scrolled": false + }, "outputs": [ { "data": { @@ -1634,7 +1923,7 @@ "<Dot visualization: custom_graph []>" ] }, - "execution_count": 23, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -1642,6 +1931,13 @@ "source": [ ":dot custom_graph" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/info4/kapitel-2/img/konkatenation_M1.svg b/info4/kapitel-2/img/konkatenation_M1.svg new file mode 100644 index 0000000..e094498 --- /dev/null +++ b/info4/kapitel-2/img/konkatenation_M1.svg @@ -0,0 +1 @@ +<svg width="720" height="713pt" viewBox="0 0 540 712.99" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:100%"><g class="graph" transform="matrix(.98 0 0 .98 3.92 710.284)"><path fill="#fff" stroke="transparent" d="M-4 4v-728.78h551.96V4H-4z"/><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="360.3" cy="-500" r="23.3"/><circle fill="none" stroke="#000" cx="360.3" cy="-500" r="27.29"/><text text-anchor="middle" x="360.3" y="-496.9" font-family="Times,serif" font-size="12">z10</text></g><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="138.3" cy="-271" r="23.3"/><circle fill="none" stroke="#000" cx="138.3" cy="-271" r="27.29"/><text text-anchor="middle" x="138.3" y="-267.9" font-family="Times,serif" font-size="12">z12</text></g><g class="edge"><path fill="none" stroke="green" d="M341.37-479.65C301.64-439.02 209.5-344.8 164.28-298.56"/><path fill="green" stroke="green" d="M166.67-296.01l-9.49 4.71 4.49-9.6 5 4.89z"/><text text-anchor="middle" x="253.3" y="-381.9" font-family="Times,serif" font-size="12">0</text></g><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="294.3" cy="-52" r="23.29"/><text text-anchor="middle" x="294.3" y="-48.9" font-family="Times,serif" font-size="12">z11</text></g><g class="edge"><path fill="none" stroke="green" d="M356.42-472.77c-11.41 77.09-44.81 302.78-57.32 387.31"/><path fill="green" stroke="green" d="M302.54-84.79l-4.93 9.38-1.99-10.41 6.92 1.03z"/><text text-anchor="middle" x="335.3" y="-267.9" font-family="Times,serif" font-size="12">1</text></g><g class="edge"><path fill="none" stroke="green" d="M157.89-290.49c13.08-5.49 25.8 1.01 25.8 19.49 0 13.72-7.01 20.83-15.97 21.34"/><path fill="green" stroke="green" d="M167.07-246.22l-9.18-5.29 10.48-1.58-1.3 6.87z"/><text text-anchor="middle" x="187.69" y="-267.9" font-family="Times,serif" font-size="12">0</text></g><g class="edge"><path fill="none" stroke="green" d="M153.83-248.4c28.69 39.92 89.94 125.12 121.22 168.63"/><path fill="green" stroke="green" d="M278.07-81.56l3 10.16-8.68-6.08 5.68-4.08z"/><text text-anchor="middle" x="225.3" y="-153.9" font-family="Times,serif" font-size="12">1</text></g><g class="edge"><path fill="none" stroke="green" d="M284.58-73.78C273.5-96.62 254.2-134 233.3-163.5c-20.8-29.35-48.56-59.66-68.7-80.4"/><path fill="green" stroke="green" d="M162.06-241.5l-4.5-9.59 9.5 4.69-5 4.9z"/><text text-anchor="middle" x="245.3" y="-153.9" font-family="Times,serif" font-size="12">0</text></g><g class="edge"><path fill="none" stroke="green" d="M310.44-68.98c12.5-6.35 25.25-.69 25.25 16.98 0 12.98-6.88 19.48-15.48 19.5"/><path fill="green" stroke="green" d="M319.25-29.13l-8.81-5.89 10.56-.89-1.75 6.78z"/><text text-anchor="middle" x="339.69" y="-48.9" font-family="Times,serif" font-size="12">1</text></g><g class="edge"><path fill="none" stroke="#000" d="M360.3-662.84v125.01"/><path stroke="#000" d="M363.8-537.61l-3.5 10-3.5-10h7z"/></g></g></svg> \ No newline at end of file diff --git a/info4/kapitel-2/img/konkatenation_M2.svg b/info4/kapitel-2/img/konkatenation_M2.svg new file mode 100644 index 0000000..9831207 --- /dev/null +++ b/info4/kapitel-2/img/konkatenation_M2.svg @@ -0,0 +1 @@ +<svg width="720" height="952" viewBox="0 0 540 714.07" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:100%"><g class="graph" transform="matrix(.98 0 0 .98 3.92 710.304)"><path fill="#fff" stroke="transparent" d="M-4 4v-728.8h551.14V4H-4z"/><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="109.57" cy="-278" r="23.3"/><circle fill="none" stroke="#000" cx="109.57" cy="-278" r="27.29"/><text text-anchor="middle" x="109.57" y="-274.9" font-family="Times,serif" font-size="12">z21</text></g><g class="edge"><path fill="none" stroke="green" d="M128.69-297.63c13.24-5.94 26.27.6 26.27 19.63 0 14.12-7.18 21.37-16.29 21.74"/><path fill="green" stroke="green" d="M137.75-252.88l-9.06-5.49 10.51-1.36-1.45 6.85z"/><text text-anchor="middle" x="158.96" y="-274.9" font-family="Times,serif" font-size="12">1</text></g><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="285.57" cy="-53" r="23.29"/><text text-anchor="middle" x="285.57" y="-49.9" font-family="Times,serif" font-size="12">z22</text></g><g class="edge"><path fill="none" stroke="green" d="M126.13-256.02c32.31 40.95 103.71 131.4 138.94 176.05"/><path fill="green" stroke="green" d="M267.97-81.95l3.45 10.02-8.95-5.68 5.5-4.34z"/><text text-anchor="middle" x="207.57" y="-157.9" font-family="Times,serif" font-size="12">0</text></g><g class="node"><circle fill="#d3d3d3" stroke="#000" cx="285.57" cy="-503" r="23.29"/><text text-anchor="middle" x="285.57" y="-499.9" font-family="Times,serif" font-size="12">z20</text></g><g class="edge"><path fill="none" stroke="green" d="M271.46-484.13c-30.31 38.42-101.93 129.16-138.91 176.01"/><path fill="green" stroke="green" d="M135.22-305.86l-8.94 5.68 3.45-10.01 5.49 4.33z"/><text text-anchor="middle" x="207.57" y="-391.9" font-family="Times,serif" font-size="12">1</text></g><g class="edge"><path fill="none" stroke="green" d="M285.57-479.48v392.9"/><path fill="green" stroke="green" d="M289.07-86.57l-3.5 10-3.5-10h7z"/><text text-anchor="middle" x="289.57" y="-274.9" font-family="Times,serif" font-size="12">0</text></g><g class="edge"><path fill="none" stroke="green" d="M301.28-70.4c12.64-6.96 25.68-1.16 25.68 17.4 0 13.78-7.18 20.52-16.05 20.24"/><path fill="green" stroke="green" d="M309.88-29.41l-8.6-6.19 10.59-.52-1.99 6.71z"/><text text-anchor="middle" x="338.46" y="-49.9" font-family="Times,serif" font-size="12">0, 1</text></g><g class="edge"><path fill="none" stroke="#000" d="M285.57-661.9v124.95"/><path stroke="#000" d="M289.07-536.64l-3.5 10-3.5-10h7z"/></g></g></svg> \ No newline at end of file -- GitLab