* tests/python/acc_cond.ipynb, tests/python/contains.ipynb, tests/python/decompose.ipynb, tests/python/games.ipynb, tests/python/randltl.ipynb, tests/python/synthesis.ipynb, tests/python/testingaut.ipynb: here.
749 lines
48 KiB
Text
749 lines
48 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 Büchi 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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"170pt\" height=\"125pt\"\n",
|
|
" viewBox=\"0.00 0.00 170.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.0 1.0) rotate(0) translate(4 120.8)\">\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-120.8 166,-120.8 166,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"59.5\" y=\"-86.6\" font-family=\"Lato\" font-size=\"14.00\">[Büchi]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<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\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15,-22C2.79,-22 17.15,-22 30.63,-22\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.94,-22 30.94,-25.15 34.44,-22 30.94,-22 30.94,-22 30.94,-22 34.44,-22 30.94,-18.85 37.94,-22 37.94,-22\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M49.62,-39.04C48.32,-48.86 50.45,-58 56,-58 60.17,-58 62.4,-52.86 62.71,-46.14\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"62.38,-39.04 65.85,-45.88 62.54,-42.53 62.71,-46.03 62.71,-46.03 62.71,-46.03 62.54,-42.53 59.56,-46.18 62.38,-39.04 62.38,-39.04\"/>\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\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"140\" cy=\"-22\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"140\" cy=\"-22\" rx=\"22\" ry=\"22\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"140\" y=\"-18.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M74.39,-22C84.9,-22 98.55,-22 110.6,-22\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"117.85,-22 110.85,-25.15 114.35,-22 110.85,-22 110.85,-22 110.85,-22 114.35,-22 110.85,-18.85 117.85,-22 117.85,-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\">\n",
|
|
"<title>1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M131.99,-42.58C130.89,-52.84 133.55,-62 140,-62 144.83,-62 147.54,-56.85 148.13,-49.95\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"148.01,-42.58 151.27,-49.53 148.06,-46.08 148.12,-49.58 148.12,-49.58 148.12,-49.58 148.06,-46.08 144.97,-49.63 148.01,-42.58 148.01,-42.58\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"136\" y=\"-65.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb57416b570> >"
|
|
]
|
|
},
|
|
"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": [
|
|
"<?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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"729pt\" height=\"305pt\"\n",
|
|
" viewBox=\"0.00 0.00 729.00 304.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(0.7246376811594204 0.7246376811594204) rotate(0) translate(4 416.87)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-416.87 1002.23,-416.87 1002.23,4 -4,4\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"118\" cy=\"-249.87\" rx=\"27\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"118\" y=\"-246.17\" font-family=\"Lato\" font-size=\"14.00\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M54.22,-249.87C63.46,-249.87 73.96,-249.87 83.7,-249.87\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"90.97,-249.87 83.97,-253.02 87.47,-249.87 83.97,-249.87 83.97,-249.87 83.97,-249.87 87.47,-249.87 83.97,-246.72 90.97,-249.87 90.97,-249.87\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"536.02\" cy=\"-305.87\" rx=\"36.54\" ry=\"26.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"536.02\" y=\"-309.67\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"536.02\" y=\"-294.67\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M133.65,-264.68C151.51,-281.58 183.48,-308.25 217,-318.87 312.61,-349.15 432.51,-329.96 494.19,-316.23\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"501.06,-314.66 494.93,-319.29 497.65,-315.44 494.23,-316.22 494.23,-316.22 494.23,-316.22 497.65,-315.44 493.54,-313.14 501.06,-314.66 501.06,-314.66\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-338.67\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"253.77\" cy=\"-249.87\" rx=\"36.54\" ry=\"26.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-253.67\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-238.67\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>1->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M145.11,-249.87C163.49,-249.87 188.5,-249.87 209.79,-249.87\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"216.86,-249.87 209.86,-253.02 213.36,-249.87 209.86,-249.87 209.86,-249.87 209.86,-249.87 213.36,-249.87 209.86,-246.72 216.86,-249.87 216.86,-249.87\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"181\" y=\"-253.67\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"396.48\" cy=\"-195.87\" rx=\"33.88\" ry=\"26.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"396.48\" y=\"-199.67\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"396.48\" y=\"-184.67\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M137.1,-237.15C156.02,-224.67 187.07,-206.46 217,-198.87 263.47,-187.09 318.95,-188.45 355.58,-191.37\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"362.65,-191.97 355.4,-194.52 359.16,-191.68 355.67,-191.38 355.67,-191.38 355.67,-191.38 359.16,-191.68 355.94,-188.24 362.65,-191.97 362.65,-191.97\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-202.67\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"954.64\" cy=\"-156.87\" rx=\"39.69\" ry=\"26.76\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"954.64\" cy=\"-156.87\" rx=\"43.7\" ry=\"30.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"954.64\" y=\"-160.67\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"954.64\" y=\"-145.67\" font-family=\"Lato\" font-size=\"14.00\">!a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M570.12,-316.01C627.86,-331.93 749.88,-357.65 845.04,-323.87 900.45,-304.2 930.17,-236.98 943.87,-194.06\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"946.01,-187.13 946.95,-194.75 944.98,-190.48 943.94,-193.82 943.94,-193.82 943.94,-193.82 944.98,-190.48 940.94,-192.89 946.01,-187.13 946.01,-187.13\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"736.16\" y=\"-343.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"662.39\" cy=\"-195.87\" rx=\"36.56\" ry=\"26.76\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"662.39\" cy=\"-195.87\" rx=\"40.54\" ry=\"30.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-199.67\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-184.67\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->6 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M560.12,-285.44C579.68,-268.14 607.91,-243.17 629.6,-223.99\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"634.96,-219.24 631.8,-226.24 632.34,-221.56 629.72,-223.88 629.72,-223.88 629.72,-223.88 632.34,-221.56 627.63,-221.52 634.96,-219.24 634.96,-219.24\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"598.62\" y=\"-257.67\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"954.64\" cy=\"-349.87\" rx=\"36.56\" ry=\"26.76\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"954.64\" cy=\"-349.87\" rx=\"40.54\" ry=\"30.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"954.64\" y=\"-353.67\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"954.64\" y=\"-338.67\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->7 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M556.82,-328.05C566.8,-337.6 579.72,-347.73 593.62,-352.87 700.73,-392.5 838.36,-374.03 908.36,-360.21\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"915.33,-358.8 909.09,-363.27 911.9,-359.49 908.47,-360.19 908.47,-360.19 908.47,-360.19 911.9,-359.49 907.85,-357.1 915.33,-358.8 915.33,-358.8\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"736.16\" y=\"-379.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"807.1\" cy=\"-195.87\" rx=\"33.89\" ry=\"26.76\"/>\n",
|
|
"<ellipse fill=\"none\" stroke=\"black\" cx=\"807.1\" cy=\"-195.87\" rx=\"37.88\" ry=\"30.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"807.1\" y=\"-199.67\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"807.1\" y=\"-184.67\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>2->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M572.66,-302.09C607.2,-297.47 660.49,-287.82 703.16,-268.87 729.29,-257.26 755.53,-238.52 774.97,-222.93\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"780.78,-218.21 777.34,-225.07 778.07,-220.42 775.35,-222.62 775.35,-222.62 775.35,-222.62 778.07,-220.42 773.37,-220.18 780.78,-218.21 780.78,-218.21\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-296.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M288.84,-258.38C295.37,-259.93 302.16,-261.49 308.54,-262.87 372.6,-276.69 447.36,-290.42 492.94,-298.52\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"499.99,-299.78 492.55,-301.65 496.55,-299.16 493.1,-298.55 493.1,-298.55 493.1,-298.55 496.55,-299.16 493.65,-295.45 499.99,-299.78 499.99,-299.78\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"396.48\" y=\"-289.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->3 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>3->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M240.39,-275.24C239.47,-285.79 243.93,-294.74 253.77,-294.74 261.31,-294.74 265.69,-289.5 266.91,-282.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"267.15,-275.24 270.06,-282.34 267.03,-278.74 266.91,-282.24 266.91,-282.24 266.91,-282.24 267.03,-278.74 263.77,-282.13 267.15,-275.24 267.15,-275.24\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-298.54\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M281.96,-232.33C290.26,-227.49 299.57,-222.56 308.54,-218.87 323.81,-212.58 341.31,-207.56 356.59,-203.83\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"363.43,-202.21 357.35,-206.89 360.03,-203.02 356.62,-203.83 356.62,-203.83 356.62,-203.83 360.03,-203.02 355.89,-200.76 363.43,-202.21 363.43,-202.21\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-222.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>9</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"536.02\" cy=\"-26.87\" rx=\"39.7\" ry=\"26.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"536.02\" y=\"-30.67\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"536.02\" y=\"-15.67\" font-family=\"Lato\" font-size=\"14.00\">!a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M278.25,-229.62C282.43,-225.81 286.67,-221.78 290.54,-217.87 365.55,-141.92 353.95,-86.56 448.42,-36.87 460.74,-30.39 475.38,-27.28 489.09,-25.94\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"496.16,-25.4 489.42,-29.08 492.67,-25.67 489.18,-25.94 489.18,-25.94 489.18,-25.94 492.67,-25.67 488.94,-22.8 496.16,-25.4 496.16,-25.4\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"396.48\" y=\"-119.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>4->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M423.38,-212.29C439.64,-222.96 460.8,-237.52 478.42,-251.87 488.82,-260.34 499.61,-270.3 508.95,-279.36\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"513.98,-284.27 506.77,-281.63 511.48,-281.83 508.97,-279.38 508.97,-279.38 508.97,-279.38 511.48,-281.83 511.18,-277.13 513.98,-284.27 513.98,-284.27\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"463.42\" y=\"-255.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g id=\"edge15\" class=\"edge\">\n",
|
|
"<title>4->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M373.57,-215.72C365.05,-222.46 354.87,-229.4 344.54,-233.87 329.93,-240.2 312.95,-244.02 297.72,-246.33\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"290.39,-247.35 296.89,-243.27 293.86,-246.87 297.33,-246.39 297.33,-246.39 297.33,-246.39 293.86,-246.87 297.76,-249.51 290.39,-247.35 290.39,-247.35\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-247.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->4 -->\n",
|
|
"<g id=\"edge16\" class=\"edge\">\n",
|
|
"<title>4->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M384.21,-221.24C383.37,-231.79 387.46,-240.74 396.48,-240.74 403.39,-240.74 407.4,-235.5 408.53,-228.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"408.75,-221.24 411.68,-228.33 408.64,-224.74 408.53,-228.24 408.53,-228.24 408.53,-228.24 408.64,-224.74 405.38,-228.14 408.75,-221.24 408.75,-221.24\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"396.48\" y=\"-244.54\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->5 -->\n",
|
|
"<g id=\"edge17\" class=\"edge\">\n",
|
|
"<title>4->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M412.47,-172C434.85,-139.65 480.29,-85.87 535.02,-85.87 535.02,-85.87 535.02,-85.87 808.1,-85.87 849.57,-85.87 891.57,-109.44 919.72,-129.42\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"925.51,-133.62 917.99,-132.06 922.68,-131.57 919.84,-129.51 919.84,-129.51 919.84,-129.51 922.68,-131.57 921.69,-126.96 925.51,-133.62 925.51,-133.62\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-89.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->6 -->\n",
|
|
"<g id=\"edge18\" class=\"edge\">\n",
|
|
"<title>4->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M430.64,-195.87C476.91,-195.87 561.12,-195.87 614.01,-195.87\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"621.25,-195.87 614.25,-199.02 617.75,-195.87 614.25,-195.87 614.25,-195.87 614.25,-195.87 617.75,-195.87 614.25,-192.72 621.25,-195.87 621.25,-195.87\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"536.02\" y=\"-199.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->7 -->\n",
|
|
"<g id=\"edge19\" class=\"edge\">\n",
|
|
"<title>4->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M408.17,-221.11C423.21,-253.66 453.64,-309.87 496.42,-341.87 543.2,-376.86 564.61,-369.15 621.62,-381.87 739.36,-408.15 777.99,-415.18 893.04,-378.87 900.19,-376.61 907.58,-373.66 914.62,-370.5\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"920.98,-367.56 915.95,-373.36 917.81,-369.03 914.63,-370.5 914.63,-370.5 914.63,-370.5 917.81,-369.03 913.31,-367.64 920.98,-367.56 920.98,-367.56\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-401.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->8 -->\n",
|
|
"<g id=\"edge20\" class=\"edge\">\n",
|
|
"<title>4->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M428.03,-185.53C483.24,-168.24 603.21,-137.13 703.16,-155.87 725.14,-159.99 748.47,-168.66 767.35,-176.88\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"774.09,-179.88 766.42,-179.92 770.9,-178.46 767.7,-177.04 767.7,-177.04 767.7,-177.04 770.9,-178.46 768.98,-174.16 774.09,-179.88 774.09,-179.88\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"598.62\" y=\"-155.67\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->9 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>4->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M400.4,-169.17C405.16,-138.14 417.44,-87.31 448.42,-56.87 459.74,-45.75 475.38,-38.74 490.26,-34.33\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"497.03,-32.48 491.11,-37.36 493.65,-33.4 490.27,-34.32 490.27,-34.32 490.27,-34.32 493.65,-33.4 489.44,-31.29 497.03,-32.48 497.03,-32.48\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"463.42\" y=\"-60.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->5 -->\n",
|
|
"<g id=\"edge21\" class=\"edge\">\n",
|
|
"<title>6->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M693.3,-175.35C713.67,-162.66 741.81,-147.55 769.16,-140.87 814.83,-129.71 868.53,-136.52 906.17,-144.41\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"913.48,-146 905.97,-147.59 910.06,-145.26 906.64,-144.51 906.64,-144.51 906.64,-144.51 910.06,-145.26 907.31,-141.44 913.48,-146 913.48,-146\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"807.1\" y=\"-144.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->6 -->\n",
|
|
"<g id=\"edge22\" class=\"edge\">\n",
|
|
"<title>6->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M650.76,-225.94C650.64,-236.34 654.52,-244.74 662.39,-244.74 668.29,-244.74 671.95,-240.01 673.35,-233.26\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"674.01,-225.94 676.52,-233.19 673.7,-229.42 673.38,-232.91 673.38,-232.91 673.38,-232.91 673.7,-229.42 670.25,-232.63 674.01,-225.94 674.01,-225.94\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.39\" y=\"-248.54\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge23\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M691.61,-217.55C712.39,-232.95 741.68,-253.54 769.16,-268.87 815.89,-294.94 872.64,-318.78 910.76,-333.74\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"917.65,-336.43 909.98,-336.82 914.39,-335.16 911.13,-333.89 911.13,-333.89 911.13,-333.89 914.39,-335.16 912.27,-330.95 917.65,-336.43 917.65,-336.43\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"807.1\" y=\"-308.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->8 -->\n",
|
|
"<g id=\"edge24\" class=\"edge\">\n",
|
|
"<title>6->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M703.16,-194.31C709.19,-194.13 715.34,-193.97 721.16,-193.87 734.49,-193.64 737.83,-193.63 751.16,-193.87 754.7,-193.93 758.38,-194.02 762.07,-194.13\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"769.16,-194.34 762.07,-197.28 765.66,-194.23 762.16,-194.13 762.16,-194.13 762.16,-194.13 765.66,-194.23 762.26,-190.98 769.16,-194.34 769.16,-194.34\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"736.16\" y=\"-197.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge25\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M843.33,-186.43C862.38,-181.33 886.15,-174.96 906.74,-169.44\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"913.59,-167.6 907.64,-172.46 910.21,-168.51 906.83,-169.41 906.83,-169.41 906.83,-169.41 910.21,-168.51 906.01,-166.37 913.59,-167.6 913.59,-167.6\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"878.04\" y=\"-185.67\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->6 -->\n",
|
|
"<g id=\"edge26\" class=\"edge\">\n",
|
|
"<title>8->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M770.85,-205.48C764.35,-206.89 757.58,-208.12 751.16,-208.87 737.91,-210.42 734.41,-210.34 721.16,-208.87 716.87,-208.39 712.43,-207.72 708.01,-206.94\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"701.1,-205.61 708.56,-203.83 704.53,-206.27 707.97,-206.93 707.97,-206.93 707.97,-206.93 704.53,-206.27 707.38,-210.02 701.1,-205.61 701.1,-205.61\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"736.16\" y=\"-213.67\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->7 -->\n",
|
|
"<g id=\"edge27\" class=\"edge\">\n",
|
|
"<title>8->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M831.16,-220.27C856.66,-247.26 897.77,-290.76 925.24,-319.82\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"930.2,-325.07 923.1,-322.15 927.8,-322.53 925.39,-319.98 925.39,-319.98 925.39,-319.98 927.8,-322.53 927.68,-317.82 930.2,-325.07 930.2,-325.07\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"878.04\" y=\"-285.67\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->8 -->\n",
|
|
"<g id=\"edge28\" class=\"edge\">\n",
|
|
"<title>8->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M794,-224.97C793.57,-235.81 797.94,-244.74 807.1,-244.74 814.11,-244.74 818.31,-239.51 819.71,-232.19\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"820.19,-224.97 822.86,-232.17 819.96,-228.46 819.72,-231.95 819.72,-231.95 819.72,-231.95 819.96,-228.46 816.58,-231.74 820.19,-224.97 820.19,-224.97\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"807.1\" y=\"-248.54\" font-family=\"Lato\" font-size=\"14.00\">{}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.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": [
|
|
"<?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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"729pt\" height=\"121pt\"\n",
|
|
" viewBox=\"0.00 0.00 729.00 121.10\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(0.9615384615384615 0.9615384615384615) rotate(0) translate(4 122)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-122 754.54,-122 754.54,4 -4,4\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"118\" cy=\"-59\" rx=\"27\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"118\" y=\"-55.3\" font-family=\"Lato\" font-size=\"14.00\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M54.22,-59C63.46,-59 73.96,-59 83.7,-59\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"90.97,-59 83.97,-62.15 87.47,-59 83.97,-59 83.97,-59 83.97,-59 87.47,-59 83.97,-55.85 90.97,-59 90.97,-59\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"522.54,-108 468.54,-108 468.54,-70 522.54,-70 522.54,-108\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"495.54\" y=\"-92.8\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"495.54\" y=\"-77.8\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M140.16,-69.4C159.6,-78.3 189.47,-90.38 217,-95 304.48,-109.68 327.88,-101.61 416.54,-99 431.67,-98.56 435.51,-98.81 450.54,-97 453.93,-96.6 457.45,-96.1 460.96,-95.54\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"468.09,-94.35 461.71,-98.61 464.64,-94.93 461.19,-95.5 461.19,-95.5 461.19,-95.5 464.64,-94.93 460.67,-92.4 468.09,-94.35 468.09,-94.35\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-106.8\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"253.77\" cy=\"-59\" rx=\"36.54\" ry=\"26.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-62.8\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-47.8\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>1->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M145.11,-59C163.49,-59 188.5,-59 209.79,-59\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"216.86,-59 209.86,-62.15 213.36,-59 209.86,-59 209.86,-59 209.86,-59 213.36,-59 209.86,-55.85 216.86,-59 216.86,-59\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"181\" y=\"-62.8\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"416.54,-42 362.54,-42 362.54,-4 416.54,-4 416.54,-42\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"389.54\" y=\"-26.8\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"389.54\" y=\"-11.8\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M137.08,-46.18C155.98,-33.62 187,-15.34 217,-8 272.07,5.47 288.59,-0.85 344.54,-10 348.08,-10.58 351.75,-11.36 355.37,-12.25\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"362.26,-14.08 354.69,-15.33 358.88,-13.18 355.5,-12.29 355.5,-12.29 355.5,-12.29 358.88,-13.18 356.3,-9.24 362.26,-14.08 362.26,-14.08\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"253.77\" y=\"-11.8\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"632.54,-108 578.54,-108 578.54,-70 632.54,-70 632.54,-108\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"636.54,-112 574.54,-112 574.54,-66 636.54,-66 636.54,-112\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"605.54\" y=\"-92.8\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"605.54\" y=\"-77.8\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M522.68,-89C536.1,-89 552.66,-89 567.38,-89\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"574.43,-89 567.43,-92.15 570.93,-89 567.43,-89 567.43,-89 567.43,-89 570.93,-89 567.43,-85.85 574.43,-89 574.43,-89\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"548.54\" y=\"-92.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M290.05,-63.63C296.21,-64.43 302.56,-65.25 308.54,-66 361.95,-72.78 424.02,-80.41 461.25,-84.95\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"468.35,-85.82 461.02,-88.1 464.88,-85.4 461.4,-84.97 461.4,-84.97 461.4,-84.97 464.88,-85.4 461.78,-81.84 468.35,-85.82 468.35,-85.82\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"389.54\" y=\"-83.8\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M289.01,-51.19C305.82,-47.21 326.31,-42.13 344.54,-37 348.02,-36.02 351.64,-34.96 355.24,-33.86\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"362.1,-31.74 356.35,-36.82 358.76,-32.77 355.42,-33.81 355.42,-33.81 355.42,-33.81 358.76,-32.77 354.48,-30.8 362.1,-31.74 362.1,-31.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-50.8\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>4->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M416.63,-38.86C427.2,-45.34 439.5,-52.96 450.54,-60 454.29,-62.39 458.19,-64.92 462.07,-67.44\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"468.1,-71.39 460.52,-70.19 465.17,-69.47 462.24,-67.56 462.24,-67.56 462.24,-67.56 465.17,-69.47 463.97,-64.92 468.1,-71.39 468.1,-71.39\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"442.54\" y=\"-63.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M362.3,-16.42C346.35,-13.62 325.81,-12.17 308.54,-18 299.06,-21.21 289.92,-26.82 281.96,-32.89\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"276.12,-37.59 279.6,-30.75 278.85,-35.4 281.57,-33.21 281.57,-33.21 281.57,-33.21 278.85,-35.4 283.55,-35.66 276.12,-37.59 276.12,-37.59\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.54\" y=\"-21.8\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"746.54,-75 692.54,-75 692.54,-37 746.54,-37 746.54,-75\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"750.54,-79 688.54,-79 688.54,-33 750.54,-33 750.54,-79\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"719.54\" y=\"-59.8\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"middle\" x=\"719.54\" y=\"-44.8\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>4->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M416.91,-24.08C466.7,-26.36 577.86,-32.59 670.54,-46 674.08,-46.52 677.75,-47.13 681.42,-47.8\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"688.43,-49.14 680.96,-50.92 684.99,-48.48 681.55,-47.82 681.55,-47.82 681.55,-47.82 684.99,-48.48 682.14,-44.73 688.43,-49.14 688.43,-49.14\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"548.54\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->6 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>5->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M636.6,-81.43C647.35,-78.61 659.53,-75.3 670.54,-72 674.17,-70.92 677.94,-69.74 681.7,-68.54\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"688.42,-66.36 682.73,-71.52 685.09,-67.44 681.76,-68.52 681.76,-68.52 681.76,-68.52 685.09,-67.44 680.79,-65.53 688.42,-66.36 688.42,-66.36\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.54\" y=\"-80.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->5 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>6->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M688.29,-50.13C677.41,-49.17 665.2,-49.45 654.54,-53 648.44,-55.04 642.5,-58.18 636.98,-61.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"631.19,-65.84 635.12,-59.24 634.05,-63.83 636.92,-61.82 636.92,-61.82 636.92,-61.82 634.05,-63.83 638.73,-64.4 631.19,-65.84 631.19,-65.84\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"662.54\" y=\"-56.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.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": [
|
|
"<?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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"625pt\" height=\"112pt\"\n",
|
|
" viewBox=\"0.00 0.00 625.00 112.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1.0 1.0) rotate(0) translate(4 108)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-108 621,-108 621,4 -4,4\"/>\n",
|
|
"<!-- 0 -->\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"118\" cy=\"-51\" rx=\"27\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"118\" y=\"-47.3\" font-family=\"Lato\" font-size=\"14.00\">init</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M54.22,-51C63.46,-51 73.96,-51 83.7,-51\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"90.97,-51 83.97,-54.15 87.47,-51 83.97,-51 83.97,-51 83.97,-51 87.47,-51 83.97,-47.85 90.97,-51 90.97,-51\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"503,-93 449,-93 449,-57 503,-57 503,-93\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"476\" y=\"-71.3\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M140.08,-61.43C147.21,-64.59 155.32,-67.81 163,-70 263.26,-98.54 292.8,-89.06 397,-86 412.13,-85.56 415.99,-85.97 431,-84 434.4,-83.56 437.92,-83 441.44,-82.38\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"448.58,-81.04 442.28,-85.43 445.14,-81.69 441.7,-82.33 441.7,-82.33 441.7,-82.33 445.14,-81.69 441.12,-79.23 448.58,-81.04 448.58,-81.04\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-92.8\" font-family=\"Lato\" font-size=\"14.00\">!a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"244\" cy=\"-51\" rx=\"27\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"244\" y=\"-47.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>1->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M145.3,-51C164.04,-51 189.38,-51 209.56,-51\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"216.74,-51 209.74,-54.15 213.24,-51 209.74,-51 209.74,-51 209.74,-51 213.24,-51 209.74,-47.85 216.74,-51 216.74,-51\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"181\" y=\"-54.8\" font-family=\"Lato\" font-size=\"14.00\">a & !b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"397,-36 343,-36 343,0 397,0 397,-36\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"370\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->4 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M139.35,-39.97C158.72,-30.05 188.98,-15.98 217,-9 248.16,-1.24 256.92,-4.33 289,-3 304.99,-2.34 309.22,-0.38 325,-3 328.59,-3.6 332.28,-4.45 335.93,-5.44\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"342.84,-7.52 335.23,-8.52 339.49,-6.51 336.13,-5.51 336.13,-5.51 336.13,-5.51 339.49,-6.51 337.04,-2.49 342.84,-7.52 342.84,-7.52\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"244\" y=\"-12.8\" font-family=\"Lato\" font-size=\"14.00\">a & b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"613,-52 559,-52 559,-16 613,-16 613,-52\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"617,-56 555,-56 555,-12 617,-12 617,-56\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"586\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M503.14,-65.08C516.68,-59.94 533.43,-53.58 548.24,-47.95\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"554.89,-45.43 549.47,-50.86 551.62,-46.67 548.35,-47.91 548.35,-47.91 548.35,-47.91 551.62,-46.67 547.23,-44.97 554.89,-45.43 554.89,-45.43\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"529\" y=\"-61.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M270.57,-54.66C276.61,-55.48 283.03,-56.3 289,-57 342.32,-63.21 404.42,-68.91 441.67,-72.17\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"448.78,-72.79 441.54,-75.32 445.3,-72.48 441.81,-72.18 441.81,-72.18 441.81,-72.18 445.3,-72.48 442.08,-69.04 448.78,-72.79 448.78,-72.79\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"370\" y=\"-70.8\" font-family=\"Lato\" font-size=\"14.00\">{a, b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M269.5,-44.48C288.52,-39.42 315.09,-32.35 335.99,-26.79\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"342.84,-24.96 336.89,-29.81 339.46,-25.86 336.08,-26.76 336.08,-26.76 336.08,-26.76 339.46,-25.86 335.27,-23.72 342.84,-24.96 342.84,-24.96\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-41.8\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>4->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M397.24,-32.38C410.92,-39.88 427.76,-49.11 442.28,-57.07\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"448.76,-60.62 441.11,-60.02 445.7,-58.94 442.63,-57.26 442.63,-57.26 442.63,-57.26 445.7,-58.94 444.14,-54.49 448.76,-60.62 448.76,-60.62\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"423\" y=\"-52.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->3 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M342.96,-9.99C326.9,-6.43 306.17,-4.36 289,-11 278.83,-14.93 269.56,-22.43 262.18,-29.88\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"257.39,-34.99 259.88,-27.73 259.78,-32.43 262.18,-29.88 262.18,-29.88 262.18,-29.88 259.78,-32.43 264.48,-32.04 257.39,-34.99 257.39,-34.99\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-14.8\" font-family=\"Lato\" font-size=\"14.00\">{b}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->5 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>4->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M397.24,-19.96C434.91,-22.78 504.49,-27.98 547.55,-31.2\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"554.75,-31.74 547.54,-34.36 551.26,-31.48 547.77,-31.22 547.77,-31.22 547.77,-31.22 551.26,-31.48 548,-28.08 554.75,-31.74 554.75,-31.74\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"476\" y=\"-30.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->5 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>5->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M575.63,-56.21C574.78,-65.8 578.23,-74 586,-74 591.7,-74 595.08,-69.58 596.14,-63.43\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"596.37,-56.21 599.29,-63.31 596.26,-59.71 596.15,-63.21 596.15,-63.21 596.15,-63.21 596.26,-59.71 593,-63.11 596.37,-56.21 596.37,-56.21\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"586\" y=\"-77.8\" font-family=\"Lato\" font-size=\"14.00\">{a}</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.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.7.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|