spot/tests/python/product.ipynb
Alexandre Duret-Lutz 2775b0abc8 dot: use tooltips with option "1"
Fixes #327.

* spot/twaalgos/dot.cc: Emit a tooltip="..." for state names and
labels that are disabled by option "1".
* doc/org/tut51.org, tests/python/product.ipynb, NEWS: Discuss this.
* tests/core/readsave.test, tests/python/alternation.ipynb,
tests/python/automata.ipynb: Adjust test cases.
2018-04-07 18:58:58 +02:00

2545 lines
204 KiB
Text

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display, HTML\n",
"import spot\n",
"import buddy\n",
"spot.setup(show_default='.tavb')\n",
"\n",
"def horiz(*args):\n",
" \"\"\"Display multiple arguments side by side in a table.\"\"\"\n",
" s = '<table><tr>'\n",
" for arg in args:\n",
" s += '<td style=\\\"vertical-align: top;\\\">' + arg.data + '</td>'\n",
" return HTML(s + '</tr></table>')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Anatomy of a product\n",
"\n",
"In this notebook, we write a Python function that constructs the product of two automata.\n",
"\n",
"This is obviously not a new feature: Spot can already make a product of two automata using its `product()` function. \n",
"For instance:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table><tr><td style=\"vertical-align: top;\"><svg height=\"307pt\" viewBox=\"0.00 0.00 99.00 307.00\" width=\"99pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 303)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-303 95,-303 95,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.5\" y=\"-284.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"46.5\" y=\"-284.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.5\" y=\"-284.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"22.5\" y=\"-270.8\">[Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>1</title>\n",
"<ellipse cx=\"18\" cy=\"-207\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-203.3\">1</text>\n",
"</g>\n",
"<!-- I&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;1</title>\n",
"<path d=\"M18,-261.8767C18,-258.822 18,-245.0552 18,-232.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-225.0193 21.1501,-232.0192 18,-228.5193 18.0001,-232.0193 18.0001,-232.0193 18.0001,-232.0193 18,-228.5193 14.8501,-232.0193 18,-225.0193 18,-225.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>0</title>\n",
"<ellipse cx=\"18\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M18,-188.9735C18,-176.2586 18,-159.0603 18,-145.0183\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-138.0034 21.1501,-145.0033 18,-141.5034 18.0001,-145.0034 18.0001,-145.0034 18.0001,-145.0034 18,-141.5034 14.8501,-145.0034 18,-138.0034 18,-138.0034\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22.5\" y=\"-159.8\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M34.6641,-127.3828C44.625,-129.0234 54,-126.5625 54,-120 54,-115.0781 48.7266,-112.4634 41.8876,-112.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"34.6641,-112.6172 41.449,-109.0273 38.1569,-112.394 41.6498,-112.1709 41.6498,-112.1709 41.6498,-112.1709 38.1569,-112.394 41.8507,-115.3145 34.6641,-112.6172 34.6641,-112.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-123.8\">a &amp; !b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.5\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"18\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M18,-101.7644C18,-85.5192 18,-61.5825 18,-43.4527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-36.0777 21.1501,-43.0776 18,-39.5777 18.0001,-43.0777 18.0001,-43.0777 18.0001,-43.0777 18,-39.5777 14.8501,-43.0777 18,-36.0777 18,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"21.5\" y=\"-72.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"18\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M33.916,-26.6334C44.1504,-28.8856 54,-26.0078 54,-18 54,-11.869 48.2263,-8.7452 40.9268,-8.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"33.916,-9.3666 40.5477,-5.5008 37.3968,-9 40.8775,-8.6335 40.8775,-8.6335 40.8775,-8.6335 37.3968,-9 41.2074,-11.7662 33.916,-9.3666 33.916,-9.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.5\" y=\"-21.8\">1</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-6.8\">⓿</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"220pt\" viewBox=\"0.00 0.00 208.02 220.00\" width=\"208pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-216 204.0193,-216 204.0193,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"53.0096\" y=\"-197.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"75.0096\" y=\"-197.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.0096\" y=\"-197.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"127.0096\" y=\"-197.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"143.0096\" y=\"-197.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.0096\" y=\"-183.8\">[gen. Büchi 2]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M68.0193,-174.8767C68.0193,-171.822 68.0193,-158.0552 68.0193,-145.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-138.0193 71.1694,-145.0192 68.0193,-141.5193 68.0194,-145.0193 68.0194,-145.0193 68.0194,-145.0193 68.0193,-141.5193 64.8694,-145.0193 68.0193,-138.0193 68.0193,-138.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.801,-123.2357C95.3342,-123.7856 104.0193,-122.707 104.0193,-120 104.0193,-118.012 99.3354,-116.9023 93.0714,-116.6708\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-116.7643 92.7599,-113.5244 89.3007,-116.7192 92.8004,-116.6742 92.8004,-116.6742 92.8004,-116.6742 89.3007,-116.7192 92.841,-119.8239 85.801,-116.7643 85.801,-116.7643\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-123.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"114.5193\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.5885,-124.845C108.7793,-128.5056 141.0193,-126.8906 141.0193,-120 141.0193,-113.7823 114.7687,-111.8601 92.6031,-114.2335\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.5885,-115.155 92.1185,-111.12 89.0587,-114.6991 92.5288,-114.2432 92.5288,-114.2432 92.5288,-114.2432 89.0587,-114.6991 92.9392,-117.3663 85.5885,-115.155 85.5885,-115.155\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.5193\" y=\"-123.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"141.0193\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"157.0193\" y=\"-109.8\">❶</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M50.3286,-115.3021C35.307,-110.2732 14.6933,-100.6701 5.0193,-84 -1.6731,-72.4679 -1.6731,-65.5321 5.0193,-54 13.3329,-39.6741 29.7258,-30.5674 43.7056,-25.0978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"50.3286,-22.6979 44.8205,-28.0443 47.0379,-23.8903 43.7473,-25.0827 43.7473,-25.0827 43.7473,-25.0827 47.0379,-23.8903 42.6741,-22.1211 50.3286,-22.6979 50.3286,-22.6979\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"5.0193\" y=\"-65.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M68.0193,-36.0777C68.0193,-52.2729 68.0193,-76.2033 68.0193,-94.3707\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-101.7644 64.8694,-94.7644 68.0193,-98.2644 68.0194,-94.7644 68.0194,-94.7644 68.0194,-94.7644 68.0193,-98.2644 71.1694,-94.7645 68.0193,-101.7644 68.0193,-101.7644\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"68.0193\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.5193\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M83.5721,-27.9858C91.923,-34.3143 101.423,-43.3143 106.0193,-54 111.2877,-66.2483 111.2877,-71.7517 106.0193,-84 102.4285,-92.3482 95.8446,-99.6675 89.154,-105.4879\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"83.5721,-110.0142 87.0252,-103.1586 86.2906,-107.8098 89.0092,-105.6053 89.0092,-105.6053 89.0092,-105.6053 86.2906,-107.8098 90.9932,-108.052 83.5721,-110.0142 83.5721,-110.0142\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.0193\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.0193\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.0193\" y=\"-58.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.801,-22.4941C95.3342,-23.2578 104.0193,-21.7598 104.0193,-18 104.0193,-15.2389 99.3354,-13.6976 93.0714,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-13.5059 92.7436,-10.2313 89.3004,-13.4434 92.7999,-13.3808 92.7999,-13.3808 92.7999,-13.3808 89.3004,-13.4434 92.8562,-16.5303 85.801,-13.5059 85.801,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-14.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.0367,-24.4905C109.3677,-29.8803 145.0193,-27.7168 145.0193,-18 145.0193,-9.1942 115.7391,-6.5917 92.1396,-10.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.0367,-11.5095 91.3452,-7.1363 88.4781,-10.8715 91.9194,-10.2335 91.9194,-10.2335 91.9194,-10.2335 88.4781,-10.8715 92.4936,-13.3307 85.0367,-11.5095 85.0367,-11.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.0193\" y=\"-21.8\">b &amp; !c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.5193\" y=\"-6.8\">❶</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"360pt\" viewBox=\"0.00 0.00 193.93 360.00\" width=\"194pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(.687 .687) rotate(0) translate(4 520)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-520 278.2829,-520 278.2829,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.1415\" y=\"-501.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.1415\" y=\"-501.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.1415\" y=\"-501.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"154.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"190.1415\" y=\"-501.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"206.1415\" y=\"-501.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"93.1415\" y=\"-487.8\">[gen. Büchi 3]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"101.2829\" cy=\"-424\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.2829\" y=\"-420.3\">1,0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M101.2829,-478.8767C101.2829,-475.822 101.2829,-462.0552 101.2829,-449.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"101.2829,-442.0193 104.433,-449.0192 101.283,-445.5193 101.283,-449.0193 101.283,-449.0193 101.283,-449.0193 101.283,-445.5193 98.133,-449.0193 101.2829,-442.0193 101.2829,-442.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"41.2829\" cy=\"-322\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"31.2829\" y=\"-318.3\">0,0</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M76.8936,-415.7341C64.1926,-410.0539 49.7827,-401.1278 42.2829,-388 35.3451,-375.8559 34.7952,-360.2902 36.1192,-347.3255\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"37.0811,-340.0382 39.2879,-347.3903 36.623,-343.5081 36.165,-346.978 36.165,-346.978 36.165,-346.978 36.623,-343.5081 33.042,-346.5658 37.0811,-340.0382 37.0811,-340.0382\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-376.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"52.7829\" y=\"-361.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M97.7675,-405.8671C94.4991,-391.9839 88.6906,-372.772 79.2829,-358 75.3288,-351.7912 70.0726,-345.9073 64.7341,-340.7644\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"59.4134,-335.8838 66.7013,-338.2943 61.9927,-338.2497 64.5719,-340.6156 64.5719,-340.6156 64.5719,-340.6156 61.9927,-338.2497 62.4426,-342.937 59.4134,-335.8838 59.4134,-335.8838\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"103.7829\" y=\"-376.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92.2829\" y=\"-362.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"108.2829\" y=\"-362.8\">❷</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"114.2829\" cy=\"-220\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.2829\" y=\"-216.3\">0,1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M114.6834,-407.9335C133.9222,-383.4915 167.9737,-334.6506 176.2829,-286 178.5277,-272.857 182.9353,-267.5552 176.2829,-256 169.5236,-244.2591 157.3042,-235.9942 145.4896,-230.372\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"139.0049,-227.5151 146.6808,-227.4546 142.2078,-228.9262 145.4108,-230.3373 145.4108,-230.3373 145.4108,-230.3373 142.2078,-228.9262 144.1408,-233.22 139.0049,-227.5151 139.0049,-227.5151\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"171.2829\" y=\"-318.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M64.8975,-331.1461C76.2561,-332.2753 86.2829,-329.2266 86.2829,-322 86.2829,-316.3542 80.163,-313.2585 72.0694,-312.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"64.8975,-312.8539 71.8341,-309.5666 68.3968,-312.7849 71.8962,-312.7159 71.8962,-312.7159 71.8962,-312.7159 68.3968,-312.7849 71.9582,-315.8653 64.8975,-312.8539 64.8975,-312.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.2829\" y=\"-325.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"101.2829\" y=\"-311.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-311.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M62.8599,-310.9996C73.031,-304.8596 84.5918,-296.3528 92.2829,-286 101.2166,-273.9746 106.6578,-258.1091 109.8937,-244.9473\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"111.4727,-237.9549 113.0033,-245.4769 110.7017,-241.369 109.9307,-244.783 109.9307,-244.783 109.9307,-244.783 110.7017,-241.369 106.8581,-244.0891 111.4727,-237.9549 111.4727,-237.9549\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"106.2829\" y=\"-274.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"131.2829\" y=\"-259.8\">⓿</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<ellipse cx=\"93.2829\" cy=\"-18\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"83.2829\" y=\"-14.3\">2,0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M28.3868,-306.1187C24.3274,-300.1695 20.3629,-293.119 18.2829,-286 14.5436,-273.2017 18.1509,-269.3327 18.2829,-256 19.1718,-166.209 -25.4657,-130.0479 22.2829,-54 30.872,-40.3204 46.4172,-31.6279 60.7767,-26.2201\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"67.6949,-23.8218 62.1129,-29.0909 64.388,-24.9682 61.0811,-26.1147 61.0811,-26.1147 61.0811,-26.1147 64.388,-24.9682 60.0493,-23.1384 67.6949,-23.8218 67.6949,-23.8218\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"29.7829\" y=\"-173.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"10.2829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-159.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M87.3637,-223.0648C66.8163,-226.9743 39.8079,-235.854 26.2829,-256 17.7837,-268.6598 21.7552,-285.4435 27.7384,-298.9175\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"30.7913,-305.2335 24.9089,-300.302 29.2681,-302.0823 27.7449,-298.9311 27.7449,-298.9311 27.7449,-298.9311 29.2681,-302.0823 30.581,-297.5603 30.7913,-305.2335 30.7913,-305.2335\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-274.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"41.2829\" y=\"-260.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.2829\" y=\"-260.8\">❶</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M137.8975,-229.1461C149.2561,-230.2753 159.2829,-227.2266 159.2829,-220 159.2829,-214.3542 153.163,-211.2585 145.0694,-210.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"137.8975,-210.8539 144.8341,-207.5666 141.3968,-210.7849 144.8962,-210.7159 144.8962,-210.7159 144.8962,-210.7159 141.3968,-210.7849 144.9582,-213.8653 137.8975,-210.8539 137.8975,-210.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"159.2829\" y=\"-223.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"184.2829\" y=\"-208.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M137.5613,-210.1518C163.6828,-197.6707 204.6997,-173.4272 222.2829,-138 229.3961,-123.6681 227.8212,-117.0109 222.2829,-102 207.0828,-60.8014 158.2513,-37.884 125.2227,-26.7527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"118.4324,-24.554 126.0624,-23.7137 121.7622,-25.6322 125.092,-26.7105 125.092,-26.7105 125.092,-26.7105 121.7622,-25.6322 124.1216,-29.7073 118.4324,-24.554 118.4324,-24.554\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"233.2829\" y=\"-123.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"226.2829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"242.2829\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"258.2829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<ellipse cx=\"72.2829\" cy=\"-120\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.2829\" y=\"-116.3\">2,1</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M106.9671,-202.5813C100.2031,-186.4767 90.0844,-162.3846 82.5196,-144.373\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"79.6558,-137.5546 85.2708,-142.7887 81.0112,-140.7815 82.3665,-144.0085 82.3665,-144.0085 82.3665,-144.0085 81.0112,-140.7815 79.4623,-145.2283 79.6558,-137.5546 79.6558,-137.5546\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"97.2829\" y=\"-173.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"99.7829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"115.7829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M119.6295,-22.6692C129.8161,-22.8767 138.2829,-21.3203 138.2829,-18 138.2829,-15.5098 133.5203,-14.0117 126.8416,-13.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"119.6295,-13.3308 126.7039,-10.3517 123.1285,-13.4158 126.6274,-13.5008 126.6274,-13.5008 126.6274,-13.5008 123.1285,-13.4158 126.5509,-16.6499 119.6295,-13.3308 119.6295,-13.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.2829\" y=\"-21.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"140.7829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"156.7829\" y=\"-7.8\">❶</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M117.8313,-25.5159C143.4268,-29.5385 175.2829,-27.0332 175.2829,-18 175.2829,-9.7784 148.8938,-6.9644 124.854,-9.558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"117.8313,-10.4841 124.3593,-6.4458 121.3012,-10.0264 124.7712,-9.5688 124.7712,-9.5688 124.7712,-9.5688 121.3012,-10.0264 125.1831,-12.6918 117.8313,-10.4841 117.8313,-10.4841\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"194.7829\" y=\"-21.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"175.2829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"191.2829\" y=\"-7.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"207.2829\" y=\"-7.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M68.4948,-25.2844C54.6203,-30.7737 38.5027,-39.8358 30.2829,-54 23.5906,-65.5321 24.7115,-71.8865 30.2829,-84 33.724,-91.4818 39.5722,-97.9905 45.8288,-103.3386\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"51.6322,-107.9184 44.1858,-106.0547 48.8847,-105.7502 46.1372,-103.5819 46.1372,-103.5819 46.1372,-103.5819 48.8847,-105.7502 48.0886,-101.1092 51.6322,-107.9184 51.6322,-107.9184\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"30.2829\" y=\"-72.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.7829\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M76.0373,-101.7644C79.4118,-85.3742 84.3982,-61.1544 88.1423,-42.9685\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"89.561,-36.0777 91.2347,-43.5691 88.8552,-39.5058 88.1494,-42.9339 88.1494,-42.9339 88.1494,-42.9339 88.8552,-39.5058 85.0641,-42.2986 89.561,-36.0777 89.561,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"84.2829\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.7829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.7829\" y=\"-58.8\">❶</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M95.4242,-110.5925C106.5968,-104.7305 118.9314,-95.9923 125.2829,-84 131.5234,-72.2172 130.0213,-66.463 125.2829,-54 123.0615,-48.1573 119.4091,-42.6573 115.3507,-37.798\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"110.4615,-32.4058 117.4971,-35.4756 112.8125,-34.9987 115.1635,-37.5915 115.1635,-37.5915 115.1635,-37.5915 112.8125,-34.9987 112.8299,-39.7074 110.4615,-32.4058 110.4615,-32.4058\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136.2829\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.2829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.2829\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"161.2829\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M98.6295,-124.6692C108.8161,-124.8767 117.2829,-123.3203 117.2829,-120 117.2829,-117.5098 112.5203,-116.0117 105.8416,-115.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"98.6295,-115.3308 105.7039,-112.3517 102.1285,-115.4158 105.6274,-115.5008 105.6274,-115.5008 105.6274,-115.5008 102.1285,-115.4158 105.5509,-118.6499 98.6295,-115.3308 98.6295,-115.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-123.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.7829\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M97.1504,-127.4501C123.9699,-131.5654 158.2829,-129.082 158.2829,-120 158.2829,-111.6985 129.614,-108.9102 104.2043,-111.6351\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"97.1504,-112.5499 103.6871,-108.5257 100.6214,-112.0997 104.0923,-111.6496 104.0923,-111.6496 104.0923,-111.6496 100.6214,-112.0997 104.4974,-114.7734 97.1504,-112.5499 97.1504,-112.5499\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"158.2829\" y=\"-123.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"160.7829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"176.7829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a1 = spot.translate('X(a W b)')\n",
"a2 = spot.translate('G(Fc U b)')\n",
"prod = spot.product(a1, a2)\n",
"horiz(a1.show(), a2.show(), prod.show())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The builtin `spot.product()` function produces an automaton whose language is the intersection of the two input languages. It does so by building an automaton that keeps track of the runs in the two input automata. The states are labeled by pairs of input states so that we can more easily follow what is going on, but those labels are purely cosmetic. The acceptance condition is the conjunction of the two acceptance condition, but the acceptance sets of one input automaton have been shifted to not conflict with the other automaton.\n",
"\n",
"In fact, that automaton printer has an option to shift those sets in its output, and this is perfect for illustrating products. For instance `a.show('+3')` will display `a1` with all its acceptance sets shifted by 3. \n",
"\n",
"Let's define a function for displaying the three automata involved in a product, using this shift option so we can follow what is going on with the acceptance sets."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table><tr><td style=\"vertical-align: top;\"><svg height=\"307pt\" viewBox=\"0.00 0.00 99.00 307.00\" width=\"99pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 303)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-303 95,-303 95,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.5\" y=\"-284.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"46.5\" y=\"-284.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.5\" y=\"-284.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"22.5\" y=\"-270.8\">[Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>1</title>\n",
"<ellipse cx=\"18\" cy=\"-207\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-203.3\">1</text>\n",
"</g>\n",
"<!-- I&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;1</title>\n",
"<path d=\"M18,-261.8767C18,-258.822 18,-245.0552 18,-232.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-225.0193 21.1501,-232.0192 18,-228.5193 18.0001,-232.0193 18.0001,-232.0193 18.0001,-232.0193 18,-228.5193 14.8501,-232.0193 18,-225.0193 18,-225.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>0</title>\n",
"<ellipse cx=\"18\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M18,-188.9735C18,-176.2586 18,-159.0603 18,-145.0183\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-138.0034 21.1501,-145.0033 18,-141.5034 18.0001,-145.0034 18.0001,-145.0034 18.0001,-145.0034 18,-141.5034 14.8501,-145.0034 18,-138.0034 18,-138.0034\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22.5\" y=\"-159.8\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M34.6641,-127.3828C44.625,-129.0234 54,-126.5625 54,-120 54,-115.0781 48.7266,-112.4634 41.8876,-112.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"34.6641,-112.6172 41.449,-109.0273 38.1569,-112.394 41.6498,-112.1709 41.6498,-112.1709 41.6498,-112.1709 38.1569,-112.394 41.8507,-115.3145 34.6641,-112.6172 34.6641,-112.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-123.8\">a &amp; !b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.5\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"18\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M18,-101.7644C18,-85.5192 18,-61.5825 18,-43.4527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-36.0777 21.1501,-43.0776 18,-39.5777 18.0001,-43.0777 18.0001,-43.0777 18.0001,-43.0777 18,-39.5777 14.8501,-43.0777 18,-36.0777 18,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"21.5\" y=\"-72.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"18\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M33.916,-26.6334C44.1504,-28.8856 54,-26.0078 54,-18 54,-11.869 48.2263,-8.7452 40.9268,-8.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"33.916,-9.3666 40.5477,-5.5008 37.3968,-9 40.8775,-8.6335 40.8775,-8.6335 40.8775,-8.6335 37.3968,-9 41.2074,-11.7662 33.916,-9.3666 33.916,-9.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.5\" y=\"-21.8\">1</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-6.8\">⓿</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"220pt\" viewBox=\"0.00 0.00 208.02 220.00\" width=\"208pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-216 204.0193,-216 204.0193,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"53.0096\" y=\"-197.8\">Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"75.0096\" y=\"-197.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.0096\" y=\"-197.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"127.0096\" y=\"-197.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"143.0096\" y=\"-197.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.0096\" y=\"-183.8\">[gen. Büchi 2]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M68.0193,-174.8767C68.0193,-171.822 68.0193,-158.0552 68.0193,-145.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-138.0193 71.1694,-145.0192 68.0193,-141.5193 68.0194,-145.0193 68.0194,-145.0193 68.0194,-145.0193 68.0193,-141.5193 64.8694,-145.0193 68.0193,-138.0193 68.0193,-138.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.801,-123.2357C95.3342,-123.7856 104.0193,-122.707 104.0193,-120 104.0193,-118.012 99.3354,-116.9023 93.0714,-116.6708\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-116.7643 92.7599,-113.5244 89.3007,-116.7192 92.8004,-116.6742 92.8004,-116.6742 92.8004,-116.6742 89.3007,-116.7192 92.841,-119.8239 85.801,-116.7643 85.801,-116.7643\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-123.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"114.5193\" y=\"-108.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.5885,-124.845C108.7793,-128.5056 141.0193,-126.8906 141.0193,-120 141.0193,-113.7823 114.7687,-111.8601 92.6031,-114.2335\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.5885,-115.155 92.1185,-111.12 89.0587,-114.6991 92.5288,-114.2432 92.5288,-114.2432 92.5288,-114.2432 89.0587,-114.6991 92.9392,-117.3663 85.5885,-115.155 85.5885,-115.155\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.5193\" y=\"-123.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"141.0193\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"157.0193\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M50.3286,-115.3021C35.307,-110.2732 14.6933,-100.6701 5.0193,-84 -1.6731,-72.4679 -1.6731,-65.5321 5.0193,-54 13.3329,-39.6741 29.7258,-30.5674 43.7056,-25.0978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"50.3286,-22.6979 44.8205,-28.0443 47.0379,-23.8903 43.7473,-25.0827 43.7473,-25.0827 43.7473,-25.0827 47.0379,-23.8903 42.6741,-22.1211 50.3286,-22.6979 50.3286,-22.6979\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"5.0193\" y=\"-65.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M68.0193,-36.0777C68.0193,-52.2729 68.0193,-76.2033 68.0193,-94.3707\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-101.7644 64.8694,-94.7644 68.0193,-98.2644 68.0194,-94.7644 68.0194,-94.7644 68.0194,-94.7644 68.0193,-98.2644 71.1694,-94.7645 68.0193,-101.7644 68.0193,-101.7644\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"68.0193\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.5193\" y=\"-57.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M83.5721,-27.9858C91.923,-34.3143 101.423,-43.3143 106.0193,-54 111.2877,-66.2483 111.2877,-71.7517 106.0193,-84 102.4285,-92.3482 95.8446,-99.6675 89.154,-105.4879\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"83.5721,-110.0142 87.0252,-103.1586 86.2906,-107.8098 89.0092,-105.6053 89.0092,-105.6053 89.0092,-105.6053 86.2906,-107.8098 90.9932,-108.052 83.5721,-110.0142 83.5721,-110.0142\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.0193\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.0193\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.0193\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.801,-22.4941C95.3342,-23.2578 104.0193,-21.7598 104.0193,-18 104.0193,-15.2389 99.3354,-13.6976 93.0714,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-13.5059 92.7436,-10.2313 89.3004,-13.4434 92.7999,-13.3808 92.7999,-13.3808 92.7999,-13.3808 89.3004,-13.4434 92.8562,-16.5303 85.801,-13.5059 85.801,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-14.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.0367,-24.4905C109.3677,-29.8803 145.0193,-27.7168 145.0193,-18 145.0193,-9.1942 115.7391,-6.5917 92.1396,-10.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.0367,-11.5095 91.3452,-7.1363 88.4781,-10.8715 91.9194,-10.2335 91.9194,-10.2335 91.9194,-10.2335 88.4781,-10.8715 92.4936,-13.3307 85.0367,-11.5095 85.0367,-11.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.0193\" y=\"-21.8\">b &amp; !c</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.5193\" y=\"-6.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"360pt\" viewBox=\"0.00 0.00 193.93 360.00\" width=\"194pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(.687 .687) rotate(0) translate(4 520)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-520 278.2829,-520 278.2829,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.1415\" y=\"-501.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.1415\" y=\"-501.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.1415\" y=\"-501.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"154.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"190.1415\" y=\"-501.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"206.1415\" y=\"-501.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"93.1415\" y=\"-487.8\">[gen. Büchi 3]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"101.2829\" cy=\"-424\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.2829\" y=\"-420.3\">1,0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M101.2829,-478.8767C101.2829,-475.822 101.2829,-462.0552 101.2829,-449.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"101.2829,-442.0193 104.433,-449.0192 101.283,-445.5193 101.283,-449.0193 101.283,-449.0193 101.283,-449.0193 101.283,-445.5193 98.133,-449.0193 101.2829,-442.0193 101.2829,-442.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"41.2829\" cy=\"-322\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"31.2829\" y=\"-318.3\">0,0</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M76.8936,-415.7341C64.1926,-410.0539 49.7827,-401.1278 42.2829,-388 35.3451,-375.8559 34.7952,-360.2902 36.1192,-347.3255\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"37.0811,-340.0382 39.2879,-347.3903 36.623,-343.5081 36.165,-346.978 36.165,-346.978 36.165,-346.978 36.623,-343.5081 33.042,-346.5658 37.0811,-340.0382 37.0811,-340.0382\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-376.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"52.7829\" y=\"-361.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M97.7675,-405.8671C94.4991,-391.9839 88.6906,-372.772 79.2829,-358 75.3288,-351.7912 70.0726,-345.9073 64.7341,-340.7644\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"59.4134,-335.8838 66.7013,-338.2943 61.9927,-338.2497 64.5719,-340.6156 64.5719,-340.6156 64.5719,-340.6156 61.9927,-338.2497 62.4426,-342.937 59.4134,-335.8838 59.4134,-335.8838\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"103.7829\" y=\"-376.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92.2829\" y=\"-362.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"108.2829\" y=\"-362.8\">❷</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"114.2829\" cy=\"-220\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.2829\" y=\"-216.3\">0,1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M114.6834,-407.9335C133.9222,-383.4915 167.9737,-334.6506 176.2829,-286 178.5277,-272.857 182.9353,-267.5552 176.2829,-256 169.5236,-244.2591 157.3042,-235.9942 145.4896,-230.372\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"139.0049,-227.5151 146.6808,-227.4546 142.2078,-228.9262 145.4108,-230.3373 145.4108,-230.3373 145.4108,-230.3373 142.2078,-228.9262 144.1408,-233.22 139.0049,-227.5151 139.0049,-227.5151\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"171.2829\" y=\"-318.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M64.8975,-331.1461C76.2561,-332.2753 86.2829,-329.2266 86.2829,-322 86.2829,-316.3542 80.163,-313.2585 72.0694,-312.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"64.8975,-312.8539 71.8341,-309.5666 68.3968,-312.7849 71.8962,-312.7159 71.8962,-312.7159 71.8962,-312.7159 68.3968,-312.7849 71.9582,-315.8653 64.8975,-312.8539 64.8975,-312.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.2829\" y=\"-325.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"101.2829\" y=\"-311.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-311.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M62.8599,-310.9996C73.031,-304.8596 84.5918,-296.3528 92.2829,-286 101.2166,-273.9746 106.6578,-258.1091 109.8937,-244.9473\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"111.4727,-237.9549 113.0033,-245.4769 110.7017,-241.369 109.9307,-244.783 109.9307,-244.783 109.9307,-244.783 110.7017,-241.369 106.8581,-244.0891 111.4727,-237.9549 111.4727,-237.9549\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"106.2829\" y=\"-274.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"131.2829\" y=\"-259.8\">⓿</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<ellipse cx=\"93.2829\" cy=\"-18\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"83.2829\" y=\"-14.3\">2,0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M28.3868,-306.1187C24.3274,-300.1695 20.3629,-293.119 18.2829,-286 14.5436,-273.2017 18.1509,-269.3327 18.2829,-256 19.1718,-166.209 -25.4657,-130.0479 22.2829,-54 30.872,-40.3204 46.4172,-31.6279 60.7767,-26.2201\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"67.6949,-23.8218 62.1129,-29.0909 64.388,-24.9682 61.0811,-26.1147 61.0811,-26.1147 61.0811,-26.1147 64.388,-24.9682 60.0493,-23.1384 67.6949,-23.8218 67.6949,-23.8218\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"29.7829\" y=\"-173.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"10.2829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-159.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M87.3637,-223.0648C66.8163,-226.9743 39.8079,-235.854 26.2829,-256 17.7837,-268.6598 21.7552,-285.4435 27.7384,-298.9175\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"30.7913,-305.2335 24.9089,-300.302 29.2681,-302.0823 27.7449,-298.9311 27.7449,-298.9311 27.7449,-298.9311 29.2681,-302.0823 30.581,-297.5603 30.7913,-305.2335 30.7913,-305.2335\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-274.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"41.2829\" y=\"-260.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.2829\" y=\"-260.8\">❶</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M137.8975,-229.1461C149.2561,-230.2753 159.2829,-227.2266 159.2829,-220 159.2829,-214.3542 153.163,-211.2585 145.0694,-210.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"137.8975,-210.8539 144.8341,-207.5666 141.3968,-210.7849 144.8962,-210.7159 144.8962,-210.7159 144.8962,-210.7159 141.3968,-210.7849 144.9582,-213.8653 137.8975,-210.8539 137.8975,-210.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"159.2829\" y=\"-223.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"184.2829\" y=\"-208.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M137.5613,-210.1518C163.6828,-197.6707 204.6997,-173.4272 222.2829,-138 229.3961,-123.6681 227.8212,-117.0109 222.2829,-102 207.0828,-60.8014 158.2513,-37.884 125.2227,-26.7527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"118.4324,-24.554 126.0624,-23.7137 121.7622,-25.6322 125.092,-26.7105 125.092,-26.7105 125.092,-26.7105 121.7622,-25.6322 124.1216,-29.7073 118.4324,-24.554 118.4324,-24.554\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"233.2829\" y=\"-123.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"226.2829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"242.2829\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"258.2829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<ellipse cx=\"72.2829\" cy=\"-120\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.2829\" y=\"-116.3\">2,1</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M106.9671,-202.5813C100.2031,-186.4767 90.0844,-162.3846 82.5196,-144.373\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"79.6558,-137.5546 85.2708,-142.7887 81.0112,-140.7815 82.3665,-144.0085 82.3665,-144.0085 82.3665,-144.0085 81.0112,-140.7815 79.4623,-145.2283 79.6558,-137.5546 79.6558,-137.5546\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"97.2829\" y=\"-173.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"99.7829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"115.7829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M119.6295,-22.6692C129.8161,-22.8767 138.2829,-21.3203 138.2829,-18 138.2829,-15.5098 133.5203,-14.0117 126.8416,-13.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"119.6295,-13.3308 126.7039,-10.3517 123.1285,-13.4158 126.6274,-13.5008 126.6274,-13.5008 126.6274,-13.5008 123.1285,-13.4158 126.5509,-16.6499 119.6295,-13.3308 119.6295,-13.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.2829\" y=\"-21.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"140.7829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"156.7829\" y=\"-7.8\">❶</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M117.8313,-25.5159C143.4268,-29.5385 175.2829,-27.0332 175.2829,-18 175.2829,-9.7784 148.8938,-6.9644 124.854,-9.558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"117.8313,-10.4841 124.3593,-6.4458 121.3012,-10.0264 124.7712,-9.5688 124.7712,-9.5688 124.7712,-9.5688 121.3012,-10.0264 125.1831,-12.6918 117.8313,-10.4841 117.8313,-10.4841\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"194.7829\" y=\"-21.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"175.2829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"191.2829\" y=\"-7.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"207.2829\" y=\"-7.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M68.4948,-25.2844C54.6203,-30.7737 38.5027,-39.8358 30.2829,-54 23.5906,-65.5321 24.7115,-71.8865 30.2829,-84 33.724,-91.4818 39.5722,-97.9905 45.8288,-103.3386\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"51.6322,-107.9184 44.1858,-106.0547 48.8847,-105.7502 46.1372,-103.5819 46.1372,-103.5819 46.1372,-103.5819 48.8847,-105.7502 48.0886,-101.1092 51.6322,-107.9184 51.6322,-107.9184\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"30.2829\" y=\"-72.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.7829\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M76.0373,-101.7644C79.4118,-85.3742 84.3982,-61.1544 88.1423,-42.9685\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"89.561,-36.0777 91.2347,-43.5691 88.8552,-39.5058 88.1494,-42.9339 88.1494,-42.9339 88.1494,-42.9339 88.8552,-39.5058 85.0641,-42.2986 89.561,-36.0777 89.561,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"84.2829\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.7829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.7829\" y=\"-58.8\">❶</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M95.4242,-110.5925C106.5968,-104.7305 118.9314,-95.9923 125.2829,-84 131.5234,-72.2172 130.0213,-66.463 125.2829,-54 123.0615,-48.1573 119.4091,-42.6573 115.3507,-37.798\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"110.4615,-32.4058 117.4971,-35.4756 112.8125,-34.9987 115.1635,-37.5915 115.1635,-37.5915 115.1635,-37.5915 112.8125,-34.9987 112.8299,-39.7074 110.4615,-32.4058 110.4615,-32.4058\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136.2829\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.2829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.2829\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"161.2829\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M98.6295,-124.6692C108.8161,-124.8767 117.2829,-123.3203 117.2829,-120 117.2829,-117.5098 112.5203,-116.0117 105.8416,-115.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"98.6295,-115.3308 105.7039,-112.3517 102.1285,-115.4158 105.6274,-115.5008 105.6274,-115.5008 105.6274,-115.5008 102.1285,-115.4158 105.5509,-118.6499 98.6295,-115.3308 98.6295,-115.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-123.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.7829\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M97.1504,-127.4501C123.9699,-131.5654 158.2829,-129.082 158.2829,-120 158.2829,-111.6985 129.614,-108.9102 104.2043,-111.6351\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"97.1504,-112.5499 103.6871,-108.5257 100.6214,-112.0997 104.0923,-111.6496 104.0923,-111.6496 104.0923,-111.6496 100.6214,-112.0997 104.4974,-114.7734 97.1504,-112.5499 97.1504,-112.5499\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"158.2829\" y=\"-123.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"160.7829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"176.7829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def show_prod(a1, a2, res):\n",
" s1 = a1.num_sets()\n",
" display(horiz(a1.show(), a2.show('.tavb+{}'.format(s1)), res.show()))\n",
"\n",
"show_prod(a1, a2, prod)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Building a product\n",
"\n",
"Let's now rewrite `product()` in Python. We will do that in three steps.\n",
"\n",
"\n",
"## First attempt\n",
"\n",
"First, we build a product without taking care of the acceptance sets. We just want to get the general shape of the algorithm.\n",
"\n",
"We will build an automaton of type `twa_graph`, i.e., an automaton represented explicitely using a graph. In those automata, states are numbered by integers, starting from `0`. (Those states can also be given a different name, which is why the the `product()` shows us something that appears to be labeled by pairs, but the real identifier of each state is an integer.)\n",
"\n",
"We will use a dictionary to keep track of the association between a pair `(ls,rs)` of input states, and its number in the output."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table><tr><td style=\"vertical-align: top;\"><svg height=\"307pt\" viewBox=\"0.00 0.00 99.00 307.00\" width=\"99pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 303)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-303 95,-303 95,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.5\" y=\"-284.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"46.5\" y=\"-284.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.5\" y=\"-284.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"22.5\" y=\"-270.8\">[Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>1</title>\n",
"<ellipse cx=\"18\" cy=\"-207\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-203.3\">1</text>\n",
"</g>\n",
"<!-- I&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;1</title>\n",
"<path d=\"M18,-261.8767C18,-258.822 18,-245.0552 18,-232.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-225.0193 21.1501,-232.0192 18,-228.5193 18.0001,-232.0193 18.0001,-232.0193 18.0001,-232.0193 18,-228.5193 14.8501,-232.0193 18,-225.0193 18,-225.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>0</title>\n",
"<ellipse cx=\"18\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M18,-188.9735C18,-176.2586 18,-159.0603 18,-145.0183\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-138.0034 21.1501,-145.0033 18,-141.5034 18.0001,-145.0034 18.0001,-145.0034 18.0001,-145.0034 18,-141.5034 14.8501,-145.0034 18,-138.0034 18,-138.0034\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22.5\" y=\"-159.8\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M34.6641,-127.3828C44.625,-129.0234 54,-126.5625 54,-120 54,-115.0781 48.7266,-112.4634 41.8876,-112.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"34.6641,-112.6172 41.449,-109.0273 38.1569,-112.394 41.6498,-112.1709 41.6498,-112.1709 41.6498,-112.1709 38.1569,-112.394 41.8507,-115.3145 34.6641,-112.6172 34.6641,-112.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-123.8\">a &amp; !b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.5\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"18\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M18,-101.7644C18,-85.5192 18,-61.5825 18,-43.4527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-36.0777 21.1501,-43.0776 18,-39.5777 18.0001,-43.0777 18.0001,-43.0777 18.0001,-43.0777 18,-39.5777 14.8501,-43.0777 18,-36.0777 18,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"21.5\" y=\"-72.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"18\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M33.916,-26.6334C44.1504,-28.8856 54,-26.0078 54,-18 54,-11.869 48.2263,-8.7452 40.9268,-8.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"33.916,-9.3666 40.5477,-5.5008 37.3968,-9 40.8775,-8.6335 40.8775,-8.6335 40.8775,-8.6335 37.3968,-9 41.2074,-11.7662 33.916,-9.3666 33.916,-9.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.5\" y=\"-21.8\">1</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-6.8\">⓿</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"220pt\" viewBox=\"0.00 0.00 208.02 220.00\" width=\"208pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-216 204.0193,-216 204.0193,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"53.0096\" y=\"-197.8\">Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"75.0096\" y=\"-197.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.0096\" y=\"-197.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"127.0096\" y=\"-197.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"143.0096\" y=\"-197.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.0096\" y=\"-183.8\">[gen. Büchi 2]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M68.0193,-174.8767C68.0193,-171.822 68.0193,-158.0552 68.0193,-145.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-138.0193 71.1694,-145.0192 68.0193,-141.5193 68.0194,-145.0193 68.0194,-145.0193 68.0194,-145.0193 68.0193,-141.5193 64.8694,-145.0193 68.0193,-138.0193 68.0193,-138.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.801,-123.2357C95.3342,-123.7856 104.0193,-122.707 104.0193,-120 104.0193,-118.012 99.3354,-116.9023 93.0714,-116.6708\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-116.7643 92.7599,-113.5244 89.3007,-116.7192 92.8004,-116.6742 92.8004,-116.6742 92.8004,-116.6742 89.3007,-116.7192 92.841,-119.8239 85.801,-116.7643 85.801,-116.7643\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-123.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"114.5193\" y=\"-108.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.5885,-124.845C108.7793,-128.5056 141.0193,-126.8906 141.0193,-120 141.0193,-113.7823 114.7687,-111.8601 92.6031,-114.2335\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.5885,-115.155 92.1185,-111.12 89.0587,-114.6991 92.5288,-114.2432 92.5288,-114.2432 92.5288,-114.2432 89.0587,-114.6991 92.9392,-117.3663 85.5885,-115.155 85.5885,-115.155\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.5193\" y=\"-123.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"141.0193\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"157.0193\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M50.3286,-115.3021C35.307,-110.2732 14.6933,-100.6701 5.0193,-84 -1.6731,-72.4679 -1.6731,-65.5321 5.0193,-54 13.3329,-39.6741 29.7258,-30.5674 43.7056,-25.0978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"50.3286,-22.6979 44.8205,-28.0443 47.0379,-23.8903 43.7473,-25.0827 43.7473,-25.0827 43.7473,-25.0827 47.0379,-23.8903 42.6741,-22.1211 50.3286,-22.6979 50.3286,-22.6979\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"5.0193\" y=\"-65.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M68.0193,-36.0777C68.0193,-52.2729 68.0193,-76.2033 68.0193,-94.3707\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-101.7644 64.8694,-94.7644 68.0193,-98.2644 68.0194,-94.7644 68.0194,-94.7644 68.0194,-94.7644 68.0193,-98.2644 71.1694,-94.7645 68.0193,-101.7644 68.0193,-101.7644\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"68.0193\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.5193\" y=\"-57.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M83.5721,-27.9858C91.923,-34.3143 101.423,-43.3143 106.0193,-54 111.2877,-66.2483 111.2877,-71.7517 106.0193,-84 102.4285,-92.3482 95.8446,-99.6675 89.154,-105.4879\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"83.5721,-110.0142 87.0252,-103.1586 86.2906,-107.8098 89.0092,-105.6053 89.0092,-105.6053 89.0092,-105.6053 86.2906,-107.8098 90.9932,-108.052 83.5721,-110.0142 83.5721,-110.0142\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.0193\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.0193\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.0193\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.801,-22.4941C95.3342,-23.2578 104.0193,-21.7598 104.0193,-18 104.0193,-15.2389 99.3354,-13.6976 93.0714,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-13.5059 92.7436,-10.2313 89.3004,-13.4434 92.7999,-13.3808 92.7999,-13.3808 92.7999,-13.3808 89.3004,-13.4434 92.8562,-16.5303 85.801,-13.5059 85.801,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-14.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.0367,-24.4905C109.3677,-29.8803 145.0193,-27.7168 145.0193,-18 145.0193,-9.1942 115.7391,-6.5917 92.1396,-10.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.0367,-11.5095 91.3452,-7.1363 88.4781,-10.8715 91.9194,-10.2335 91.9194,-10.2335 91.9194,-10.2335 88.4781,-10.8715 92.4936,-13.3307 85.0367,-11.5095 85.0367,-11.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.0193\" y=\"-21.8\">b &amp; !c</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.5193\" y=\"-6.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"360pt\" viewBox=\"0.00 0.00 245.30 360.00\" width=\"245pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(.7692 .7692) rotate(0) translate(4 464)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-464 314.8934,-464 314.8934,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.4467\" y=\"-444.8\">t</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"144.4467\" y=\"-429.8\">[all]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"168.8934\" cy=\"-366\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"168.8934\" y=\"-362.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M168.8934,-420.8767C168.8934,-417.822 168.8934,-404.0552 168.8934,-391.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"168.8934,-384.0193 172.0435,-391.0192 168.8935,-387.5193 168.8935,-391.0193 168.8935,-391.0193 168.8935,-391.0193 168.8935,-387.5193 165.7435,-391.0193 168.8934,-384.0193 168.8934,-384.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"108.8934\" cy=\"-279\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"108.8934\" y=\"-275.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M151.5341,-360.623C137.5721,-355.2854 118.8566,-345.6084 109.8934,-330 105.4145,-322.2003 104.332,-312.5623 104.656,-303.7721\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"105.2152,-296.6468 107.8077,-303.8719 104.9413,-300.1361 104.6674,-303.6254 104.6674,-303.6254 104.6674,-303.6254 104.9413,-300.1361 101.5271,-303.3789 105.2152,-296.6468 105.2152,-296.6468\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.8934\" y=\"-318.8\">!b &amp; c</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M163.369,-348.5657C159.6341,-338.267 154.0731,-325.276 146.8934,-315 141.7699,-307.6669 134.9681,-300.6504 128.5361,-294.7913\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"123.2652,-290.1603 130.603,-292.4142 125.8946,-292.4704 128.5239,-294.7806 128.5239,-294.7806 128.5239,-294.7806 125.8946,-292.4704 126.4448,-297.147 123.2652,-290.1603 123.2652,-290.1603\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"154.8934\" y=\"-318.8\">b</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"177.8934\" cy=\"-192\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"177.8934\" y=\"-188.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M180.2117,-351.915C190.6005,-338.452 205.8582,-317.262 215.8934,-297 227.1214,-274.3299 229.8411,-267.9716 233.8934,-243 234.9613,-236.4194 237.088,-233.8514 233.8934,-228 226.9774,-215.3321 213.4838,-206.4569 201.4752,-200.6885\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"195.0078,-197.7992 202.6839,-197.7785 198.2034,-199.2268 201.399,-200.6545 201.399,-200.6545 201.399,-200.6545 198.2034,-199.2268 200.114,-203.5306 195.0078,-197.7992 195.0078,-197.7992\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"229.8934\" y=\"-275.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M125.5575,-286.3828C135.5184,-288.0234 144.8934,-285.5625 144.8934,-279 144.8934,-274.0781 139.62,-271.4634 132.781,-271.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"125.5575,-271.6172 132.3424,-268.0273 129.0504,-271.394 132.5433,-271.1709 132.5433,-271.1709 132.5433,-271.1709 129.0504,-271.394 132.7441,-274.3145 125.5575,-271.6172 125.5575,-271.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"144.8934\" y=\"-275.3\">a &amp; !b &amp; c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M124.5276,-269.9521C134.5711,-263.4951 147.2986,-254.024 155.8934,-243 162.0355,-235.122 166.8092,-225.2685 170.3162,-216.3284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"172.7528,-209.7177 173.2874,-217.3752 171.5423,-213.0017 170.3318,-216.2858 170.3318,-216.2858 170.3318,-216.2858 171.5423,-213.0017 167.3762,-215.1963 172.7528,-209.7177 172.7528,-209.7177\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"163.8934\" y=\"-231.8\">a &amp; !b &amp; !c</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<ellipse cx=\"156.8934\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"156.8934\" y=\"-14.3\">3</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M96.2651,-265.7776C91.0492,-259.4162 85.5975,-251.3626 82.8934,-243 66.3171,-191.7364 -97.6129,-350.3358 87.8934,-54 97.7166,-38.3081 116.7903,-29.1009 132.3985,-23.932\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"139.2803,-21.8324 133.5041,-26.8881 135.9326,-22.8538 132.5849,-23.8752 132.5849,-23.8752 132.5849,-23.8752 135.9326,-22.8538 131.6657,-20.8622 139.2803,-21.8324 139.2803,-21.8324\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"34.8934\" y=\"-144.8\">b</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M159.6985,-193.6225C138.813,-196.5687 105.4426,-204.839 89.8934,-228 83.5258,-237.4848 87.411,-249.3864 93.2848,-259.3063\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"97.1251,-265.1874 90.6603,-261.0486 95.2115,-262.2568 93.2978,-259.3263 93.2978,-259.3263 93.2978,-259.3263 95.2115,-262.2568 95.9353,-257.604 97.1251,-265.1874 97.1251,-265.1874\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"89.8934\" y=\"-231.8\">a &amp; !b &amp; c</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M194.5575,-199.3828C204.5184,-201.0234 213.8934,-198.5625 213.8934,-192 213.8934,-187.0781 208.62,-184.4634 201.781,-184.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"194.5575,-184.6172 201.3424,-181.0273 198.0504,-184.394 201.5433,-184.1709 201.5433,-184.1709 201.5433,-184.1709 198.0504,-184.394 201.7441,-187.3145 194.5575,-184.6172 194.5575,-184.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"213.8934\" y=\"-188.3\">a &amp; !b &amp; !c</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M194.979,-185.3088C217.4026,-175.4794 255.7956,-154.7857 271.8934,-123 279.1224,-108.7262 279.2001,-101.2342 271.8934,-87 253.8576,-51.8644 209.2337,-32.9969 181.1744,-24.2648\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"174.4239,-22.2595 182.0311,-21.2333 177.779,-23.2562 181.1341,-24.2529 181.1341,-24.2529 181.1341,-24.2529 177.779,-23.2562 180.237,-27.2725 174.4239,-22.2595 174.4239,-22.2595\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"276.8934\" y=\"-101.3\">b &amp; c</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<ellipse cx=\"130.8934\" cy=\"-105\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"130.8934\" y=\"-101.3\">4</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M169.2729,-176.0429C161.8526,-162.3075 151.07,-142.3482 142.8219,-127.0803\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"139.4593,-120.856 145.5579,-125.5175 141.1229,-123.9354 142.7865,-127.0147 142.7865,-127.0147 142.7865,-127.0147 141.1229,-123.9354 140.0151,-128.512 139.4593,-120.856 139.4593,-120.856\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"156.8934\" y=\"-144.8\">b &amp; !c</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M174.6752,-21.775C184.2084,-22.4165 192.8934,-21.1582 192.8934,-18 192.8934,-15.6807 188.2095,-14.386 181.9455,-14.1159\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"174.6752,-14.225 181.6271,-10.9702 178.1748,-14.1724 181.6744,-14.1199 181.6744,-14.1199 181.6744,-14.1199 178.1748,-14.1724 181.7217,-17.2695 174.6752,-14.225 174.6752,-14.225\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"192.8934\" y=\"-14.3\">!b &amp; c</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M174.1084,-23.5866C197.3236,-27.9423 229.8934,-26.0801 229.8934,-18 229.8934,-10.709 203.3743,-8.4807 181.1383,-11.3152\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"174.1084,-12.4134 180.5383,-8.2206 177.5664,-11.8731 181.0245,-11.3329 181.0245,-11.3329 181.0245,-11.3329 177.5664,-11.8731 181.5107,-14.4452 174.1084,-12.4134 174.1084,-12.4134\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"229.8934\" y=\"-14.3\">b</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M139.2027,-22.6979C124.1812,-27.7268 103.5675,-37.3299 93.8934,-54 86.2753,-67.1273 97.7841,-81.0064 109.9244,-90.9661\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"115.4803,-95.2496 108.0133,-93.4701 112.7084,-93.1125 109.9366,-90.9755 109.9366,-90.9755 109.9366,-90.9755 112.7084,-93.1125 111.8599,-88.4808 115.4803,-95.2496 115.4803,-95.2496\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"93.8934\" y=\"-57.8\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M136.1549,-87.3943C140.057,-74.3374 145.4215,-56.3869 149.7168,-42.014\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"151.7285,-35.2827 152.7422,-42.8916 150.7263,-38.6361 149.7241,-41.9896 149.7241,-41.9896 149.7241,-41.9896 150.7263,-38.6361 146.706,-41.0876 151.7285,-35.2827 151.7285,-35.2827\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"144.8934\" y=\"-57.8\">!b &amp; c</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M147.9763,-99.0045C160.9645,-93.437 177.9152,-83.7574 185.8934,-69 192.1058,-57.5089 184.8153,-44.7315 175.9921,-34.8406\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"171.0086,-29.6691 178.1341,-32.5238 173.4372,-32.1894 175.8659,-34.7096 175.8659,-34.7096 175.8659,-34.7096 173.4372,-32.1894 173.5976,-36.8954 171.0086,-29.6691 171.0086,-29.6691\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"187.8934\" y=\"-57.8\">b &amp; c</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M148.6752,-108.775C158.2084,-109.4165 166.8934,-108.1582 166.8934,-105 166.8934,-102.6807 162.2095,-101.386 155.9455,-101.1159\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"148.6752,-101.225 155.6271,-97.9702 152.1748,-101.1724 155.6744,-101.1199 155.6744,-101.1199 155.6744,-101.1199 152.1748,-101.1724 155.7217,-104.2695 148.6752,-101.225 148.6752,-101.225\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"166.8934\" y=\"-101.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M148.2785,-110.5198C172.5993,-114.961 207.8934,-113.1211 207.8934,-105 207.8934,-97.6403 178.9068,-95.4392 155.3699,-98.3967\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"148.2785,-99.4802 154.7224,-95.309 151.7384,-98.9515 155.1982,-98.4229 155.1982,-98.4229 155.1982,-98.4229 151.7384,-98.9515 155.674,-101.5367 148.2785,-99.4802 148.2785,-99.4802\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"207.8934\" y=\"-101.3\">b &amp; !c</text>\n",
"</g>\n",
"</g>\n",
"</svg></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def product1(left, right):\n",
" # A bdd_dict object associates BDD variables (that are \n",
" # used in BDDs labeleing the edges) to atomic propositions.\n",
" bdict = left.get_dict()\n",
" # If the two automata do not have the same BDD dict, then\n",
" # we cannot easily detect compatible transitions.\n",
" if right.get_dict() != bdict:\n",
" raise RuntimeError(\"automata should share their dictionary\")\n",
" \n",
" result = spot.make_twa_graph(bdict)\n",
" # This will be our state dictionary\n",
" sdict = {}\n",
" # The list of output states for which we have not yet\n",
" # computed the successors. Items on this list are triplets\n",
" # of the form (ls, rs, p) where ls,rs are the state number in\n",
" # the left and right automata, and p is the state number if\n",
" # the output automaton.\n",
" todo = []\n",
" # Transform a pair of state number (ls, rs) into a state number in\n",
" # the output automaton, creating a new state if needed. Whenever\n",
" # a new state is created, we can add it to todo.\n",
" def dst(ls, rs):\n",
" pair = (ls, rs)\n",
" p = sdict.get(pair)\n",
" if p is None:\n",
" p = result.new_state()\n",
" sdict[pair] = p\n",
" todo.append((ls, rs, p))\n",
" return p\n",
" \n",
" # Setup the initial state. It always exists.\n",
" result.set_init_state(dst(left.get_init_state_number(), \n",
" right.get_init_state_number()))\n",
"\n",
" # Build all states and edges in the product\n",
" while todo:\n",
" lsrc, rsrc, osrc = todo.pop()\n",
" for lt in left.out(lsrc):\n",
" for rt in right.out(rsrc):\n",
" cond = lt.cond & rt.cond\n",
" if cond != buddy.bddfalse:\n",
" result.new_edge(osrc, dst(lt.dst, rt.dst), cond)\n",
" return result\n",
"\n",
"p1 = product1(a1, a2)\n",
"show_prod(a1, a2, p1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Besides the obvious lack of acceptance condition (which defaults to `t`) and acceptance sets, there is a less obvious problem: we never declared the set of atomic propositions used by the result automaton. This as two consequences:\n",
"- calling `p1.ap()` will return an empty set of atomic propositions"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a, b)\n",
"(c, b)\n",
"()\n"
]
}
],
"source": [
"print(a1.ap())\n",
"print(a2.ap())\n",
"print(p1.ap())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- the `bdd_dict` instance that is shared by the three automata knows that the atomic propositions `a` and `b` are used by automata `a1` and that `b` and `c` are used by `a2`. But it is unaware of `p1`. That means that if we delete automata `a1` and `a2`, then the `bdd_dict` will release the associated BDD variables, and attempting to print automaton `p1` will either crash (because it uses bdd variables that are not associated to any atomic proposition) or display different atomic propositions (in case the BDD variables have been associated to different propositions in the meantime).\n",
"\n",
"These two issues are fixed by either calling `p1.register_ap(...)` for each atomic proposition, or in our case `p1.copy_ap_of(...)` to copy the atomic propositions of each input automaton. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Second attempt: a working product\n",
"\n",
"This fixes the list of atomtic propositions, as discussed above, and also sets the correct acceptance condition.\n",
"The `set_acceptance` method takes two arguments: a number of sets, and an acceptance function. In our case, both of these arguments are readily computed from the number of states and acceptance functions of the input automata."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table><tr><td style=\"vertical-align: top;\"><svg height=\"307pt\" viewBox=\"0.00 0.00 99.00 307.00\" width=\"99pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 303)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-303 95,-303 95,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.5\" y=\"-284.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"46.5\" y=\"-284.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.5\" y=\"-284.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"22.5\" y=\"-270.8\">[Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>1</title>\n",
"<ellipse cx=\"18\" cy=\"-207\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-203.3\">1</text>\n",
"</g>\n",
"<!-- I&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;1</title>\n",
"<path d=\"M18,-261.8767C18,-258.822 18,-245.0552 18,-232.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-225.0193 21.1501,-232.0192 18,-228.5193 18.0001,-232.0193 18.0001,-232.0193 18.0001,-232.0193 18,-228.5193 14.8501,-232.0193 18,-225.0193 18,-225.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>0</title>\n",
"<ellipse cx=\"18\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M18,-188.9735C18,-176.2586 18,-159.0603 18,-145.0183\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-138.0034 21.1501,-145.0033 18,-141.5034 18.0001,-145.0034 18.0001,-145.0034 18.0001,-145.0034 18,-141.5034 14.8501,-145.0034 18,-138.0034 18,-138.0034\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22.5\" y=\"-159.8\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M34.6641,-127.3828C44.625,-129.0234 54,-126.5625 54,-120 54,-115.0781 48.7266,-112.4634 41.8876,-112.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"34.6641,-112.6172 41.449,-109.0273 38.1569,-112.394 41.6498,-112.1709 41.6498,-112.1709 41.6498,-112.1709 38.1569,-112.394 41.8507,-115.3145 34.6641,-112.6172 34.6641,-112.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-123.8\">a &amp; !b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.5\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"18\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M18,-101.7644C18,-85.5192 18,-61.5825 18,-43.4527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-36.0777 21.1501,-43.0776 18,-39.5777 18.0001,-43.0777 18.0001,-43.0777 18.0001,-43.0777 18,-39.5777 14.8501,-43.0777 18,-36.0777 18,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"21.5\" y=\"-72.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"18\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M33.916,-26.6334C44.1504,-28.8856 54,-26.0078 54,-18 54,-11.869 48.2263,-8.7452 40.9268,-8.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"33.916,-9.3666 40.5477,-5.5008 37.3968,-9 40.8775,-8.6335 40.8775,-8.6335 40.8775,-8.6335 37.3968,-9 41.2074,-11.7662 33.916,-9.3666 33.916,-9.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.5\" y=\"-21.8\">1</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-6.8\">⓿</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"220pt\" viewBox=\"0.00 0.00 208.02 220.00\" width=\"208pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-216 204.0193,-216 204.0193,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"53.0096\" y=\"-197.8\">Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"75.0096\" y=\"-197.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.0096\" y=\"-197.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"127.0096\" y=\"-197.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"143.0096\" y=\"-197.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.0096\" y=\"-183.8\">[gen. Büchi 2]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M68.0193,-174.8767C68.0193,-171.822 68.0193,-158.0552 68.0193,-145.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-138.0193 71.1694,-145.0192 68.0193,-141.5193 68.0194,-145.0193 68.0194,-145.0193 68.0194,-145.0193 68.0193,-141.5193 64.8694,-145.0193 68.0193,-138.0193 68.0193,-138.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.801,-123.2357C95.3342,-123.7856 104.0193,-122.707 104.0193,-120 104.0193,-118.012 99.3354,-116.9023 93.0714,-116.6708\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-116.7643 92.7599,-113.5244 89.3007,-116.7192 92.8004,-116.6742 92.8004,-116.6742 92.8004,-116.6742 89.3007,-116.7192 92.841,-119.8239 85.801,-116.7643 85.801,-116.7643\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-123.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"114.5193\" y=\"-108.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.5885,-124.845C108.7793,-128.5056 141.0193,-126.8906 141.0193,-120 141.0193,-113.7823 114.7687,-111.8601 92.6031,-114.2335\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.5885,-115.155 92.1185,-111.12 89.0587,-114.6991 92.5288,-114.2432 92.5288,-114.2432 92.5288,-114.2432 89.0587,-114.6991 92.9392,-117.3663 85.5885,-115.155 85.5885,-115.155\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.5193\" y=\"-123.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"141.0193\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"157.0193\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M50.3286,-115.3021C35.307,-110.2732 14.6933,-100.6701 5.0193,-84 -1.6731,-72.4679 -1.6731,-65.5321 5.0193,-54 13.3329,-39.6741 29.7258,-30.5674 43.7056,-25.0978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"50.3286,-22.6979 44.8205,-28.0443 47.0379,-23.8903 43.7473,-25.0827 43.7473,-25.0827 43.7473,-25.0827 47.0379,-23.8903 42.6741,-22.1211 50.3286,-22.6979 50.3286,-22.6979\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"5.0193\" y=\"-65.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M68.0193,-36.0777C68.0193,-52.2729 68.0193,-76.2033 68.0193,-94.3707\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-101.7644 64.8694,-94.7644 68.0193,-98.2644 68.0194,-94.7644 68.0194,-94.7644 68.0194,-94.7644 68.0193,-98.2644 71.1694,-94.7645 68.0193,-101.7644 68.0193,-101.7644\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"68.0193\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.5193\" y=\"-57.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M83.5721,-27.9858C91.923,-34.3143 101.423,-43.3143 106.0193,-54 111.2877,-66.2483 111.2877,-71.7517 106.0193,-84 102.4285,-92.3482 95.8446,-99.6675 89.154,-105.4879\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"83.5721,-110.0142 87.0252,-103.1586 86.2906,-107.8098 89.0092,-105.6053 89.0092,-105.6053 89.0092,-105.6053 86.2906,-107.8098 90.9932,-108.052 83.5721,-110.0142 83.5721,-110.0142\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.0193\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.0193\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.0193\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.801,-22.4941C95.3342,-23.2578 104.0193,-21.7598 104.0193,-18 104.0193,-15.2389 99.3354,-13.6976 93.0714,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-13.5059 92.7436,-10.2313 89.3004,-13.4434 92.7999,-13.3808 92.7999,-13.3808 92.7999,-13.3808 89.3004,-13.4434 92.8562,-16.5303 85.801,-13.5059 85.801,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-14.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.0367,-24.4905C109.3677,-29.8803 145.0193,-27.7168 145.0193,-18 145.0193,-9.1942 115.7391,-6.5917 92.1396,-10.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.0367,-11.5095 91.3452,-7.1363 88.4781,-10.8715 91.9194,-10.2335 91.9194,-10.2335 91.9194,-10.2335 88.4781,-10.8715 92.4936,-13.3307 85.0367,-11.5095 85.0367,-11.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.0193\" y=\"-21.8\">b &amp; !c</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.5193\" y=\"-6.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"360pt\" viewBox=\"0.00 0.00 213.36 360.00\" width=\"213pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(.687 .687) rotate(0) translate(4 520)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-520 306.563,-520 306.563,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.2815\" y=\"-501.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"100.2815\" y=\"-501.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"116.2815\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.2815\" y=\"-501.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"168.2815\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"204.2815\" y=\"-501.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"220.2815\" y=\"-501.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"107.2815\" y=\"-487.8\">[gen. Büchi 3]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"144.563\" cy=\"-424\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"144.563\" y=\"-420.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M144.563,-478.8767C144.563,-475.822 144.563,-462.0552 144.563,-449.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"144.563,-442.0193 147.7131,-449.0192 144.563,-445.5193 144.5631,-449.0193 144.5631,-449.0193 144.5631,-449.0193 144.563,-445.5193 141.4131,-449.0193 144.563,-442.0193 144.563,-442.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"84.563\" cy=\"-322\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"84.563\" y=\"-318.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M127.1858,-418.6333C113.2128,-413.3019 94.4913,-403.6284 85.563,-388 78.5124,-375.6584 78.059,-359.7831 79.4653,-346.6952\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"80.4077,-339.7511 82.5876,-347.1112 79.937,-343.2193 79.4662,-346.6875 79.4662,-346.6875 79.4662,-346.6875 79.937,-343.2193 76.3448,-346.2638 80.4077,-339.7511 80.4077,-339.7511\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"85.563\" y=\"-376.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"96.063\" y=\"-361.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M141.1148,-406.1536C137.8591,-392.2491 132.0356,-372.8738 122.563,-358 117.7576,-350.4546 111.0292,-343.3891 104.5672,-337.55\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"99.2498,-332.9501 106.6047,-335.1475 101.8968,-335.24 104.5438,-337.5298 104.5438,-337.5298 104.5438,-337.5298 101.8968,-335.24 102.4829,-339.9121 99.2498,-332.9501 99.2498,-332.9501\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"147.063\" y=\"-376.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"135.563\" y=\"-362.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"151.563\" y=\"-362.8\">❷</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"153.563\" cy=\"-220\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"153.563\" y=\"-216.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M156.1755,-410.1878C161.2889,-403.7072 167.1281,-395.7236 171.563,-388 196.0605,-345.336 204.8141,-334.2214 214.563,-286 217.2051,-272.9311 221.1744,-267.5787 214.563,-256 206.6705,-242.1777 191.1646,-233.1296 177.762,-227.5616\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"170.9965,-224.9602 178.6607,-224.5323 174.2633,-226.2163 177.5302,-227.4725 177.5302,-227.4725 177.5302,-227.4725 174.2633,-226.2163 176.3996,-230.4126 170.9965,-224.9602 170.9965,-224.9602\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"209.563\" y=\"-318.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M100.479,-330.6334C110.7134,-332.8856 120.563,-330.0078 120.563,-322 120.563,-315.869 114.7893,-312.7452 107.4898,-312.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"100.479,-313.3666 107.1106,-309.5008 103.9598,-313 107.4405,-312.6335 107.4405,-312.6335 107.4405,-312.6335 103.9598,-313 107.7704,-315.7662 100.479,-313.3666 100.479,-313.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"120.563\" y=\"-325.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"135.563\" y=\"-311.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"151.563\" y=\"-311.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M100.5129,-313.1876C110.6898,-306.83 123.4472,-297.3812 131.563,-286 140.2606,-273.8028 145.6945,-257.932 148.9856,-244.8103\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"150.6006,-237.8442 152.0882,-245.3748 149.8101,-241.2538 149.0196,-244.6633 149.0196,-244.6633 149.0196,-244.6633 149.8101,-241.2538 145.951,-243.9519 150.6006,-237.8442 150.6006,-237.8442\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"144.563\" y=\"-274.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"169.563\" y=\"-259.8\">⓿</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<ellipse cx=\"132.563\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"132.563\" y=\"-14.3\">3</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M71.7413,-309.1899C66.2411,-302.7951 60.4288,-294.5974 57.563,-286 38.1521,-227.7675 -63.5649,-253.2874 61.563,-54 71.6959,-37.8615 91.5103,-28.6641 107.6377,-23.6125\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"114.7401,-21.5732 108.8813,-26.5328 111.376,-22.5392 108.0119,-23.5051 108.0119,-23.5051 108.0119,-23.5051 111.376,-22.5392 107.1426,-20.4775 114.7401,-21.5732 114.7401,-21.5732\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"28.063\" y=\"-173.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"8.563\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.563\" y=\"-159.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"40.563\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M135.3681,-221.6225C114.4825,-224.5687 81.1121,-232.839 65.563,-256 56.5387,-269.4419 62.4324,-287.1918 69.9579,-300.8984\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"73.7251,-307.2657 67.4496,-302.8451 71.9429,-304.2534 70.1606,-301.2411 70.1606,-301.2411 70.1606,-301.2411 71.9429,-304.2534 72.8717,-299.6371 73.7251,-307.2657 73.7251,-307.2657\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"65.563\" y=\"-274.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"80.563\" y=\"-260.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"96.563\" y=\"-260.8\">❶</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M169.479,-228.6334C179.7134,-230.8856 189.563,-228.0078 189.563,-220 189.563,-213.869 183.7893,-210.7452 176.4898,-210.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"169.479,-211.3666 176.1106,-207.5008 172.9598,-211 176.4405,-210.6335 176.4405,-210.6335 176.4405,-210.6335 172.9598,-211 176.7704,-213.7662 169.479,-211.3666 169.479,-211.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"189.563\" y=\"-223.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"214.563\" y=\"-208.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M170.1008,-211.9248C193.1434,-199.6288 233.947,-173.8042 250.563,-138 257.2983,-123.4867 254.9739,-117.38 250.563,-102 243.6275,-77.8176 239.8001,-70.2117 220.563,-54 202.2073,-38.5312 176.3094,-29.0199 157.3611,-23.6894\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"150.4694,-21.8474 158.0455,-20.6118 153.8507,-22.7512 157.232,-23.655 157.232,-23.655 157.232,-23.655 153.8507,-22.7512 156.4186,-26.6981 150.4694,-21.8474 150.4694,-21.8474\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"261.563\" y=\"-123.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"254.563\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"270.563\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"286.563\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<ellipse cx=\"109.563\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"109.563\" y=\"-116.3\">4</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M146.2973,-203.487C139.0364,-186.9852 127.8128,-161.4769 119.682,-142.9978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"116.8395,-136.5375 122.5419,-141.6761 118.2491,-139.7411 119.6587,-142.9447 119.6587,-142.9447 119.6587,-142.9447 118.2491,-139.7411 116.7754,-144.2134 116.8395,-136.5375 116.8395,-136.5375\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136.563\" y=\"-173.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"139.063\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.063\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M150.3447,-22.4941C159.8779,-23.2578 168.563,-21.7598 168.563,-18 168.563,-15.2389 163.8791,-13.6976 157.6151,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"150.3447,-13.5059 157.2873,-10.2313 153.8441,-13.4434 157.3436,-13.3808 157.3436,-13.3808 157.3436,-13.3808 153.8441,-13.4434 157.3999,-16.5303 150.3447,-13.5059 150.3447,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"168.563\" y=\"-21.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"171.063\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"187.063\" y=\"-7.8\">❶</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M149.4251,-24.5712C172.6617,-29.8584 205.563,-27.668 205.563,-18 205.563,-9.2762 178.7739,-6.6408 156.4696,-10.0938\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"149.4251,-11.4288 155.7161,-7.0304 152.8639,-10.7771 156.3027,-10.1253 156.3027,-10.1253 156.3027,-10.1253 152.8639,-10.7771 156.8893,-13.2202 149.4251,-11.4288 149.4251,-11.4288\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"225.063\" y=\"-21.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"205.563\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"221.563\" y=\"-7.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"237.563\" y=\"-7.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M114.8723,-22.6979C99.8507,-27.7268 79.237,-37.3299 69.563,-54 62.8706,-65.5321 64.1384,-71.82 69.563,-84 73.4828,-92.8014 80.7355,-100.3536 87.9998,-106.2349\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"94.0316,-110.7729 86.5441,-109.0817 91.2348,-108.6687 88.4379,-106.5645 88.4379,-106.5645 88.4379,-106.5645 91.2348,-108.6687 90.3317,-104.0474 94.0316,-110.7729 94.0316,-110.7729\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"69.563\" y=\"-72.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"82.063\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M113.5693,-102.233C117.296,-85.7055 122.8826,-60.9305 127.0333,-42.523\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"128.6026,-35.5634 130.1356,-43.0849 127.8327,-38.9777 127.0627,-42.392 127.0627,-42.392 127.0627,-42.392 127.8327,-38.9777 123.9899,-41.6991 128.6026,-35.5634 128.6026,-35.5634\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"123.563\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.063\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"142.063\" y=\"-58.8\">❶</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M126.6458,-114.0045C139.634,-108.437 156.5848,-98.7574 164.563,-84 170.9039,-72.271 169.3014,-66.463 164.563,-54 161.8438,-46.848 156.9804,-40.2096 151.8529,-34.6313\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"146.7071,-29.4265 153.8686,-32.1897 149.1678,-31.9155 151.6286,-34.4044 151.6286,-34.4044 151.6286,-34.4044 149.1678,-31.9155 149.3886,-36.6191 146.7071,-29.4265 146.7071,-29.4265\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"175.563\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"168.563\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"184.563\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"200.563\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M127.3447,-124.4941C136.8779,-125.2578 145.563,-123.7598 145.563,-120 145.563,-117.2389 140.8791,-115.6976 134.6151,-115.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"127.3447,-115.5059 134.2873,-112.2313 130.8441,-115.4434 134.3436,-115.3808 134.3436,-115.3808 134.3436,-115.3808 130.8441,-115.4434 134.3999,-118.5303 127.3447,-115.5059 127.3447,-115.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.563\" y=\"-123.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"158.063\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M126.5804,-126.4905C150.9114,-131.8803 186.563,-129.7168 186.563,-120 186.563,-111.1942 157.2827,-108.5917 133.6833,-112.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"126.5804,-113.5095 132.8889,-109.1363 130.0218,-112.8715 133.4631,-112.2335 133.4631,-112.2335 133.4631,-112.2335 130.0218,-112.8715 134.0373,-115.3307 126.5804,-113.5095 126.5804,-113.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"186.563\" y=\"-123.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"189.063\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"205.063\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a, b, c)\n"
]
}
],
"source": [
"def product2(left, right):\n",
" bdict = left.get_dict()\n",
" if right.get_dict() != bdict:\n",
" raise RuntimeError(\"automata should share their dictionary\")\n",
" \n",
" result = spot.make_twa_graph(bdict)\n",
" # Copy the atomic propositions of the two input automata\n",
" result.copy_ap_of(left)\n",
" result.copy_ap_of(right)\n",
" \n",
" sdict = {}\n",
" todo = []\n",
" def dst(ls, rs):\n",
" pair = (ls, rs)\n",
" p = sdict.get(pair)\n",
" if p is None:\n",
" p = result.new_state()\n",
" sdict[pair] = p\n",
" todo.append((ls, rs, p))\n",
" return p\n",
" \n",
" result.set_init_state(dst(left.get_init_state_number(), \n",
" right.get_init_state_number()))\n",
"\n",
" # The acceptance sets of the right automaton will be shifted by this amount\n",
" shift = left.num_sets()\n",
" result.set_acceptance(shift + right.num_sets(),\n",
" left.get_acceptance() & (right.get_acceptance() << shift))\n",
" \n",
" while todo:\n",
" lsrc, rsrc, osrc = todo.pop()\n",
" for lt in left.out(lsrc):\n",
" for rt in right.out(rsrc):\n",
" cond = lt.cond & rt.cond\n",
" if cond != buddy.bddfalse:\n",
" # membership of this transitions to the new acceptance sets\n",
" acc = lt.acc | (rt.acc << shift)\n",
" result.new_edge(osrc, dst(lt.dst, rt.dst), cond, acc)\n",
" return result\n",
"\n",
"p2 = product2(a1, a2)\n",
"show_prod(a1, a2, p2)\n",
"print(p2.ap())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Third attempt: a more usable product\n",
"\n",
"We could stop with the previous function: the result is a correct product from a theoretical point of view. However our function is still inferior to `spot.product()` in a couple of points:\n",
"- states are not presented as pairs\n",
"- the properties of the resulting automaton are not set\n",
"\n",
"The former point could be addressed by calling `set_state_names()` and passing an array of strings: if a state number is smaller than the size of that array, then the string at that position will be displayed instead of the state number in the dot output. However we can do even better by using `set_product_states()` and passing an array of pairs of states. Besides the output routines, some algorithms actually retrieve this vector of pair of states to work on the product.\n",
"\n",
"Regarding the latter point, consider for instance the deterministic nature of these automata. In Spot an automaton is deterministic if it is both existential (no universal branching) and universal (no non-deterministic branching). In our case we will restrict the algorithm to existantial input (by asserting `is_existential()` on both operands), so we can consider that the `prop_universal()` property is an indication of determinism:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"yes\n",
"yes\n",
"yes\n",
"maybe\n"
]
}
],
"source": [
"print(a1.prop_universal())\n",
"print(a2.prop_universal())\n",
"print(prod.prop_universal())\n",
"print(p1.prop_universal())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Because `a1` and `a2` are deterministic, their product is necessarily deterministic. This is a property that the `spot.product()` algorithm will preserve, but that our version does not *yet* preserve. We can fix that by adding\n",
"\n",
" if left.prop_universal() and right.prop_universal():\n",
" result.prop_universal(True)\n",
" \n",
"at the end of our function. Note that this is **not** the same as\n",
"\n",
" result.prop_universal(left.prop_universal() and right.prop_universal())\n",
"\n",
"because the results the `prop_*()` family of functions take and return instances of `spot.trival` values. These `spot.trival`, can, as their name implies, take one amongst three values representing `yes`, `no`, and `maybe`. `yes` and `no` should be used when we actually know that the automaton is deterministic or not (not deterministic meaning that there actually exists some non determinitic state in the automaton), and `maybe` when we do not know. \n",
"\n",
"The one-liner above is wrong for two reasons:\n",
"\n",
" - if `left` and `right` are non-deterministic, their product could be deterministic, so calling prop_universal(False) would be wrong. \n",
"\n",
" - the use of the `and` operator on `trival` is misleading in non-Boolean context. The `&` operator would be the correct operator to use if you want to work in threed-valued logic. Compare: "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" no & no = no no and no = no \n",
" no & maybe = no no and maybe = no \n",
" no & yes = no no and yes = no \n",
"maybe & no = no maybe and no = maybe\n",
"maybe & maybe = maybe maybe and maybe = maybe\n",
"maybe & yes = maybe maybe and yes = maybe\n",
" yes & no = no yes and no = no \n",
" yes & maybe = maybe yes and maybe = maybe\n",
" yes & yes = yes yes and yes = yes \n"
]
}
],
"source": [
"yes = spot.trival(True)\n",
"no = spot.trival(False)\n",
"maybe = spot.trival_maybe()\n",
"for u in (no, maybe, yes):\n",
" for v in (no, maybe, yes):\n",
" print(\"{u!s:>5} & {v!s:<5} = {r1!s:<5} {u!s:>5} and {v!s:<5} = {r2!s:<5}\"\n",
" .format(u=u, v=v, r1=(u&v), r2=(u and v)))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The reason `maybe and no` is equal to `maybe` is that Python evaluate it like `no if maybe else maybe`, but when a trival is evaluated in a Boolean context (as in `if maybe`) the result is True only if the trival is equal to yes.\n",
"\n",
"So our\n",
"\n",
" if left.prop_universal() and right.prop_universal():\n",
" result.prop_universal(True)\n",
"\n",
"is OK because the `if` body will only be entered of both input automata are known to be deterministic."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However the question is in fact more general than just determinism: the product of two weak automata is weak, the product of two stutter-invariant automata is stutter-invariant, etc. So when writing an algorithm one should consider which of the [property bits](https://spot.lrde.epita.fr/hoa.html#property-bits) are naturally preserved by the algorithm, and set the relevant bits: this can save time later if the resulting automaton is used as input for another algorithm."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table><tr><td style=\"vertical-align: top;\"><svg height=\"307pt\" viewBox=\"0.00 0.00 99.00 307.00\" width=\"99pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 303)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-303 95,-303 95,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"24.5\" y=\"-284.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"46.5\" y=\"-284.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.5\" y=\"-284.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"22.5\" y=\"-270.8\">[Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>1</title>\n",
"<ellipse cx=\"18\" cy=\"-207\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-203.3\">1</text>\n",
"</g>\n",
"<!-- I&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;1</title>\n",
"<path d=\"M18,-261.8767C18,-258.822 18,-245.0552 18,-232.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-225.0193 21.1501,-232.0192 18,-228.5193 18.0001,-232.0193 18.0001,-232.0193 18.0001,-232.0193 18,-228.5193 14.8501,-232.0193 18,-225.0193 18,-225.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>0</title>\n",
"<ellipse cx=\"18\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M18,-188.9735C18,-176.2586 18,-159.0603 18,-145.0183\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-138.0034 21.1501,-145.0033 18,-141.5034 18.0001,-145.0034 18.0001,-145.0034 18.0001,-145.0034 18,-141.5034 14.8501,-145.0034 18,-138.0034 18,-138.0034\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"22.5\" y=\"-159.8\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M34.6641,-127.3828C44.625,-129.0234 54,-126.5625 54,-120 54,-115.0781 48.7266,-112.4634 41.8876,-112.1558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"34.6641,-112.6172 41.449,-109.0273 38.1569,-112.394 41.6498,-112.1709 41.6498,-112.1709 41.6498,-112.1709 38.1569,-112.394 41.8507,-115.3145 34.6641,-112.6172 34.6641,-112.6172\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-123.8\">a &amp; !b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.5\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"18\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"18\" y=\"-14.3\">2</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M18,-101.7644C18,-85.5192 18,-61.5825 18,-43.4527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"18,-36.0777 21.1501,-43.0776 18,-39.5777 18.0001,-43.0777 18.0001,-43.0777 18.0001,-43.0777 18,-39.5777 14.8501,-43.0777 18,-36.0777 18,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"21.5\" y=\"-72.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"18\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M33.916,-26.6334C44.1504,-28.8856 54,-26.0078 54,-18 54,-11.869 48.2263,-8.7452 40.9268,-8.6284\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"33.916,-9.3666 40.5477,-5.5008 37.3968,-9 40.8775,-8.6335 40.8775,-8.6335 40.8775,-8.6335 37.3968,-9 41.2074,-11.7662 33.916,-9.3666 33.916,-9.3666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.5\" y=\"-21.8\">1</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-6.8\">⓿</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"220pt\" viewBox=\"0.00 0.00 208.02 220.00\" width=\"208pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 216)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-216 204.0193,-216 204.0193,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"53.0096\" y=\"-197.8\">Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"75.0096\" y=\"-197.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.0096\" y=\"-197.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"127.0096\" y=\"-197.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"143.0096\" y=\"-197.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.0096\" y=\"-183.8\">[gen. Büchi 2]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-120\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-116.3\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M68.0193,-174.8767C68.0193,-171.822 68.0193,-158.0552 68.0193,-145.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-138.0193 71.1694,-145.0192 68.0193,-141.5193 68.0194,-145.0193 68.0194,-145.0193 68.0194,-145.0193 68.0193,-141.5193 64.8694,-145.0193 68.0193,-138.0193 68.0193,-138.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.801,-123.2357C95.3342,-123.7856 104.0193,-122.707 104.0193,-120 104.0193,-118.012 99.3354,-116.9023 93.0714,-116.6708\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-116.7643 92.7599,-113.5244 89.3007,-116.7192 92.8004,-116.6742 92.8004,-116.6742 92.8004,-116.6742 89.3007,-116.7192 92.841,-119.8239 85.801,-116.7643 85.801,-116.7643\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-123.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"114.5193\" y=\"-108.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;0</title>\n",
"<path d=\"M85.5885,-124.845C108.7793,-128.5056 141.0193,-126.8906 141.0193,-120 141.0193,-113.7823 114.7687,-111.8601 92.6031,-114.2335\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.5885,-115.155 92.1185,-111.12 89.0587,-114.6991 92.5288,-114.2432 92.5288,-114.2432 92.5288,-114.2432 89.0587,-114.6991 92.9392,-117.3663 85.5885,-115.155 85.5885,-115.155\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"152.5193\" y=\"-123.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"141.0193\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"157.0193\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"68.0193\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"68.0193\" y=\"-14.3\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M50.3286,-115.3021C35.307,-110.2732 14.6933,-100.6701 5.0193,-84 -1.6731,-72.4679 -1.6731,-65.5321 5.0193,-54 13.3329,-39.6741 29.7258,-30.5674 43.7056,-25.0978\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"50.3286,-22.6979 44.8205,-28.0443 47.0379,-23.8903 43.7473,-25.0827 43.7473,-25.0827 43.7473,-25.0827 47.0379,-23.8903 42.6741,-22.1211 50.3286,-22.6979 50.3286,-22.6979\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"5.0193\" y=\"-65.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M68.0193,-36.0777C68.0193,-52.2729 68.0193,-76.2033 68.0193,-94.3707\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"68.0193,-101.7644 64.8694,-94.7644 68.0193,-98.2644 68.0194,-94.7644 68.0194,-94.7644 68.0194,-94.7644 68.0193,-98.2644 71.1694,-94.7645 68.0193,-101.7644 68.0193,-101.7644\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"68.0193\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"78.5193\" y=\"-57.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;0</title>\n",
"<path d=\"M83.5721,-27.9858C91.923,-34.3143 101.423,-43.3143 106.0193,-54 111.2877,-66.2483 111.2877,-71.7517 106.0193,-84 102.4285,-92.3482 95.8446,-99.6675 89.154,-105.4879\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"83.5721,-110.0142 87.0252,-103.1586 86.2906,-107.8098 89.0092,-105.6053 89.0092,-105.6053 89.0092,-105.6053 86.2906,-107.8098 90.9932,-108.052 83.5721,-110.0142 83.5721,-110.0142\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.0193\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.0193\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"126.0193\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.801,-22.4941C95.3342,-23.2578 104.0193,-21.7598 104.0193,-18 104.0193,-15.2389 99.3354,-13.6976 93.0714,-13.3761\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.801,-13.5059 92.7436,-10.2313 89.3004,-13.4434 92.7999,-13.3808 92.7999,-13.3808 92.7999,-13.3808 89.3004,-13.4434 92.8562,-16.5303 85.801,-13.5059 85.801,-13.5059\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.0193\" y=\"-14.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M85.0367,-24.4905C109.3677,-29.8803 145.0193,-27.7168 145.0193,-18 145.0193,-9.1942 115.7391,-6.5917 92.1396,-10.1928\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"85.0367,-11.5095 91.3452,-7.1363 88.4781,-10.8715 91.9194,-10.2335 91.9194,-10.2335 91.9194,-10.2335 88.4781,-10.8715 92.4936,-13.3307 85.0367,-11.5095 85.0367,-11.5095\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.0193\" y=\"-21.8\">b &amp; !c</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"155.5193\" y=\"-6.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td><td style=\"vertical-align: top;\"><svg height=\"360pt\" viewBox=\"0.00 0.00 193.93 360.00\" width=\"194pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(.687 .687) rotate(0) translate(4 520)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-520 278.2829,-520 278.2829,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"64.1415\" y=\"-501.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.1415\" y=\"-501.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.1415\" y=\"-501.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"154.1415\" y=\"-501.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"190.1415\" y=\"-501.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"206.1415\" y=\"-501.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"93.1415\" y=\"-487.8\">[gen. Büchi 3]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<ellipse cx=\"101.2829\" cy=\"-424\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"91.2829\" y=\"-420.3\">1,0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M101.2829,-478.8767C101.2829,-475.822 101.2829,-462.0552 101.2829,-449.0759\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"101.2829,-442.0193 104.433,-449.0192 101.283,-445.5193 101.283,-449.0193 101.283,-449.0193 101.283,-449.0193 101.283,-445.5193 98.133,-449.0193 101.2829,-442.0193 101.2829,-442.0193\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<ellipse cx=\"41.2829\" cy=\"-322\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"31.2829\" y=\"-318.3\">0,0</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M76.8936,-415.7341C64.1926,-410.0539 49.7827,-401.1278 42.2829,-388 35.3451,-375.8559 34.7952,-360.2902 36.1192,-347.3255\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"37.0811,-340.0382 39.2879,-347.3903 36.623,-343.5081 36.165,-346.978 36.165,-346.978 36.165,-346.978 36.623,-343.5081 33.042,-346.5658 37.0811,-340.0382 37.0811,-340.0382\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-376.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"52.7829\" y=\"-361.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M97.7675,-405.8671C94.4991,-391.9839 88.6906,-372.772 79.2829,-358 75.3288,-351.7912 70.0726,-345.9073 64.7341,-340.7644\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"59.4134,-335.8838 66.7013,-338.2943 61.9927,-338.2497 64.5719,-340.6156 64.5719,-340.6156 64.5719,-340.6156 61.9927,-338.2497 62.4426,-342.937 59.4134,-335.8838 59.4134,-335.8838\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"103.7829\" y=\"-376.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92.2829\" y=\"-362.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"108.2829\" y=\"-362.8\">❷</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<ellipse cx=\"114.2829\" cy=\"-220\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"104.2829\" y=\"-216.3\">0,1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M114.6834,-407.9335C133.9222,-383.4915 167.9737,-334.6506 176.2829,-286 178.5277,-272.857 182.9353,-267.5552 176.2829,-256 169.5236,-244.2591 157.3042,-235.9942 145.4896,-230.372\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"139.0049,-227.5151 146.6808,-227.4546 142.2078,-228.9262 145.4108,-230.3373 145.4108,-230.3373 145.4108,-230.3373 142.2078,-228.9262 144.1408,-233.22 139.0049,-227.5151 139.0049,-227.5151\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"171.2829\" y=\"-318.3\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M64.8975,-331.1461C76.2561,-332.2753 86.2829,-329.2266 86.2829,-322 86.2829,-316.3542 80.163,-313.2585 72.0694,-312.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"64.8975,-312.8539 71.8341,-309.5666 68.3968,-312.7849 71.8962,-312.7159 71.8962,-312.7159 71.8962,-312.7159 68.3968,-312.7849 71.9582,-315.8653 64.8975,-312.8539 64.8975,-312.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.2829\" y=\"-325.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"101.2829\" y=\"-311.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-311.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M62.8599,-310.9996C73.031,-304.8596 84.5918,-296.3528 92.2829,-286 101.2166,-273.9746 106.6578,-258.1091 109.8937,-244.9473\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"111.4727,-237.9549 113.0033,-245.4769 110.7017,-241.369 109.9307,-244.783 109.9307,-244.783 109.9307,-244.783 110.7017,-241.369 106.8581,-244.0891 111.4727,-237.9549 111.4727,-237.9549\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"106.2829\" y=\"-274.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"131.2829\" y=\"-259.8\">⓿</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<ellipse cx=\"93.2829\" cy=\"-18\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"83.2829\" y=\"-14.3\">2,0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M28.3868,-306.1187C24.3274,-300.1695 20.3629,-293.119 18.2829,-286 14.5436,-273.2017 18.1509,-269.3327 18.2829,-256 19.1718,-166.209 -25.4657,-130.0479 22.2829,-54 30.872,-40.3204 46.4172,-31.6279 60.7767,-26.2201\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"67.6949,-23.8218 62.1129,-29.0909 64.388,-24.9682 61.0811,-26.1147 61.0811,-26.1147 61.0811,-26.1147 64.388,-24.9682 60.0493,-23.1384 67.6949,-23.8218 67.6949,-23.8218\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"29.7829\" y=\"-173.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"10.2829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-159.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.2829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M87.3637,-223.0648C66.8163,-226.9743 39.8079,-235.854 26.2829,-256 17.7837,-268.6598 21.7552,-285.4435 27.7384,-298.9175\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"30.7913,-305.2335 24.9089,-300.302 29.2681,-302.0823 27.7449,-298.9311 27.7449,-298.9311 27.7449,-298.9311 29.2681,-302.0823 30.581,-297.5603 30.7913,-305.2335 30.7913,-305.2335\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"26.2829\" y=\"-274.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"41.2829\" y=\"-260.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"57.2829\" y=\"-260.8\">❶</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M137.8975,-229.1461C149.2561,-230.2753 159.2829,-227.2266 159.2829,-220 159.2829,-214.3542 153.163,-211.2585 145.0694,-210.7126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"137.8975,-210.8539 144.8341,-207.5666 141.3968,-210.7849 144.8962,-210.7159 144.8962,-210.7159 144.8962,-210.7159 141.3968,-210.7849 144.9582,-213.8653 137.8975,-210.8539 137.8975,-210.8539\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"159.2829\" y=\"-223.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"184.2829\" y=\"-208.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M137.5613,-210.1518C163.6828,-197.6707 204.6997,-173.4272 222.2829,-138 229.3961,-123.6681 227.8212,-117.0109 222.2829,-102 207.0828,-60.8014 158.2513,-37.884 125.2227,-26.7527\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"118.4324,-24.554 126.0624,-23.7137 121.7622,-25.6322 125.092,-26.7105 125.092,-26.7105 125.092,-26.7105 121.7622,-25.6322 124.1216,-29.7073 118.4324,-24.554 118.4324,-24.554\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"233.2829\" y=\"-123.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"226.2829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"242.2829\" y=\"-109.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"258.2829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<ellipse cx=\"72.2829\" cy=\"-120\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.2829\" y=\"-116.3\">2,1</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M106.9671,-202.5813C100.2031,-186.4767 90.0844,-162.3846 82.5196,-144.373\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"79.6558,-137.5546 85.2708,-142.7887 81.0112,-140.7815 82.3665,-144.0085 82.3665,-144.0085 82.3665,-144.0085 81.0112,-140.7815 79.4623,-145.2283 79.6558,-137.5546 79.6558,-137.5546\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"97.2829\" y=\"-173.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"99.7829\" y=\"-159.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"115.7829\" y=\"-159.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M119.6295,-22.6692C129.8161,-22.8767 138.2829,-21.3203 138.2829,-18 138.2829,-15.5098 133.5203,-14.0117 126.8416,-13.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"119.6295,-13.3308 126.7039,-10.3517 123.1285,-13.4158 126.6274,-13.5008 126.6274,-13.5008 126.6274,-13.5008 123.1285,-13.4158 126.5509,-16.6499 119.6295,-13.3308 119.6295,-13.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"138.2829\" y=\"-21.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"140.7829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"156.7829\" y=\"-7.8\">❶</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M117.8313,-25.5159C143.4268,-29.5385 175.2829,-27.0332 175.2829,-18 175.2829,-9.7784 148.8938,-6.9644 124.854,-9.558\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"117.8313,-10.4841 124.3593,-6.4458 121.3012,-10.0264 124.7712,-9.5688 124.7712,-9.5688 124.7712,-9.5688 121.3012,-10.0264 125.1831,-12.6918 117.8313,-10.4841 117.8313,-10.4841\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"194.7829\" y=\"-21.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"175.2829\" y=\"-7.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"191.2829\" y=\"-7.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"207.2829\" y=\"-7.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M68.4948,-25.2844C54.6203,-30.7737 38.5027,-39.8358 30.2829,-54 23.5906,-65.5321 24.7115,-71.8865 30.2829,-84 33.724,-91.4818 39.5722,-97.9905 45.8288,-103.3386\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"51.6322,-107.9184 44.1858,-106.0547 48.8847,-105.7502 46.1372,-103.5819 46.1372,-103.5819 46.1372,-103.5819 48.8847,-105.7502 48.0886,-101.1092 51.6322,-107.9184 51.6322,-107.9184\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"30.2829\" y=\"-72.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"42.7829\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M76.0373,-101.7644C79.4118,-85.3742 84.3982,-61.1544 88.1423,-42.9685\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"89.561,-36.0777 91.2347,-43.5691 88.8552,-39.5058 88.1494,-42.9339 88.1494,-42.9339 88.1494,-42.9339 88.8552,-39.5058 85.0641,-42.2986 89.561,-36.0777 89.561,-36.0777\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"84.2829\" y=\"-72.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"86.7829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.7829\" y=\"-58.8\">❶</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M95.4242,-110.5925C106.5968,-104.7305 118.9314,-95.9923 125.2829,-84 131.5234,-72.2172 130.0213,-66.463 125.2829,-54 123.0615,-48.1573 119.4091,-42.6573 115.3507,-37.798\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"110.4615,-32.4058 117.4971,-35.4756 112.8125,-34.9987 115.1635,-37.5915 115.1635,-37.5915 115.1635,-37.5915 112.8125,-34.9987 112.8299,-39.7074 110.4615,-32.4058 110.4615,-32.4058\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136.2829\" y=\"-72.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.2829\" y=\"-58.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"145.2829\" y=\"-58.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"161.2829\" y=\"-58.8\">❷</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M98.6295,-124.6692C108.8161,-124.8767 117.2829,-123.3203 117.2829,-120 117.2829,-117.5098 112.5203,-116.0117 105.8416,-115.5059\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"98.6295,-115.3308 105.7039,-112.3517 102.1285,-115.4158 105.6274,-115.5008 105.6274,-115.5008 105.6274,-115.5008 102.1285,-115.4158 105.5509,-118.6499 98.6295,-115.3308 98.6295,-115.3308\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"117.2829\" y=\"-123.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129.7829\" y=\"-108.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M97.1504,-127.4501C123.9699,-131.5654 158.2829,-129.082 158.2829,-120 158.2829,-111.6985 129.614,-108.9102 104.2043,-111.6351\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"97.1504,-112.5499 103.6871,-108.5257 100.6214,-112.0997 104.0923,-111.6496 104.0923,-111.6496 104.0923,-111.6496 100.6214,-112.0997 104.4974,-114.7734 97.1504,-112.5499 97.1504,-112.5499\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"158.2829\" y=\"-123.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"160.7829\" y=\"-109.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"176.7829\" y=\"-109.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg></td></tr></table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"yes\n"
]
}
],
"source": [
"def product3(left, right):\n",
" # the twa_graph.is_existential() method returns a Boolean, not a spot.trival\n",
" if not (left.is_existential() and right.is_existential()):\n",
" raise RuntimeError(\"alternating automata are not supported\")\n",
" bdict = left.get_dict()\n",
" if right.get_dict() != bdict:\n",
" raise RuntimeError(\"automata should share their dictionary\")\n",
" \n",
" result = spot.make_twa_graph(bdict)\n",
" result.copy_ap_of(left)\n",
" result.copy_ap_of(right)\n",
" \n",
" pairs = [] # our array of state pairs\n",
" sdict = {}\n",
" todo = []\n",
" def dst(ls, rs):\n",
" pair = (ls, rs)\n",
" p = sdict.get(pair)\n",
" if p is None:\n",
" p = result.new_state()\n",
" sdict[pair] = p\n",
" todo.append((ls, rs, p))\n",
" pairs.append((ls, rs)) # name each state\n",
" return p\n",
" \n",
" result.set_init_state(dst(left.get_init_state_number(), \n",
" right.get_init_state_number()))\n",
"\n",
" shift = left.num_sets()\n",
" result.set_acceptance(shift + right.num_sets(),\n",
" left.get_acceptance() & (right.get_acceptance() << shift))\n",
" \n",
" while todo:\n",
" lsrc, rsrc, osrc = todo.pop()\n",
" for lt in left.out(lsrc):\n",
" for rt in right.out(rsrc):\n",
" cond = lt.cond & rt.cond\n",
" if cond != buddy.bddfalse:\n",
" acc = lt.acc | (rt.acc << shift)\n",
" result.new_edge(osrc, dst(lt.dst, rt.dst), cond, acc)\n",
"\n",
" # Remember the origin of our states\n",
" result.set_product_states(pairs)\n",
" \n",
" # Loop over all the properties we want to preserve if they hold in both automata\n",
" for p in ('prop_universal', 'prop_complete', 'prop_weak', 'prop_inherently_weak', \n",
" 'prop_terminal', 'prop_stutter_invariant', 'prop_state_acc'):\n",
" if getattr(left, p)() and getattr(right, p)():\n",
" getattr(result, p)(True)\n",
" return result\n",
"\n",
"p3 = product3(a1, a2)\n",
"show_prod(a1, a2, p3)\n",
"print(p3.prop_universal())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For development, it is useful to know that we can force the automaton printer to show the real state numbers (not the pairs) by passing option `1`, and that we can retrieve the associated pairs ourselves. Note that the pairs also appear as tooltips when we mouse over the states."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<svg height=\"285pt\" viewBox=\"0.00 0.00 592.00 285.00\" width=\"592pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 281)\">\n",
"<title>G</title>\n",
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-281 588,-281 588,4 -4,4\" stroke=\"transparent\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"219\" y=\"-262.8\">Inf(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"241\" y=\"-262.8\">⓿</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"257\" y=\"-262.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"293\" y=\"-262.8\">❶</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"309\" y=\"-262.8\">)&amp;Inf(</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"345\" y=\"-262.8\">❷</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"361\" y=\"-262.8\">)</text>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"248\" y=\"-248.8\">[gen. Büchi 3]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\">\n",
"<title>0</title>\n",
"<g id=\"a_node2\"><a xlink:title=\"1,0\">\n",
"<ellipse cx=\"56\" cy=\"-126\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56\" y=\"-122.3\">0</text>\n",
"</a>\n",
"</g>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\">\n",
"<title>I-&gt;0</title>\n",
"<path d=\"M1.1233,-126C4.178,-126 17.9448,-126 30.9241,-126\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"37.9807,-126 30.9808,-129.1501 34.4807,-126 30.9807,-126.0001 30.9807,-126.0001 30.9807,-126.0001 34.4807,-126 30.9807,-122.8501 37.9807,-126 37.9807,-126\" stroke=\"#000000\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\">\n",
"<title>1</title>\n",
"<g id=\"a_node3\"><a xlink:title=\"0,0\">\n",
"<ellipse cx=\"167.5\" cy=\"-177\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"167.5\" y=\"-173.3\">1</text>\n",
"</a>\n",
"</g>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge2\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M69.1181,-138.6698C75.5804,-144.3361 83.7459,-150.6941 92,-155 107.9158,-163.3027 127.3992,-168.8802 142.5869,-172.3417\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"149.6631,-173.8736 142.1551,-175.4711 146.2424,-173.133 142.8216,-172.3924 142.8216,-172.3924 142.8216,-172.3924 146.2424,-173.133 143.4882,-169.3138 149.6631,-173.8736 149.6631,-173.8736\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92\" y=\"-186.8\">!b &amp; c</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"102.5\" y=\"-171.8\">❶</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\">\n",
"<title>0-&gt;1</title>\n",
"<path d=\"M73.2617,-120.6902C88.7453,-116.9568 111.6351,-114.0541 129,-123 141.695,-129.5401 151.1261,-142.4187 157.4759,-153.9587\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"160.6877,-160.1832 154.6785,-155.407 159.0828,-157.0729 157.4778,-153.9625 157.4778,-153.9625 157.4778,-153.9625 159.0828,-157.0729 160.2771,-152.5181 160.6877,-160.1832 160.6877,-160.1832\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"106\" y=\"-140.8\">b</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"94.5\" y=\"-126.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"110.5\" y=\"-126.8\">❷</text>\n",
"</g>\n",
"<!-- 2 -->\n",
"<g class=\"node\" id=\"node4\">\n",
"<title>2</title>\n",
"<g id=\"a_node4\"><a xlink:title=\"0,1\">\n",
"<ellipse cx=\"308\" cy=\"-126\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"308\" y=\"-122.3\">2</text>\n",
"</a>\n",
"</g>\n",
"</g>\n",
"<!-- 0&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge4\">\n",
"<title>0-&gt;2</title>\n",
"<path d=\"M72.5377,-118.7733C78.5485,-116.4847 85.4701,-114.2316 92,-113 170.6248,-98.1702 193.7319,-93.3904 272,-110 276.4784,-110.9504 281.0762,-112.4977 285.4246,-114.2647\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"291.9997,-117.1683 284.3238,-117.222 288.798,-115.7544 285.5963,-114.3405 285.5963,-114.3405 285.5963,-114.3405 288.798,-115.7544 286.8688,-111.4589 291.9997,-117.1683 291.9997,-117.1683\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"147\" y=\"-106.8\">!b &amp; !c</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\">\n",
"<title>1-&gt;1</title>\n",
"<path d=\"M157.9254,-192.5414C155.2303,-202.9087 158.4219,-213 167.5,-213 174.4504,-213 177.9503,-207.0847 177.9995,-199.6591\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"177.0746,-192.5414 181.1004,-199.0771 177.5256,-196.0123 177.9767,-199.4831 177.9767,-199.4831 177.9767,-199.4831 177.5256,-196.0123 174.853,-199.889 177.0746,-192.5414 177.0746,-192.5414\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136.5\" y=\"-230.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"151.5\" y=\"-216.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"167.5\" y=\"-216.8\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge6\">\n",
"<title>1-&gt;2</title>\n",
"<path d=\"M185.6949,-175.756C207.2158,-173.7128 243.6893,-168.4254 272,-155 278.1774,-152.0706 284.23,-147.8795 289.5567,-143.5909\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"295.0234,-138.9541 291.7226,-145.8843 292.3542,-141.2181 289.685,-143.482 289.685,-143.482 289.685,-143.482 292.3542,-141.2181 287.6475,-141.0798 295.0234,-138.9541 295.0234,-138.9541\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"206\" y=\"-191.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"231\" y=\"-176.8\">⓿</text>\n",
"</g>\n",
"<!-- 3 -->\n",
"<g class=\"node\" id=\"node5\">\n",
"<title>3</title>\n",
"<g id=\"a_node5\"><a xlink:title=\"2,0\">\n",
"<ellipse cx=\"560\" cy=\"-122\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"560\" y=\"-118.3\">3</text>\n",
"</a>\n",
"</g>\n",
"</g>\n",
"<!-- 1&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge7\">\n",
"<title>1-&gt;3</title>\n",
"<path d=\"M180.0664,-190.2926C187.0211,-196.6698 196.2232,-203.6406 206,-207 247.9817,-221.4253 370.6446,-210.4272 458,-192 488.3946,-185.5884 498.8313,-187.2064 524,-169 533.2023,-162.3433 541.1677,-152.6765 547.2495,-143.8383\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"551.1511,-137.8992 549.9404,-145.4792 549.2294,-140.8244 547.3077,-143.7497 547.3077,-143.7497 547.3077,-143.7497 549.2294,-140.8244 544.6749,-142.0202 551.1511,-137.8992 551.1511,-137.8992\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"363.5\" y=\"-226.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"344\" y=\"-212.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"360\" y=\"-212.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"376\" y=\"-212.8\">❷</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge8\">\n",
"<title>2-&gt;1</title>\n",
"<path d=\"M290.6394,-120.6388C269.3942,-115.1254 232.9307,-109.1261 206,-123 193.305,-129.5401 183.8739,-142.4187 177.5241,-153.9587\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"174.3123,-160.1832 174.7229,-152.5181 175.9172,-157.0729 177.5222,-153.9625 177.5222,-153.9625 177.5222,-153.9625 175.9172,-157.0729 180.3215,-155.407 174.3123,-160.1832 174.3123,-160.1832\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"208\" y=\"-140.8\">a &amp; !b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"223\" y=\"-126.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"239\" y=\"-126.8\">❶</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;2 -->\n",
"<g class=\"edge\" id=\"edge9\">\n",
"<title>2-&gt;2</title>\n",
"<path d=\"M297.8486,-141.1666C294.7725,-151.6641 298.1563,-162 308,-162 315.5366,-162 319.2865,-155.9413 319.2497,-148.39\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"318.1514,-141.1666 322.318,-147.6135 318.6776,-144.6269 319.2037,-148.0871 319.2037,-148.0871 319.2037,-148.0871 318.6776,-144.6269 316.0895,-148.5607 318.1514,-141.1666 318.1514,-141.1666\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"275\" y=\"-180.8\">a &amp; !b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"300\" y=\"-165.8\">⓿</text>\n",
"</g>\n",
"<!-- 2&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge10\">\n",
"<title>2-&gt;3</title>\n",
"<path d=\"M324.8198,-132.8824C361.9304,-147.02 453.1538,-175.986 524,-151 530.5588,-148.6869 536.8022,-144.6168 542.1923,-140.2443\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"547.6807,-135.4499 544.4813,-142.4275 545.0448,-137.7525 542.4089,-140.0551 542.4089,-140.0551 542.4089,-140.0551 545.0448,-137.7525 540.3365,-137.6828 547.6807,-135.4499 547.6807,-135.4499\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"417\" y=\"-177.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"410\" y=\"-163.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"426\" y=\"-163.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"442\" y=\"-163.8\">❷</text>\n",
"</g>\n",
"<!-- 4 -->\n",
"<g class=\"node\" id=\"node6\">\n",
"<title>4</title>\n",
"<g id=\"a_node6\"><a xlink:title=\"2,1\">\n",
"<ellipse cx=\"434\" cy=\"-18\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"434\" y=\"-14.3\">4</text>\n",
"</a>\n",
"</g>\n",
"</g>\n",
"<!-- 2&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge11\">\n",
"<title>2-&gt;4</title>\n",
"<path d=\"M321.9656,-114.0295C344.4825,-94.7293 388.8694,-56.6833 414.4967,-34.7171\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"419.9718,-30.0242 416.707,-36.9714 417.3144,-32.3019 414.657,-34.5797 414.657,-34.5797 414.657,-34.5797 417.3144,-32.3019 412.607,-32.1881 419.9718,-30.0242 419.9718,-30.0242\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"349.5\" y=\"-111.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"352\" y=\"-97.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"368\" y=\"-97.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge12\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M554.6442,-139.4099C553.6444,-149.0879 555.4297,-158 560,-158 563.3563,-158 565.2107,-153.1936 565.563,-146.8073\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"565.3558,-139.4099 568.7007,-146.3189 565.4539,-142.9085 565.5519,-146.4072 565.5519,-146.4072 565.5519,-146.4072 565.4539,-142.9085 562.4031,-146.4954 565.3558,-139.4099 565.3558,-139.4099\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"541.5\" y=\"-175.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"544\" y=\"-161.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"560\" y=\"-161.8\">❶</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge13\">\n",
"<title>3-&gt;3</title>\n",
"<path d=\"M551.925,-138.3178C545.824,-159.0356 548.5156,-186 560,-186 570.2283,-186 573.482,-164.6115 569.7613,-145.2966\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"568.075,-138.3178 572.7811,-144.3821 568.8971,-141.7199 569.7192,-145.122 569.7192,-145.122 569.7192,-145.122 568.8971,-141.7199 566.6573,-145.8619 568.075,-138.3178 568.075,-138.3178\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"555.5\" y=\"-203.8\">b</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"536\" y=\"-189.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"552\" y=\"-189.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"568\" y=\"-189.8\">❷</text>\n",
"</g>\n",
"<!-- 3&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge14\">\n",
"<title>3-&gt;4</title>\n",
"<path d=\"M556.3218,-104.117C550.4249,-77.3995 538.078,-29.1108 524,-19 505.1228,-5.4425 477.8009,-7.3011 458.2189,-11.2389\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"451.3847,-12.759 457.5337,-8.1642 454.8012,-11.999 458.2177,-11.2391 458.2177,-11.2391 458.2177,-11.2391 454.8012,-11.999 458.9017,-14.3139 451.3847,-12.759 451.3847,-12.759\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"479.5\" y=\"-37.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"492\" y=\"-22.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge15\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M438.451,-35.7938C444.065,-54.539 455.5503,-83.5712 476,-100 492.5562,-113.3008 516.3279,-118.625 534.3603,-120.7238\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"541.6993,-121.4396 534.4266,-123.8951 538.2159,-121.0998 534.7324,-120.76 534.7324,-120.76 534.7324,-120.76 538.2159,-121.0998 535.0382,-117.6249 541.6993,-121.4396 541.6993,-121.4396\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"481.5\" y=\"-136.8\">!b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"484\" y=\"-122.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"500\" y=\"-122.8\">❶</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;3 -->\n",
"<g class=\"edge\" id=\"edge16\">\n",
"<title>4-&gt;3</title>\n",
"<path d=\"M448.1455,-29.879C456.0113,-36.106 466.1724,-43.5495 476,-49 496.0646,-60.128 506.1574,-53.5757 524,-68 534.3764,-76.3884 542.8563,-88.5714 548.9739,-99.2432\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"552.4736,-105.6452 546.3519,-101.014 550.7948,-102.5741 549.1159,-99.503 549.1159,-99.503 549.1159,-99.503 550.7948,-102.5741 551.8799,-97.9921 552.4736,-105.6452 552.4736,-105.6452\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"483\" y=\"-85.8\">b &amp; c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"476\" y=\"-71.8\">⓿</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"492\" y=\"-71.8\">❶</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"508\" y=\"-71.8\">❷</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge17\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M428.1524,-35.0373C426.959,-44.8579 428.9082,-54 434,-54 437.8188,-54 439.87,-48.8576 440.1534,-42.1433\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"439.8476,-35.0373 443.2958,-41.8954 439.9981,-38.5341 440.1487,-42.0308 440.1487,-42.0308 440.1487,-42.0308 439.9981,-38.5341 437.0016,-42.1663 439.8476,-35.0373 439.8476,-35.0373\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"413.5\" y=\"-72.8\">!b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"426\" y=\"-57.8\">⓿</text>\n",
"</g>\n",
"<!-- 4&#45;&gt;4 -->\n",
"<g class=\"edge\" id=\"edge18\">\n",
"<title>4-&gt;4</title>\n",
"<path d=\"M425.326,-33.947C418.347,-55.2861 421.2383,-84 434,-84 445.4158,-84 448.9334,-61.0236 444.5528,-40.9026\" fill=\"none\" stroke=\"#000000\"/>\n",
"<polygon fill=\"#000000\" points=\"442.674,-33.947 447.5405,-39.8834 443.5867,-37.3259 444.4995,-40.7048 444.4995,-40.7048 444.4995,-40.7048 443.5867,-37.3259 441.4584,-41.5263 442.674,-33.947 442.674,-33.947\" stroke=\"#000000\"/>\n",
"<text fill=\"#000000\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"415.5\" y=\"-101.8\">b &amp; !c</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"418\" y=\"-87.8\">⓿</text>\n",
"<text fill=\"#ff7f00\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"434\" y=\"-87.8\">❷</text>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text/plain": [
"<IPython.core.display.SVG object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0: (1, 0)\n",
"1: (0, 0)\n",
"2: (0, 1)\n",
"3: (2, 0)\n",
"4: (2, 1)\n"
]
}
],
"source": [
"display(p3.show('.1'))\n",
"pairs = p3.get_product_states()\n",
"for s in range(p3.num_states()):\n",
" print(\"{}: {}\".format(s, pairs[s]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Timings\n",
"\n",
"As an indication of how slow it is to implement such an algorithm using the Python bindings of Spot, consider the following comparison:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"252 µs ± 4.96 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
]
}
],
"source": [
"%timeit product3(a1, a2)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.4 µs ± 210 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
]
}
],
"source": [
"%timeit spot.product(a1, a2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Depending on the machine where this notebook has been run, using the C++ version of the product can be 1 to 2 orders of magnitude faster. This is due to all the type conversions (converting Python types to C++ types) that occurs everytime a function/method of Spot is called from Python. When calling high-level C++ functions (such as `spot.product()`) from Python, the overhead is negligible because most of the time is spent on the C++ side, actually executing the function. However when calling low-level functions (such as `new_edge()`, `new_state()`, `out()`) most of the time is spent converting the arguments from Python to C++ and the results from C++ to Python.\n",
"\n",
"Despite that speed difference, Python can be useful to prototype an algorithm before implementing it in C++."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}