Fixes #319. * spot/twaalgos/dot.cc: Enable "a" by default. * bin/common_aoutput.cc, NEWS: Document it. * doc/org/autfilt.org, doc/org/concepts.org, doc/org/dstar2tgba.org, doc/org/hierarchy.org, doc/org/ltl2tgba.org, doc/org/oaut.org, doc/org/randaut.org, doc/org/satmin.org, doc/org/tut23.org, doc/org/tut24.org, doc/org/tut30.org, doc/org/tut31.org: Adjust or simplify the documentation. * tests/core/det.test, tests/core/dstar.test, tests/core/monitor.test, tests/core/neverclaimread.test, tests/core/readsave.test, tests/core/tgbagraph.test, tests/core/wdba.test, tests/python/_autparserr.ipynb, tests/python/automata-io.ipynb, tests/python/automata.ipynb, tests/python/highlighting.ipynb tests/python/ltsmin-dve.ipynb, tests/python/ltsmin-pml.ipynb, tests/python/product.ipynb, tests/python/testingaut.ipynb, tests/python/word.ipynb: Adjust test cases.
652 lines
49 KiB
Text
652 lines
49 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from IPython.display import display, HTML\n",
|
|
"import spot\n",
|
|
"spot.setup()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"To translate a formula into a Testing Automaton\n",
|
|
"\n",
|
|
"Start by building a Buchi automaton"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"171pt\" height=\"125pt\"\n",
|
|
" viewBox=\"0.00 0.00 171.00 124.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 120.8)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-120.8 167,-120.8 167,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"58.5\" y=\"-86.6\" font-family=\"Lato\" font-size=\"14.00\">[Büchi]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-22\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-18.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-22C2.79388,-22 17.1543,-22 30.6317,-22\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-22 30.9419,-25.1501 34.4419,-22 30.9419,-22.0001 30.9419,-22.0001 30.9419,-22.0001 34.4419,-22 30.9418,-18.8501 37.9419,-22 37.9419,-22\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-39.0373C48.3189,-48.8579 50.4453,-58 56,-58 60.166,-58 62.4036,-52.8576 62.7128,-46.1433\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-39.0373 65.8541,-45.8818 62.5434,-42.5335 62.7076,-46.0296 62.7076,-46.0296 62.7076,-46.0296 62.5434,-42.5335 59.561,-46.1774 62.3792,-39.0373 62.3792,-39.0373\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"52.5\" y=\"-61.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"141\" cy=\"-22\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"141\" cy=\"-22\" rx=\"22\" ry=\"22\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"141\" y=\"-18.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M74.1977,-22C85.0734,-22 99.3874,-22 111.887,-22\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"118.997,-22 111.997,-25.1501 115.497,-22 111.997,-22.0001 111.997,-22.0001 111.997,-22.0001 115.497,-22 111.997,-18.8501 118.997,-22 118.997,-22\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-25.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->1 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M132.994,-42.5808C131.886,-52.8447 134.555,-62 141,-62 145.834,-62 148.544,-56.8502 149.129,-49.9451\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"149.006,-42.5808 152.273,-49.5273 149.065,-46.0803 149.123,-49.5798 149.123,-49.5798 149.123,-49.5798 149.065,-46.0803 145.973,-49.6324 149.006,-42.5808 149.006,-42.5808\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"136.5\" y=\"-65.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7ff5dc5e2b70> >"
|
|
]
|
|
},
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"f = spot.formula('a U Gb')\n",
|
|
"a = f.translate('ba')\n",
|
|
"a"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Then, gather all the atomic proposition in the formula, and create an automaton with changesets"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<svg height=\"264pt\" viewBox=\"0.00 0.00 734.00 263.82\" width=\"734pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g class=\"graph\" id=\"graph0\" transform=\"scale(0.705397 0.705397) rotate(0) translate(4 370)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" points=\"-4,4 -4,-370 1036.55,-370 1036.55,4 -4,4\" stroke=\"none\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g class=\"node\" id=\"node2\"><title>1</title>\n",
|
|
"<ellipse cx=\"118\" cy=\"-250\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118\" y=\"-246.3\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g class=\"edge\" id=\"edge1\"><title>0->1</title>\n",
|
|
"<path d=\"M54.2216,-250C63.4559,-250 73.9612,-250 83.7008,-250\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"90.9659,-250 83.9659,-253.15 87.4659,-250 83.9659,-250 83.9659,-250 83.9659,-250 87.4659,-250 83.9658,-246.85 90.9659,-250 90.9659,-250\" stroke=\"black\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g class=\"node\" id=\"node3\"><title>2</title>\n",
|
|
"<ellipse cx=\"540.969\" cy=\"-195\" fill=\"#ffffaa\" rx=\"37.4533\" ry=\"26.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.969\" y=\"-198.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.969\" y=\"-183.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge2\"><title>1->2</title>\n",
|
|
"<path d=\"M134.194,-264.679C169.197,-296.674 258.802,-368.267 340.711,-348 412.767,-330.171 430.391,-312.703 482.664,-260 491.805,-250.784 492.221,-246.86 500.664,-237 504.862,-232.098 509.445,-226.994 513.951,-222.103\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"518.79,-216.899 516.33,-224.171 516.406,-219.462 514.023,-222.026 514.023,-222.026 514.023,-222.026 516.406,-219.462 511.716,-219.881 518.79,-216.899 518.79,-216.899\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"322.211\" y=\"-354.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g class=\"node\" id=\"node4\"><title>3</title>\n",
|
|
"<ellipse cx=\"250.355\" cy=\"-154\" fill=\"#ffffaa\" rx=\"35.2113\" ry=\"26.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250.355\" y=\"-157.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250.355\" y=\"-142.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge3\"><title>1->3</title>\n",
|
|
"<path d=\"M136.852,-236.853C157.767,-221.45 192.789,-195.658 218.211,-176.936\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"224.127,-172.579 220.359,-179.267 221.309,-174.655 218.491,-176.73 218.491,-176.73 218.491,-176.73 221.309,-174.655 216.623,-174.194 224.127,-172.579 224.127,-172.579\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"180\" y=\"-220.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g class=\"node\" id=\"node5\"><title>4</title>\n",
|
|
"<ellipse cx=\"396.187\" cy=\"-195\" fill=\"#ffffaa\" rx=\"37.4533\" ry=\"26.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"396.187\" y=\"-198.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"396.187\" y=\"-183.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge4\"><title>1->4</title>\n",
|
|
"<path d=\"M144.886,-246.934C186.554,-241.693 270.897,-229.822 340.711,-212 345.355,-210.815 350.189,-209.47 354.975,-208.069\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"361.926,-205.988 356.124,-211.013 358.573,-206.992 355.22,-207.996 355.22,-207.996 355.22,-207.996 358.573,-206.992 354.317,-204.978 361.926,-205.988 361.926,-205.988\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250.355\" y=\"-240.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g class=\"node\" id=\"node6\"><title>5</title>\n",
|
|
"<ellipse cx=\"687.63\" cy=\"-147\" fill=\"#ffffaa\" rx=\"35.2259\" ry=\"26.7574\" stroke=\"black\"/>\n",
|
|
"<ellipse cx=\"687.63\" cy=\"-147\" fill=\"none\" rx=\"39.2112\" ry=\"30.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"687.63\" y=\"-150.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"687.63\" y=\"-135.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge5\"><title>2->5</title>\n",
|
|
"<path d=\"M575.157,-183.988C595.719,-177.165 622.32,-168.339 644.379,-161.019\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"651.068,-158.8 645.416,-163.994 647.746,-159.902 644.424,-161.004 644.424,-161.004 644.424,-161.004 647.746,-159.902 643.432,-158.015 651.068,-158.8 651.068,-158.8\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"614.774\" y=\"-179.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g class=\"node\" id=\"node7\"><title>6</title>\n",
|
|
"<ellipse cx=\"835.462\" cy=\"-148\" fill=\"#ffffaa\" rx=\"37.4556\" ry=\"26.7574\" stroke=\"black\"/>\n",
|
|
"<ellipse cx=\"835.462\" cy=\"-148\" fill=\"none\" rx=\"41.4533\" ry=\"30.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"835.462\" y=\"-151.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"835.462\" y=\"-136.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge6\"><title>2->6</title>\n",
|
|
"<path d=\"M574.392,-207.559C611.864,-220.215 675.041,-235.791 726.985,-220 755.269,-211.402 782.88,-192.611 803.034,-176.382\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"808.515,-171.884 805.102,-178.76 805.809,-174.104 803.104,-176.325 803.104,-176.325 803.104,-176.325 805.809,-174.104 801.105,-173.89 808.515,-171.884 808.515,-171.884\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"687.63\" y=\"-230.8\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g class=\"node\" id=\"node8\"><title>7</title>\n",
|
|
"<ellipse cx=\"988.243\" cy=\"-61\" fill=\"#ffffaa\" rx=\"37.4556\" ry=\"26.7574\" stroke=\"black\"/>\n",
|
|
"<ellipse cx=\"988.243\" cy=\"-61\" fill=\"none\" rx=\"41.4533\" ry=\"30.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"988.243\" y=\"-64.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"988.243\" y=\"-49.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->7 -->\n",
|
|
"<g class=\"edge\" id=\"edge7\"><title>2->7</title>\n",
|
|
"<path d=\"M562.76,-173.063C582.859,-153.085 615.071,-124.161 648.274,-107 742.826,-58.129 871.122,-55.14 939.575,-57.7432\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"946.815,-58.048 939.688,-60.9006 943.318,-57.9007 939.821,-57.7534 939.821,-57.7534 939.821,-57.7534 943.318,-57.9007 939.953,-54.6062 946.815,-58.048 946.815,-58.048\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.485\" y=\"-76.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g class=\"node\" id=\"node9\"><title>8</title>\n",
|
|
"<ellipse cx=\"988.243\" cy=\"-269\" fill=\"#ffffaa\" rx=\"40.1285\" ry=\"26.7574\" stroke=\"black\"/>\n",
|
|
"<ellipse cx=\"988.243\" cy=\"-269\" fill=\"none\" rx=\"44.111\" ry=\"30.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"988.243\" y=\"-272.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"988.243\" y=\"-257.8\">!a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g class=\"edge\" id=\"edge8\"><title>2->8</title>\n",
|
|
"<path d=\"M567.175,-214.29C576.815,-220.961 588.168,-228.008 599.274,-233 619.825,-242.237 626.228,-241.348 648.274,-246 712.424,-259.535 728.677,-263.226 793.985,-269 838.687,-272.952 850.063,-270.556 894.938,-271 908.715,-271.136 912.162,-271.225 925.938,-271 929.442,-270.943 933.058,-270.867 936.699,-270.779\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"943.71,-270.595 936.795,-273.928 940.211,-270.687 936.713,-270.779 936.713,-270.779 936.713,-270.779 940.211,-270.687 936.63,-267.63 943.71,-270.595 943.71,-270.595\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.485\" y=\"-271.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge10\"><title>3->2</title>\n",
|
|
"<path d=\"M284.419,-146.772C321.302,-139.953 382.51,-132.364 433.664,-144 459.239,-149.817 485.844,-162.588 506.041,-173.894\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"512.364,-177.502 504.723,-176.768 509.324,-175.767 506.284,-174.033 506.284,-174.033 506.284,-174.033 509.324,-175.767 507.846,-171.297 512.364,-177.502 512.364,-177.502\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"396.187\" y=\"-147.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge9\"><title>3->3</title>\n",
|
|
"<path d=\"M237.346,-179.37C236.448,-189.924 240.785,-198.87 250.355,-198.87 257.683,-198.87 261.942,-193.626 263.133,-186.431\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"263.365,-179.37 266.284,-186.47 263.25,-182.868 263.135,-186.366 263.135,-186.366 263.135,-186.366 263.25,-182.868 259.987,-186.263 263.365,-179.37 263.365,-179.37\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"250.355\" y=\"-202.67\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge11\"><title>3->4</title>\n",
|
|
"<path d=\"M277.29,-171.585C285.43,-176.344 294.662,-181.001 303.711,-184 318.716,-188.973 335.769,-191.746 351.052,-193.276\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"358.396,-193.931 351.144,-196.446 354.91,-193.62 351.424,-193.309 351.424,-193.309 351.424,-193.309 354.91,-193.62 351.704,-190.171 358.396,-193.931 358.396,-193.931\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"322.211\" y=\"-196.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge13\"><title>3->5</title>\n",
|
|
"<path d=\"M281.956,-141.797C288.997,-139.463 296.529,-137.335 303.711,-136 327.76,-131.531 334.264,-134.839 358.711,-134 400.02,-132.582 410.335,-131.667 451.664,-131 465.44,-130.778 468.897,-130.461 482.664,-131 537.24,-133.137 599.841,-138.48 641.136,-142.406\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"648.338,-143.096 641.069,-145.564 644.854,-142.762 641.37,-142.428 641.37,-142.428 641.37,-142.428 644.854,-142.762 641.671,-139.292 648.338,-143.096 648.338,-143.096\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"467.164\" y=\"-134.8\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge14\"><title>3->6</title>\n",
|
|
"<path d=\"M279.775,-138.833C287.362,-135.384 295.686,-132.117 303.711,-130 485.876,-81.9374 541.705,-72.8597 726.985,-107 749.747,-111.194 773.928,-119.994 793.578,-128.37\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"800.059,-131.187 792.383,-131.286 796.849,-129.792 793.639,-128.397 793.639,-128.397 793.639,-128.397 796.849,-129.792 794.895,-125.508 800.059,-131.187 800.059,-131.187\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.969\" y=\"-92.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->7 -->\n",
|
|
"<g class=\"edge\" id=\"edge15\"><title>3->7</title>\n",
|
|
"<path d=\"M261.396,-128.224C280.358,-84.3838 325.861,-0 395.187,-0 395.187,-0 395.187,-0 836.462,-0 877.852,-0 921.275,-19.997 950.834,-37.0922\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"956.926,-40.6879 949.296,-39.8423 953.912,-38.9087 950.898,-37.1296 950.898,-37.1296 950.898,-37.1296 953.912,-38.9087 952.499,-34.4169 956.926,-40.6879 956.926,-40.6879\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"614.774\" y=\"-3.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->8 -->\n",
|
|
"<g class=\"edge\" id=\"edge16\"><title>3->8</title>\n",
|
|
"<path d=\"M264.11,-178.915C278.761,-207.451 301.126,-250.719 303.711,-254 337.135,-296.426 341.177,-334 395.187,-334 395.187,-334 395.187,-334 836.462,-334 878.111,-334 921.334,-312.827 950.768,-294.65\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"956.834,-290.825 952.593,-297.223 953.873,-292.692 950.912,-294.558 950.912,-294.558 950.912,-294.558 953.873,-292.692 949.232,-291.894 956.834,-290.825 956.834,-290.825\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"614.774\" y=\"-337.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g class=\"node\" id=\"node10\"><title>9</title>\n",
|
|
"<ellipse cx=\"540.969\" cy=\"-273\" fill=\"#ffffaa\" rx=\"40.1111\" ry=\"26.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.969\" y=\"-276.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.969\" y=\"-261.8\">!a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g class=\"edge\" id=\"edge12\"><title>3->9</title>\n",
|
|
"<path d=\"M266.399,-178.297C284.528,-205.023 317.726,-246.503 358.711,-264 401.905,-282.44 456.252,-282.457 494.119,-279.254\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"501.464,-278.575 494.784,-282.356 497.979,-278.897 494.494,-279.219 494.494,-279.219 494.494,-279.219 497.979,-278.897 494.204,-276.083 501.464,-278.575 501.464,-278.575\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"396.187\" y=\"-283.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge18\"><title>4->2</title>\n",
|
|
"<path d=\"M433.957,-195C452.943,-195 476.24,-195 496.154,-195\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"503.324,-195 496.324,-198.15 499.824,-195 496.324,-195 496.324,-195 496.324,-195 499.824,-195 496.324,-191.85 503.324,-195 503.324,-195\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"467.164\" y=\"-198.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge17\"><title>4->3</title>\n",
|
|
"<path d=\"M367.838,-177.29C359.434,-172.587 349.956,-167.991 340.711,-165 325.63,-160.121 308.477,-157.381 293.258,-155.851\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"285.96,-155.193 293.215,-152.685 289.446,-155.508 292.932,-155.822 292.932,-155.822 292.932,-155.822 289.446,-155.508 292.649,-158.959 285.96,-155.193 285.96,-155.193\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"322.211\" y=\"-168.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge19\"><title>4->4</title>\n",
|
|
"<path d=\"M383.178,-220.37C382.28,-230.924 386.617,-239.87 396.187,-239.87 403.515,-239.87 407.774,-234.626 408.965,-227.431\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"409.197,-220.37 412.116,-227.47 409.082,-223.868 408.967,-227.366 408.967,-227.366 408.967,-227.366 409.082,-223.868 405.819,-227.263 409.197,-220.37 409.197,-220.37\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"396.187\" y=\"-243.67\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->9 -->\n",
|
|
"<g class=\"edge\" id=\"edge20\"><title>4->9</title>\n",
|
|
"<path d=\"M426.426,-210.973C448.595,-223.083 479.212,-239.809 503.067,-252.841\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"509.29,-256.24 501.636,-255.649 506.218,-254.562 503.146,-252.884 503.146,-252.884 503.146,-252.884 506.218,-254.562 504.657,-250.12 509.29,-256.24 509.29,-256.24\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"467.164\" y=\"-244.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge21\"><title>5->5</title>\n",
|
|
"<path d=\"M674.159,-176.099C673.718,-186.944 678.208,-195.87 687.63,-195.87 694.843,-195.87 699.166,-190.638 700.598,-183.318\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"701.1,-176.099 703.756,-183.301 700.857,-179.591 700.614,-183.082 700.614,-183.082 700.614,-183.082 700.857,-179.591 697.472,-182.864 701.1,-176.099 701.1,-176.099\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"687.63\" y=\"-199.67\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge22\"><title>5->6</title>\n",
|
|
"<path d=\"M725.792,-139.455C732.169,-138.433 738.749,-137.549 744.985,-137 758.71,-135.792 762.267,-135.721 775.985,-137 780.004,-137.375 784.159,-137.891 788.315,-138.498\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"795.284,-139.594 787.88,-141.618 791.827,-139.05 788.369,-138.506 788.369,-138.506 788.369,-138.506 791.827,-139.05 788.859,-135.395 795.284,-139.594 795.284,-139.594\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.485\" y=\"-140.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->7 -->\n",
|
|
"<g class=\"edge\" id=\"edge23\"><title>5->7</title>\n",
|
|
"<path d=\"M719.331,-128.042C739.779,-116.24 767.636,-101.698 793.985,-93 842.172,-77.0919 899.842,-68.8569 939.569,-64.7548\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"946.772,-64.036 940.12,-67.8656 943.289,-64.3836 939.807,-64.7312 939.807,-64.7312 939.807,-64.7312 943.289,-64.3836 939.494,-61.5968 946.772,-64.036 946.772,-64.036\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"835.462\" y=\"-96.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->8 -->\n",
|
|
"<g class=\"edge\" id=\"edge24\"><title>5->8</title>\n",
|
|
"<path d=\"M715.091,-169.773C735.438,-186.201 764.903,-207.737 793.985,-221 840.327,-242.135 897.337,-254.841 937.388,-261.82\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"944.663,-263.058 937.233,-264.989 941.212,-262.471 937.762,-261.884 937.762,-261.884 937.762,-261.884 941.212,-262.471 938.29,-258.778 944.663,-263.058 944.663,-263.058\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"835.462\" y=\"-253.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge25\"><title>6->5</title>\n",
|
|
"<path d=\"M793.929,-151.338C778.595,-152.199 760.985,-152.708 744.985,-152 741.397,-151.841 737.685,-151.626 733.956,-151.373\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"726.795,-150.846 734.007,-148.218 730.286,-151.103 733.776,-151.36 733.776,-151.36 733.776,-151.36 730.286,-151.103 733.545,-154.501 726.795,-150.846 726.795,-150.846\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.485\" y=\"-156.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge26\"><title>6->6</title>\n",
|
|
"<path d=\"M821.6,-177.584C821.302,-188.208 825.922,-196.87 835.462,-196.87 842.765,-196.87 847.185,-191.793 848.722,-184.644\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"849.323,-177.584 851.868,-184.825 849.026,-181.071 848.729,-184.558 848.729,-184.558 848.729,-184.558 849.026,-181.071 845.591,-184.291 849.323,-177.584 849.323,-177.584\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"835.462\" y=\"-200.67\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g class=\"edge\" id=\"edge27\"><title>6->7</title>\n",
|
|
"<path d=\"M869.334,-129.975C886.312,-120.578 907.32,-108.816 925.938,-98 933.496,-93.6091 941.527,-88.8391 949.201,-84.2294\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"955.545,-80.4067 951.175,-86.7176 952.547,-82.2131 949.549,-84.0196 949.549,-84.0196 949.549,-84.0196 952.547,-82.2131 947.924,-81.3215 955.545,-80.4067 955.545,-80.4067\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"910.438\" y=\"-118.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->8 -->\n",
|
|
"<g class=\"edge\" id=\"edge28\"><title>6->8</title>\n",
|
|
"<path d=\"M864.748,-170.288C882.391,-184.228 905.543,-202.592 925.938,-219 934.889,-226.201 944.535,-234.033 953.466,-241.317\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"958.923,-245.77 951.508,-243.784 956.211,-243.557 953.499,-241.344 953.499,-241.344 953.499,-241.344 956.211,-243.557 955.491,-238.903 958.923,-245.77 958.923,-245.77\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"910.438\" y=\"-222.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>"
|
|
],
|
|
"text/plain": [
|
|
"<IPython.core.display.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"propset = spot.atomic_prop_collect_as_bdd(f, a)\n",
|
|
"ta = spot.tgba_to_ta(a, propset, True, True, False, False, True)\n",
|
|
"ta.show('.A')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Then, remove dead states, and remove stuttering transitions (i.e., transitions labeled by `{}`), marking as *livelock accepting* (rectangles) any states from which there exists a an accepting path labeled by `{}`."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<svg height=\"138pt\" viewBox=\"0.00 0.00 734.00 137.51\" width=\"734pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g class=\"graph\" id=\"graph0\" transform=\"scale(0.948378 0.948378) rotate(0) translate(4 141)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" points=\"-4,4 -4,-141 769.953,-141 769.953,4 -4,4\" stroke=\"none\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g class=\"node\" id=\"node2\"><title>1</title>\n",
|
|
"<ellipse cx=\"118\" cy=\"-60\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118\" y=\"-56.3\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g class=\"edge\" id=\"edge1\"><title>0->1</title>\n",
|
|
"<path d=\"M54.2216,-60C63.4559,-60 73.9612,-60 83.7008,-60\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"90.9659,-60 83.9659,-63.1501 87.4659,-60 83.9659,-60.0001 83.9659,-60.0001 83.9659,-60.0001 87.4659,-60 83.9658,-56.8501 90.9659,-60 90.9659,-60\" stroke=\"black\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g class=\"node\" id=\"node3\"><title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"537.953,-131 483.953,-131 483.953,-93 537.953,-93 537.953,-131\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"510.953\" y=\"-115.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"510.953\" y=\"-100.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge2\"><title>1->2</title>\n",
|
|
"<path d=\"M140.661,-70.1783C147.693,-73.2591 155.593,-76.488 163,-79 240.685,-105.346 260.59,-113.924 342,-124 375.06,-128.092 383.642,-124.34 416.953,-124 438.734,-123.778 444.362,-125.882 465.953,-123 469.473,-122.53 473.118,-121.885 476.734,-121.14\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"483.615,-119.605 477.468,-124.204 480.199,-120.367 476.783,-121.129 476.783,-121.129 476.783,-121.129 480.199,-120.367 476.097,-118.055 483.615,-119.605 483.615,-119.605\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-125.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g class=\"node\" id=\"node4\"><title>3</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"269,-79 215,-79 215,-41 269,-41 269,-79\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"242\" y=\"-63.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"242\" y=\"-48.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge3\"><title>1->3</title>\n",
|
|
"<path d=\"M145.172,-60C163.505,-60 188.15,-60 207.856,-60\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"214.871,-60 207.871,-63.1501 211.371,-60 207.871,-60.0001 207.871,-60.0001 207.871,-60.0001 211.371,-60 207.871,-56.8501 214.871,-60 214.871,-60\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"180\" y=\"-63.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g class=\"node\" id=\"node5\"><title>4</title>\n",
|
|
"<ellipse cx=\"379.477\" cy=\"-55\" fill=\"#ffffaa\" rx=\"37.4533\" ry=\"26.7407\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"379.477\" y=\"-58.8\">0</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"379.477\" y=\"-43.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge4\"><title>1->4</title>\n",
|
|
"<path d=\"M138.748,-48.1679C157.586,-37.6194 187.14,-22.9544 215,-17 258.628,-7.67553 308.546,-23.0974 341.624,-37.0003\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"348.418,-39.9345 340.743,-40.0511 345.205,-38.5469 341.992,-37.1593 341.992,-37.1593 341.992,-37.1593 345.205,-38.5469 343.241,-34.2674 348.418,-39.9345 348.418,-39.9345\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"242\" y=\"-20.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g class=\"node\" id=\"node6\"><title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"647.953,-113 593.953,-113 593.953,-75 647.953,-75 647.953,-113\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"none\" points=\"651.953,-117 589.953,-117 589.953,-71 651.953,-71 651.953,-117\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"620.953\" y=\"-97.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"620.953\" y=\"-82.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge5\"><title>2->5</title>\n",
|
|
"<path d=\"M538.097,-107.643C551.509,-105.407 568.079,-102.646 582.794,-100.193\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"589.847,-99.0177 583.46,-103.276 586.394,-99.5932 582.942,-100.169 582.942,-100.169 582.942,-100.169 586.394,-99.5932 582.424,-97.0615 589.847,-99.0177 589.847,-99.0177\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"563.953\" y=\"-108.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge6\"><title>3->2</title>\n",
|
|
"<path d=\"M269.277,-71.5305C275.054,-73.8451 281.184,-76.1356 287,-78 352.341,-98.9458 432.701,-107.147 476.899,-110.237\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"483.935,-110.707 476.741,-113.384 480.443,-110.474 476.95,-110.241 476.95,-110.241 476.95,-110.241 480.443,-110.474 477.16,-107.098 483.935,-110.707 483.935,-110.707\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"379.477\" y=\"-108.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge7\"><title>3->4</title>\n",
|
|
"<path d=\"M269.009,-47.4294C274.803,-45.1796 281.007,-43.1784 287,-42 303.379,-38.7793 321.557,-40.3251 337.366,-43.2944\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"344.448,-44.7469 336.957,-46.4261 341.019,-44.0436 337.59,-43.3404 337.59,-43.3404 337.59,-43.3404 341.019,-44.0436 338.223,-40.2546 344.448,-44.7469 344.448,-44.7469\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-45.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g class=\"node\" id=\"node7\"><title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"761.953,-75 707.953,-75 707.953,-37 761.953,-37 761.953,-75\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"none\" points=\"765.953,-79 703.953,-79 703.953,-33 765.953,-33 765.953,-79\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"734.953\" y=\"-59.8\">1</text>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"734.953\" y=\"-44.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge8\"><title>3->6</title>\n",
|
|
"<path d=\"M268.995,-40.6854C295.22,-23.1454 337.576,-0 378.477,-0 378.477,-0 378.477,-0 621.953,-0 650.369,-0 678.966,-14.5993 700.151,-28.8894\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"705.923,-32.8993 698.377,-31.4926 703.049,-30.9025 700.174,-28.9056 700.174,-28.9056 700.174,-28.9056 703.049,-30.9025 701.971,-26.3186 705.923,-32.8993 705.923,-32.8993\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"510.953\" y=\"-3.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge10\"><title>4->2</title>\n",
|
|
"<path d=\"M413.281,-67.1377C429.326,-73.3042 448.825,-81.1418 465.953,-89 469.667,-90.7039 473.515,-92.5654 477.319,-94.4678\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"483.648,-97.6873 475.981,-97.3213 480.528,-96.1005 477.409,-94.5137 477.409,-94.5137 477.409,-94.5137 480.528,-96.1005 478.837,-91.706 483.648,-97.6873 483.648,-97.6873\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"450.453\" y=\"-92.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge9\"><title>4->3</title>\n",
|
|
"<path d=\"M341.937,-56.3485C321.456,-57.1045 296.105,-58.0401 276.192,-58.775\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"269.121,-59.0359 276,-55.6298 272.619,-58.9068 276.117,-58.7777 276.117,-58.7777 276.117,-58.7777 272.619,-58.9068 276.233,-61.9255 269.121,-59.0359 269.121,-59.0359\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-62.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->6 -->\n",
|
|
"<g class=\"edge\" id=\"edge11\"><title>5->6</title>\n",
|
|
"<path d=\"M645.792,-70.8632C653,-65.2601 661.312,-60.0196 669.953,-57 678.314,-54.0787 687.671,-52.8793 696.595,-52.6129\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"703.631,-52.5842 696.644,-55.7628 700.131,-52.5985 696.631,-52.6128 696.631,-52.6128 696.631,-52.6128 700.131,-52.5985 696.618,-49.4629 703.631,-52.5842 703.631,-52.5842\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"677.953\" y=\"-60.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge12\"><title>6->5</title>\n",
|
|
"<path d=\"M703.857,-66.2114C690.036,-70.9005 673.516,-76.5056 658.944,-81.4496\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"651.967,-83.8167 657.584,-78.5846 655.282,-82.6921 658.596,-81.5676 658.596,-81.5676 658.596,-81.5676 655.282,-82.6921 659.608,-84.5505 651.967,-83.8167 651.967,-83.8167\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"677.953\" y=\"-81.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>"
|
|
],
|
|
"text/plain": [
|
|
"<IPython.core.display.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"ta = spot.tgba_to_ta(a, propset, True, True, False, False, False)\n",
|
|
"ta.show('.A')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Finally, use bisimulation to minimize the number of states."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<svg height=\"175pt\" viewBox=\"0.00 0.00 639.00 175.00\" width=\"639pt\" 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 171)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" points=\"-4,4 -4,-171 635,-171 635,4 -4,4\" stroke=\"none\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g class=\"node\" id=\"node2\"><title>1</title>\n",
|
|
"<ellipse cx=\"118\" cy=\"-144\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118\" y=\"-140.3\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g class=\"edge\" id=\"edge1\"><title>0->1</title>\n",
|
|
"<path d=\"M54.2216,-144C63.4559,-144 73.9612,-144 83.7008,-144\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"90.9659,-144 83.9659,-147.15 87.4659,-144 83.9659,-144 83.9659,-144 83.9659,-144 87.4659,-144 83.9658,-140.85 90.9659,-144 90.9659,-144\" stroke=\"black\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g class=\"node\" id=\"node3\"><title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"517,-84 463,-84 463,-48 517,-48 517,-84\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"490\" y=\"-62.3\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge2\"><title>1->2</title>\n",
|
|
"<path d=\"M144.031,-149.269C150.205,-150.37 156.819,-151.383 163,-152 186.001,-154.297 191.886,-152.778 215,-153 296.033,-153.779 318.708,-155.35 396,-131 418.946,-123.771 425.151,-121.594 445,-108 452.915,-102.579 460.753,-95.7168 467.573,-89.1185\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"472.573,-84.1525 469.826,-91.3202 470.09,-86.6188 467.606,-89.0851 467.606,-89.0851 467.606,-89.0851 470.09,-86.6188 465.387,-86.85 472.573,-84.1525 472.573,-84.1525\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-155.8\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g class=\"node\" id=\"node4\"><title>3</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"269,-94 215,-94 215,-58 269,-58 269,-94\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"242\" y=\"-72.3\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge3\"><title>1->3</title>\n",
|
|
"<path d=\"M137.532,-131.079C145.273,-125.87 154.441,-119.937 163,-115 177.671,-106.538 194.414,-98.0238 208.618,-91.1196\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"214.948,-88.0665 210.011,-93.9447 211.796,-89.587 208.643,-91.1074 208.643,-91.1074 208.643,-91.1074 211.796,-89.587 207.275,-88.2701 214.948,-88.0665 214.948,-88.0665\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"180\" y=\"-118.8\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g class=\"node\" id=\"node5\"><title>4</title>\n",
|
|
"<ellipse cx=\"369\" cy=\"-104\" fill=\"#ffffaa\" rx=\"27\" ry=\"18\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"369\" y=\"-100.3\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge4\"><title>1->4</title>\n",
|
|
"<path d=\"M145.11,-141.879C184.28,-138.401 260.441,-130.489 324,-117 328.397,-116.067 332.995,-114.913 337.489,-113.682\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"344.425,-111.703 338.558,-116.653 341.06,-112.663 337.694,-113.623 337.694,-113.623 337.694,-113.623 341.06,-112.663 336.83,-110.594 344.425,-111.703 344.425,-111.703\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"242\" y=\"-137.8\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g class=\"node\" id=\"node6\"><title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" points=\"627,-40 573,-40 573,-4 627,-4 627,-40\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"none\" points=\"631,-44 569,-44 569,-3.55271e-15 631,-3.55271e-15 631,-44\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"600\" y=\"-18.3\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge5\"><title>2->5</title>\n",
|
|
"<path d=\"M517.144,-55.3488C530.678,-49.8349 547.427,-43.0113 562.241,-36.9757\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"568.894,-34.2656 563.599,-39.8239 565.652,-35.5862 562.411,-36.9067 562.411,-36.9067 562.411,-36.9067 565.652,-35.5862 561.222,-33.9895 568.894,-34.2656 568.894,-34.2656\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"543\" y=\"-51.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge6\"><title>3->2</title>\n",
|
|
"<path d=\"M269.038,-71.72C274.939,-70.7884 281.181,-69.833 287,-69 311.393,-65.5082 317.408,-63.5587 342,-62 365.952,-60.4819 372.006,-61.4842 396,-62 415.792,-62.4254 437.938,-63.3596 455.652,-64.2183\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"462.953,-64.5799 455.806,-67.3796 459.457,-64.4067 455.962,-64.2335 455.962,-64.2335 455.962,-64.2335 459.457,-64.4067 456.117,-61.0874 462.953,-64.5799 462.953,-64.5799\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"369\" y=\"-65.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g class=\"edge\" id=\"edge7\"><title>3->4</title>\n",
|
|
"<path d=\"M269.05,-72.8485C285.188,-71.7406 306.166,-71.8454 324,-77 331.103,-79.0531 338.198,-82.587 344.552,-86.434\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"350.631,-90.3422 343.04,-89.2068 347.687,-88.4496 344.743,-86.557 344.743,-86.557 344.743,-86.557 347.687,-88.4496 346.446,-83.9073 350.631,-90.3422 350.631,-90.3422\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-80.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge8\"><title>3->5</title>\n",
|
|
"<path d=\"M269.231,-65.3796C275.01,-63.3453 281.153,-61.4125 287,-60 384.407,-36.4674 502.621,-27.1424 561.662,-23.7512\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"568.906,-23.348 562.092,-26.8822 565.412,-23.5425 561.917,-23.737 561.917,-23.737 561.917,-23.737 565.412,-23.5425 561.742,-20.5919 568.906,-23.348 568.906,-23.348\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"429.5\" y=\"-41.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g class=\"edge\" id=\"edge10\"><title>4->2</title>\n",
|
|
"<path d=\"M393.795,-96.4015C411.633,-90.7053 436.265,-82.8397 456.005,-76.5362\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"462.764,-74.3778 457.054,-79.508 459.43,-75.4426 456.096,-76.5073 456.096,-76.5073 456.096,-76.5073 459.43,-75.4426 455.138,-73.5066 462.764,-74.3778 462.764,-74.3778\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"429.5\" y=\"-92.8\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g class=\"edge\" id=\"edge9\"><title>4->3</title>\n",
|
|
"<path d=\"M342.202,-101.522C326.158,-99.6513 305.191,-96.6048 287,-92 283.447,-91.1006 279.78,-90.0215 276.15,-88.8541\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"269.254,-86.5241 276.894,-85.7807 272.57,-87.6445 275.886,-88.7649 275.886,-88.7649 275.886,-88.7649 272.57,-87.6445 274.878,-91.7492 269.254,-86.5241 269.254,-86.5241\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"305.5\" y=\"-101.8\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->5 -->\n",
|
|
"<g class=\"edge\" id=\"edge11\"><title>5->5</title>\n",
|
|
"<path d=\"M589.626,-44.2124C588.776,-53.7952 592.234,-62 600,-62 605.703,-62 609.083,-57.5751 610.139,-51.4291\" fill=\"none\" stroke=\"black\"/>\n",
|
|
"<polygon fill=\"black\" points=\"610.374,-44.2124 613.295,-51.3112 610.26,-47.7105 610.147,-51.2086 610.147,-51.2086 610.147,-51.2086 610.26,-47.7105 606.998,-51.1061 610.374,-44.2124 610.374,-44.2124\" stroke=\"black\"/>\n",
|
|
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"600\" y=\"-65.8\">{a}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>"
|
|
],
|
|
"text/plain": [
|
|
"<IPython.core.display.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.minimize_ta(ta).show('.A')"
|
|
]
|
|
}
|
|
],
|
|
"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.4+"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|