* spot/twaalgos/synthesis.cc: Now needs to call reduce_parity. * spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh: here. * spot/twaalgos/zlktree.hh: make zielonka_node public * tests/core/ltlsynt.test, tests/python/games.ipynb, tests/python/synthesis.ipynb, tests/python/toparity.py: update tests
1261 lines
80 KiB
Text
1261 lines
80 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import spot\n",
|
|
"from buddy import bddtrue\n",
|
|
"spot.setup()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Support for games\n",
|
|
"\n",
|
|
"The support for games is currently quite rudimentary, as Spot currently only uses those games in `ltlsynt`.\n",
|
|
"\n",
|
|
"In essence, a game is just an ω-automaton with a property named `state-player` that stores the player owning each state. The players are named 0 and 1. The player owning a state can decide what the next transition from this state should be. The goal for player 1 is to force the play to be infinite and to satisfy the acceptance condition of the automaton, while the goal for player 0 is to prevent it by either forcing a finite play, or forcing an infinite play that does not satisfy the acceptance condition.\n",
|
|
"\n",
|
|
"The support is currently restricted to games that use:\n",
|
|
"- `t` acceptance: all infinite run are accepting, and player 0 can only win if it manages to force a finite play (this requires reaching states without successors).\n",
|
|
"- `parity` acceptance of any form (`max odd`, `max even`, `min odd`, `min even`): player 0 can win if the maximal (or minimal) value seen infinitely often is even (or odd)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Creating games from scratch\n",
|
|
"\n",
|
|
"Games can be [created like any automaton](https://spot.lrde.epita.fr/tut22.html). \n",
|
|
"Using `set_state_players()` will fix the state owners."
|
|
]
|
|
},
|
|
{
|
|
"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.40.1 (20161225.0304)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"495pt\" height=\"190pt\"\n",
|
|
" viewBox=\"0.00 0.00 495.00 190.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 186)\">\n",
|
|
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-186 491,-186 491,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"240.5\" y=\"-166.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[all]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"64,-144 37,-126 64,-108 91,-126 64,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"64\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.2131,-126C4.2712,-126 16.7131,-126 29.7242,-126\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"36.9552,-126 29.9552,-129.1501 33.4552,-126 29.9552,-126.0001 29.9552,-126.0001 29.9552,-126.0001 33.4552,-126 29.9551,-122.8501 36.9552,-126 36.9552,-126\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"145\" cy=\"-126\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M82.3802,-120.2392C93.6671,-119.1141 108.2605,-118.9488 120.5195,-119.7431\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"127.8003,-120.3617 120.5587,-122.9077 124.3129,-120.0653 120.8254,-119.769 120.8254,-119.769 120.8254,-119.769 124.3129,-120.0653 121.0921,-116.6303 127.8003,-120.3617 127.8003,-120.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"145\" cy=\"-72\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M77.7405,-116.8396C90.3786,-108.4142 109.3093,-95.7938 123.8702,-86.0865\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"129.8121,-82.1253 125.735,-88.6292 126.8999,-84.0668 123.9877,-86.0082 123.9877,-86.0082 123.9877,-86.0082 126.8999,-84.0668 122.2404,-83.3873 129.8121,-82.1253 129.8121,-82.1253\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M127.8003,-131.6383C116.6491,-132.8423 101.9263,-133.0683 89.4339,-132.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.3802,-131.7608 89.606,-129.1704 85.8693,-132.0357 89.3585,-132.3106 89.3585,-132.3106 89.3585,-132.3106 85.8693,-132.0357 89.1111,-135.4509 82.3802,-131.7608 82.3802,-131.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"226,-144 199,-126 226,-108 253,-126 226,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M162.178,-120.364C173.2806,-119.1636 187.9303,-118.9333 200.3937,-119.6732\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"207.436,-120.221 200.2128,-122.8186 203.9466,-119.9495 200.4571,-119.6781 200.4571,-119.6781 200.4571,-119.6781 203.9466,-119.9495 200.7014,-116.5375 207.436,-120.221 207.436,-120.221\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M160.2355,-82.157C173.2706,-90.847 192.1193,-103.4129 206.2992,-112.8661\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"212.4481,-116.9654 204.8764,-115.7034 209.5359,-115.0239 206.6238,-113.0825 206.6238,-113.0825 206.6238,-113.0825 209.5359,-115.0239 208.3711,-110.4615 212.4481,-116.9654 212.4481,-116.9654\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"226,-90 199,-72 226,-54 253,-72 226,-90\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M163.3802,-72C171.7119,-72 181.8453,-72 191.5115,-72\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"198.7746,-72 191.7747,-75.1501 195.2746,-72 191.7746,-72.0001 191.7746,-72.0001 191.7746,-72.0001 195.2746,-72 191.7746,-68.8501 198.7746,-72 198.7746,-72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"226,-36 199,-18 226,0 253,-18 226,-36\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M160.2355,-61.843C173.2706,-53.153 192.1193,-40.5871 206.2992,-31.1339\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"212.4481,-27.0346 208.3711,-33.5385 209.5359,-28.9761 206.6238,-30.9175 206.6238,-30.9175 206.6238,-30.9175 209.5359,-28.9761 204.8764,-28.2966 212.4481,-27.0346 212.4481,-27.0346\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M207.436,-131.779C196.1581,-132.8893 181.6301,-133.0474 169.4264,-132.2534\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"162.178,-131.636 169.4201,-129.0915 165.6654,-131.9331 169.1528,-132.2302 169.1528,-132.2302 169.1528,-132.2302 165.6654,-131.9331 168.8854,-135.3688 162.178,-131.636 162.178,-131.636\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"460,-90 433,-72 460,-54 487,-72 460,-90\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"460\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M246.3566,-121.3023C288.5563,-111.5639 385.5805,-89.1737 432.9661,-78.2386\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"439.8571,-76.6484 433.7447,-81.2918 436.4467,-77.4354 433.0363,-78.2225 433.0363,-78.2225 433.0363,-78.2225 436.4467,-77.4354 432.328,-75.1531 439.8571,-76.6484 439.8571,-76.6484\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"307\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M244.3802,-12.2392C255.6671,-11.1141 270.2605,-10.9488 282.5195,-11.7431\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"289.8003,-12.3617 282.5587,-14.9077 286.3129,-12.0653 282.8254,-11.769 282.8254,-11.769 282.8254,-11.769 286.3129,-12.0653 283.0921,-8.6303 289.8003,-12.3617 289.8003,-12.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M289.8003,-23.6383C278.6491,-24.8423 263.9263,-25.0683 251.4339,-24.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"244.3802,-23.7608 251.606,-21.1704 247.8693,-24.0357 251.3585,-24.3106 251.3585,-24.3106 251.3585,-24.3106 247.8693,-24.0357 251.1111,-27.4509 244.3802,-23.7608 244.3802,-23.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"379\" cy=\"-49\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"379\" y=\"-45.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->8 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>7->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M323.6992,-25.1899C333.2409,-29.2982 345.3509,-34.5122 355.8046,-39.0131\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"362.3913,-41.849 354.7162,-41.974 359.1766,-40.4649 355.9619,-39.0808 355.9619,-39.0808 355.9619,-39.0808 359.1766,-40.4649 357.2077,-36.1876 362.3913,-41.849 362.3913,-41.849\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M396.5758,-53.9907C407.5442,-57.1052 421.8575,-61.1694 434.1105,-64.6486\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"441.0459,-66.618 433.4516,-67.736 437.679,-65.6619 434.3121,-64.7058 434.3121,-64.7058 434.3121,-64.7058 437.679,-65.6619 435.1725,-61.6756 441.0459,-66.618 441.0459,-66.618\"/>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"bdict = spot.make_bdd_dict();\n",
|
|
"game = spot.make_twa_graph(bdict)\n",
|
|
"game.new_states(9)\n",
|
|
"for (s, d) in ((0,1), (0, 3), \n",
|
|
" (1, 0), (1, 2),\n",
|
|
" (2, 1), (2, 5),\n",
|
|
" (3, 2), (3, 4), (3, 6),\n",
|
|
" (6, 7),\n",
|
|
" (7, 6), (7, 8),\n",
|
|
" (8, 5)):\n",
|
|
" game.new_edge(s, d, bddtrue)\n",
|
|
"spot.set_state_players(game, [True, False, True, False, True, True, True, False, False])\n",
|
|
"game.show('.g') # Use \"g\" to hide the irrelevant edge labels."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The `set_state_players()` function takes a list of owner for each of the states in the automaton. In the output,\n",
|
|
"states from player 0 use circles, ellispes, or rectangle with rounded corners (mnemonic: 0 is round) while states from player 1 have a losanse shape (1 has only straight lines). \n",
|
|
"\n",
|
|
"\n",
|
|
"State ownership can also be manipulated by the following functions:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"(True, False, True, False, True, True, True, False, False)"
|
|
]
|
|
},
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.get_state_players(game)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.get_state_player(game, 4)"
|
|
]
|
|
},
|
|
{
|
|
"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.40.1 (20161225.0304)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"495pt\" height=\"190pt\"\n",
|
|
" viewBox=\"0.00 0.00 495.00 190.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 186)\">\n",
|
|
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-186 491,-186 491,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"240.5\" y=\"-166.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[all]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"64,-144 37,-126 64,-108 91,-126 64,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"64\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.2131,-126C4.2712,-126 16.7131,-126 29.7242,-126\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"36.9552,-126 29.9552,-129.1501 33.4552,-126 29.9552,-126.0001 29.9552,-126.0001 29.9552,-126.0001 33.4552,-126 29.9551,-122.8501 36.9552,-126 36.9552,-126\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"145\" cy=\"-126\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M82.3802,-120.2392C93.6671,-119.1141 108.2605,-118.9488 120.5195,-119.7431\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"127.8003,-120.3617 120.5587,-122.9077 124.3129,-120.0653 120.8254,-119.769 120.8254,-119.769 120.8254,-119.769 124.3129,-120.0653 121.0921,-116.6303 127.8003,-120.3617 127.8003,-120.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"145\" cy=\"-72\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M77.7405,-116.8396C90.3786,-108.4142 109.3093,-95.7938 123.8702,-86.0865\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"129.8121,-82.1253 125.735,-88.6292 126.8999,-84.0668 123.9877,-86.0082 123.9877,-86.0082 123.9877,-86.0082 126.8999,-84.0668 122.2404,-83.3873 129.8121,-82.1253 129.8121,-82.1253\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M127.8003,-131.6383C116.6491,-132.8423 101.9263,-133.0683 89.4339,-132.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.3802,-131.7608 89.606,-129.1704 85.8693,-132.0357 89.3585,-132.3106 89.3585,-132.3106 89.3585,-132.3106 85.8693,-132.0357 89.1111,-135.4509 82.3802,-131.7608 82.3802,-131.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"226,-144 199,-126 226,-108 253,-126 226,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M162.178,-120.364C173.2806,-119.1636 187.9303,-118.9333 200.3937,-119.6732\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"207.436,-120.221 200.2128,-122.8186 203.9466,-119.9495 200.4571,-119.6781 200.4571,-119.6781 200.4571,-119.6781 203.9466,-119.9495 200.7014,-116.5375 207.436,-120.221 207.436,-120.221\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M160.2355,-82.157C173.2706,-90.847 192.1193,-103.4129 206.2992,-112.8661\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"212.4481,-116.9654 204.8764,-115.7034 209.5359,-115.0239 206.6238,-113.0825 206.6238,-113.0825 206.6238,-113.0825 209.5359,-115.0239 208.3711,-110.4615 212.4481,-116.9654 212.4481,-116.9654\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"226\" cy=\"-72\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M163.3802,-72C174.4352,-72 188.6622,-72 200.7609,-72\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"207.9716,-72 200.9716,-75.1501 204.4716,-72 200.9716,-72.0001 200.9716,-72.0001 200.9716,-72.0001 204.4716,-72 200.9716,-68.8501 207.9716,-72 207.9716,-72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"226,-36 199,-18 226,0 253,-18 226,-36\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M160.2355,-61.843C173.2706,-53.153 192.1193,-40.5871 206.2992,-31.1339\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"212.4481,-27.0346 208.3711,-33.5385 209.5359,-28.9761 206.6238,-30.9175 206.6238,-30.9175 206.6238,-30.9175 209.5359,-28.9761 204.8764,-28.2966 212.4481,-27.0346 212.4481,-27.0346\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M207.436,-131.779C196.1581,-132.8893 181.6301,-133.0474 169.4264,-132.2534\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"162.178,-131.636 169.4201,-129.0915 165.6654,-131.9331 169.1528,-132.2302 169.1528,-132.2302 169.1528,-132.2302 165.6654,-131.9331 168.8854,-135.3688 162.178,-131.636 162.178,-131.636\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"460,-90 433,-72 460,-54 487,-72 460,-90\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"460\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M246.3566,-121.3023C288.5563,-111.5639 385.5805,-89.1737 432.9661,-78.2386\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"439.8571,-76.6484 433.7447,-81.2918 436.4467,-77.4354 433.0363,-78.2225 433.0363,-78.2225 433.0363,-78.2225 436.4467,-77.4354 432.328,-75.1531 439.8571,-76.6484 439.8571,-76.6484\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"307\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M244.3802,-12.2392C255.6671,-11.1141 270.2605,-10.9488 282.5195,-11.7431\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"289.8003,-12.3617 282.5587,-14.9077 286.3129,-12.0653 282.8254,-11.769 282.8254,-11.769 282.8254,-11.769 286.3129,-12.0653 283.0921,-8.6303 289.8003,-12.3617 289.8003,-12.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M289.8003,-23.6383C278.6491,-24.8423 263.9263,-25.0683 251.4339,-24.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"244.3802,-23.7608 251.606,-21.1704 247.8693,-24.0357 251.3585,-24.3106 251.3585,-24.3106 251.3585,-24.3106 247.8693,-24.0357 251.1111,-27.4509 244.3802,-23.7608 244.3802,-23.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"379\" cy=\"-49\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"379\" y=\"-45.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->8 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>7->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M323.6992,-25.1899C333.2409,-29.2982 345.3509,-34.5122 355.8046,-39.0131\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"362.3913,-41.849 354.7162,-41.974 359.1766,-40.4649 355.9619,-39.0808 355.9619,-39.0808 355.9619,-39.0808 359.1766,-40.4649 357.2077,-36.1876 362.3913,-41.849 362.3913,-41.849\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M396.5758,-53.9907C407.5442,-57.1052 421.8575,-61.1694 434.1105,-64.6486\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"441.0459,-66.618 433.4516,-67.736 437.679,-65.6619 434.3121,-64.7058 434.3121,-64.7058 434.3121,-64.7058 437.679,-65.6619 435.1725,-61.6756 441.0459,-66.618 441.0459,-66.618\"/>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.set_state_player(game, 4, False)\n",
|
|
"game.show('.g')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Solving a game\n",
|
|
"\n",
|
|
"Solving a game is done my calling `solve_game()`. This function actually dispatches to `solve_safety_game()` (if the acceptance is `t`) or to `solve_parity_game()` (if the acceptance is any parity condition). You may call these functions directly if desired, but using `solve_game()` makes it possible for future version of Spot to dispatch to some better function if we add some.\n",
|
|
"\n",
|
|
"These functions will attach two additional vectors into the game automaton: one vector stores the winner of each state, and one vector stores (memory-less) strategy for each state, i.e., the transition that should always be taken by the owner of this state in order to win. \n",
|
|
"\n",
|
|
"The return value of those functions is simply the winner for the initial state."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.solve_game(game)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Calling the `highlight_strategy()` function can be used to decorate the `game` automaton using the winning regions and strategies. Below, green represent the winning region/strategy for player 1 and red those for player 0."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"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.40.1 (20161225.0304)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"495pt\" height=\"190pt\"\n",
|
|
" viewBox=\"0.00 0.00 495.00 190.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 186)\">\n",
|
|
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-186 491,-186 491,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"240.5\" y=\"-166.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[all]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"64,-144 37,-126 64,-108 91,-126 64,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"64\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.2131,-126C4.2712,-126 16.7131,-126 29.7242,-126\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"36.9552,-126 29.9552,-129.1501 33.4552,-126 29.9552,-126.0001 29.9552,-126.0001 29.9552,-126.0001 33.4552,-126 29.9551,-122.8501 36.9552,-126 36.9552,-126\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"145\" cy=\"-126\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M82.3802,-120.2392C93.6671,-119.1141 108.2605,-118.9488 120.5195,-119.7431\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"127.8003,-120.3617 120.5587,-122.9077 124.2705,-120.5635 120.7831,-120.2672 120.8254,-119.769 120.8678,-119.2708 124.3552,-119.5671 121.0921,-116.6303 127.8003,-120.3617 127.8003,-120.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"145\" cy=\"-72\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"145\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M77.7405,-116.8396C90.3786,-108.4142 109.3093,-95.7938 123.8702,-86.0865\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"129.8121,-82.1253 125.735,-88.6292 126.8999,-84.0668 123.9877,-86.0082 123.9877,-86.0082 123.9877,-86.0082 126.8999,-84.0668 122.2404,-83.3873 129.8121,-82.1253 129.8121,-82.1253\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M127.8003,-131.6383C116.6491,-132.8423 101.9263,-133.0683 89.4339,-132.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.3802,-131.7608 89.606,-129.1704 85.8693,-132.0357 89.3585,-132.3106 89.3585,-132.3106 89.3585,-132.3106 85.8693,-132.0357 89.1111,-135.4509 82.3802,-131.7608 82.3802,-131.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"226,-144 199,-126 226,-108 253,-126 226,-144\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-122.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M162.178,-120.364C173.2806,-119.1636 187.9303,-118.9333 200.3937,-119.6732\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"207.436,-120.221 200.2128,-122.8186 203.9466,-119.9495 200.4571,-119.6781 200.4571,-119.6781 200.4571,-119.6781 203.9466,-119.9495 200.7014,-116.5375 207.436,-120.221 207.436,-120.221\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M160.2355,-82.157C173.2706,-90.847 192.1193,-103.4129 206.2992,-112.8661\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"212.4481,-116.9654 204.8764,-115.7034 209.5359,-115.0239 206.6238,-113.0825 206.6238,-113.0825 206.6238,-113.0825 209.5359,-115.0239 208.3711,-110.4615 212.4481,-116.9654 212.4481,-116.9654\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"226\" cy=\"-72\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M163.3802,-72C174.4352,-72 188.6622,-72 200.7609,-72\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"207.9716,-72 200.9716,-75.1501 204.4716,-72 200.9716,-72.0001 200.9716,-72.0001 200.9716,-72.0001 204.4716,-72 200.9716,-68.8501 207.9716,-72 207.9716,-72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"226,-36 199,-18 226,0 253,-18 226,-36\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"226\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M160.2355,-61.843C173.2706,-53.153 192.1193,-40.5871 206.2992,-31.1339\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"212.4481,-27.0346 208.3711,-33.5385 209.8133,-29.3921 206.9011,-31.3336 206.6238,-30.9175 206.3464,-30.5015 209.2586,-28.56 204.8764,-28.2966 212.4481,-27.0346 212.4481,-27.0346\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M207.436,-131.779C196.1581,-132.8893 181.6301,-133.0474 169.4264,-132.2534\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"162.178,-131.636 169.4201,-129.0915 165.7078,-131.4349 169.1952,-131.732 169.1528,-132.2302 169.1103,-132.7284 165.6229,-132.4313 168.8854,-135.3688 162.178,-131.636 162.178,-131.636\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"460,-90 433,-72 460,-54 487,-72 460,-90\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"460\" y=\"-68.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M246.3566,-121.3023C288.5563,-111.5639 385.5805,-89.1737 432.9661,-78.2386\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"439.8571,-76.6484 433.7447,-81.2918 436.4467,-77.4354 433.0363,-78.2225 433.0363,-78.2225 433.0363,-78.2225 436.4467,-77.4354 432.328,-75.1531 439.8571,-76.6484 439.8571,-76.6484\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"307\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"307\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M244.3802,-12.2392C255.6671,-11.1141 270.2605,-10.9488 282.5195,-11.7431\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"289.8003,-12.3617 282.5587,-14.9077 286.3129,-12.0653 282.8254,-11.769 282.8254,-11.769 282.8254,-11.769 286.3129,-12.0653 283.0921,-8.6303 289.8003,-12.3617 289.8003,-12.3617\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M289.8003,-23.6383C278.6491,-24.8423 263.9263,-25.0683 251.4339,-24.3165\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"244.3802,-23.7608 251.606,-21.1704 247.8693,-24.0357 251.3585,-24.3106 251.3585,-24.3106 251.3585,-24.3106 247.8693,-24.0357 251.1111,-27.4509 244.3802,-23.7608 244.3802,-23.7608\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"379\" cy=\"-49\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"379\" y=\"-45.3\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->8 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>7->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M323.6992,-25.1899C333.2409,-29.2982 345.3509,-34.5122 355.8046,-39.0131\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"362.3913,-41.849 354.7162,-41.974 358.9789,-40.9242 355.7642,-39.54 355.9619,-39.0808 356.1597,-38.6215 359.3744,-40.0057 357.2077,-36.1876 362.3913,-41.849 362.3913,-41.849\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M396.5758,-53.9907C407.5442,-57.1052 421.8575,-61.1694 434.1105,-64.6486\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"441.0459,-66.618 433.4516,-67.736 437.5424,-66.1429 434.1755,-65.1868 434.3121,-64.7058 434.4486,-64.2248 437.8155,-65.1809 435.1725,-61.6756 441.0459,-66.618 441.0459,-66.618\"/>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text/plain": [
|
|
"<spot.jupyter.SVG object>"
|
|
]
|
|
},
|
|
"execution_count": 7,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.highlight_strategy(game)\n",
|
|
"game.show('.g')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Input/Output\n",
|
|
"\n",
|
|
"An extension of the HOA format makes it possible to store the `state-player` property. This allows us to read the parity game constructed by `ltlsynt` using `spot.automaton()` like any other automaton."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"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.40.1 (20161225.0304)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"554pt\" height=\"271pt\"\n",
|
|
" viewBox=\"0.00 0.00 553.58 270.52\" 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 266.5153)\">\n",
|
|
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-266.5153 549.5801,-266.5153 549.5801,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"250.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"275.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"<text text-anchor=\"start\" x=\"291.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">)</text>\n",
|
|
"<text text-anchor=\"start\" x=\"240.2901\" y=\"-234.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[co-Büchi]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"56\" cy=\"-128.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-125.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.1233,-128.8674C4.178,-128.8674 17.9448,-128.8674 30.9241,-128.8674\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"37.9807,-128.8674 30.9808,-132.0175 34.4807,-128.8675 30.9807,-128.8675 30.9807,-128.8675 30.9807,-128.8675 34.4807,-128.8675 30.9807,-125.7175 37.9807,-128.8674 37.9807,-128.8674\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"143.9789,-119.8674 121.021,-101.8674 143.9789,-83.8674 166.9368,-101.8674 143.9789,-119.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"143.9789\" y=\"-98.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->5 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M72.693,-121.8718C78.7185,-119.4812 85.6096,-116.9003 92,-114.8674 100.5874,-112.1358 110.1189,-109.6099 118.6503,-107.5253\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"125.5388,-105.8832 119.4601,-110.5706 122.1342,-106.6948 118.7296,-107.5065 118.7296,-107.5065 118.7296,-107.5065 122.1342,-106.6948 117.9991,-104.4423 125.5388,-105.8832 125.5388,-105.8832\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-118.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"143.9789,-173.8674 121.021,-155.8674 143.9789,-137.8674 166.9368,-155.8674 143.9789,-173.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"143.9789\" y=\"-152.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->6 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M73.3818,-134.2018C86.8089,-138.3224 105.5337,-144.0689 120.3252,-148.6083\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"127.2302,-150.7274 119.614,-151.685 123.8842,-149.7005 120.5382,-148.6736 120.5382,-148.6736 120.5382,-148.6736 123.8842,-149.7005 121.4624,-145.6622 127.2302,-150.7274 127.2302,-150.7274\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94\" y=\"-146.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"233.9579\" cy=\"-116.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"233.9579\" y=\"-113.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->1 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>5->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M163.0611,-105.0486C176.4157,-107.2748 194.3902,-110.2713 208.8989,-112.69\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"216.1272,-113.895 208.7044,-115.8509 212.6748,-113.3194 209.2224,-112.7438 209.2224,-112.7438 209.2224,-112.7438 212.6748,-113.3194 209.7405,-109.6367 216.1272,-113.895 216.1272,-113.895\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"184.9579\" y=\"-113.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"233.9579\" cy=\"-55.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"233.9579\" y=\"-52.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->3 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>5->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M158.0381,-94.6799C172.3503,-87.3631 194.7568,-75.9082 211.5243,-67.3362\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"217.8714,-64.0913 213.0726,-70.0825 214.7551,-65.6845 211.6387,-67.2777 211.6387,-67.2777 211.6387,-67.2777 214.7551,-65.6845 210.2048,-64.473 217.8714,-64.0913 217.8714,-64.0913\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"186.9579\" y=\"-83.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"419.9157\" cy=\"-187.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"419.9157\" y=\"-184.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->2 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>6->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M159.0841,-162.2582C194.6639,-176.9224 286.856,-212.6624 367.9157,-224.8674 374.9476,-225.9262 377.3647,-227.6337 383.9157,-224.8674 392.1723,-221.381 399.4715,-214.9726 405.3016,-208.457\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"409.842,-203.0205 407.7726,-210.4124 407.5984,-205.7069 405.3548,-208.3932 405.3548,-208.3932 405.3548,-208.3932 407.5984,-205.7069 402.9371,-206.374 409.842,-203.0205 409.842,-203.0205\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"271.4579\" y=\"-209.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->3 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>6->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M159.8037,-150.0692C171.5369,-145.118 187.2816,-137.0198 197.9579,-125.8674 210.3281,-112.9455 207.7724,-105.7734 215.9579,-89.8674 217.9157,-86.063 220.0209,-82.0334 222.077,-78.1297\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"225.4565,-71.7408 224.9679,-79.4014 223.8199,-74.8346 222.1834,-77.9285 222.1834,-77.9285 222.1834,-77.9285 223.8199,-74.8346 219.399,-76.4556 225.4565,-71.7408 225.4565,-71.7408\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"186.9579\" y=\"-139.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"515.2479,-137.8674 492.29,-119.8674 515.2479,-101.8674 538.2058,-119.8674 515.2479,-137.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"515.2479\" y=\"-116.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->7 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M251.9817,-117.0597C299.1929,-117.5632 426.8416,-118.9246 485.2902,-119.5479\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"492.3983,-119.6237 485.365,-122.6988 488.8985,-119.5864 485.3987,-119.549 485.3987,-119.549 485.3987,-119.549 488.8985,-119.5864 485.4323,-116.3992 492.3983,-119.6237 492.3983,-119.6237\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"370.4157\" y=\"-121.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"326.9368,-183.8674 303.9789,-165.8674 326.9368,-147.8674 349.8947,-165.8674 326.9368,-183.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.9368\" y=\"-162.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->8 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M250.1536,-125.4026C265.8624,-133.6812 289.7448,-146.2672 306.6984,-155.2018\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"313.0483,-158.5482 305.387,-158.0713 309.952,-156.9164 306.8556,-155.2846 306.8556,-155.2846 306.8556,-155.2846 309.952,-156.9164 308.3242,-152.4979 313.0483,-158.5482 313.0483,-158.5482\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"274.4579\" y=\"-160.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"269.9579\" y=\"-145.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->1 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>7->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M497.0861,-116.0269C471.8433,-110.904 424.6573,-102.1042 383.9157,-98.8674 339.5777,-95.345 288.1593,-104.3931 258.5095,-110.8998\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"251.458,-112.4901 257.5934,-107.8772 254.8722,-111.7201 258.2865,-110.9501 258.2865,-110.9501 258.2865,-110.9501 254.8722,-111.7201 258.9795,-114.0229 251.458,-112.4901 251.458,-112.4901\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"375.9157\" y=\"-102.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->2 -->\n",
|
|
"<g id=\"edge15\" class=\"edge\">\n",
|
|
"<title>8->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M338.7804,-174.6754C346.6071,-179.9301 357.339,-186.1022 367.9157,-188.8674 376.429,-191.0932 385.9963,-191.4795 394.5813,-191.1042\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"401.8217,-190.6055 395.0548,-194.2292 398.33,-190.8461 394.8383,-191.0866 394.8383,-191.0866 394.8383,-191.0866 398.33,-190.8461 394.6218,-187.9441 401.8217,-190.6055 401.8217,-190.6055\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"371.4157\" y=\"-209.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"367.9157\" y=\"-194.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->7 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M434.8114,-177.2424C451.749,-165.1609 479.3864,-145.4473 497.4459,-132.5655\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"503.174,-128.4797 499.3044,-135.1091 500.3246,-130.5122 497.4752,-132.5447 497.4752,-132.5447 497.4752,-132.5447 500.3246,-130.5122 495.646,-129.9802 503.174,-128.4797 503.174,-128.4797\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"455.9157\" y=\"-165.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M407.5965,-174.4176C401.1932,-168.4248 392.8468,-162.0173 383.9157,-158.8674 373.0715,-155.0429 360.4286,-156.0875 349.8109,-158.3891\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"342.8307,-160.1391 348.8546,-155.3813 346.2257,-159.2879 349.6206,-158.4368 349.6206,-158.4368 349.6206,-158.4368 346.2257,-159.2879 350.3866,-161.4922 342.8307,-160.1391 342.8307,-160.1391\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"372.4157\" y=\"-177.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"367.9157\" y=\"-162.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>9</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"326.9368,-42.8674 303.9789,-24.8674 326.9368,-6.8674 349.8947,-24.8674 326.9368,-42.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.9368\" y=\"-21.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">9</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M251.4465,-50.0366C266.2268,-45.1087 287.5188,-38.0098 303.7246,-32.6066\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"310.771,-30.2573 305.1267,-35.4597 307.4507,-31.3643 304.1303,-32.4714 304.1303,-32.4714 304.1303,-32.4714 307.4507,-31.3643 303.134,-29.4831 310.771,-30.2573 310.771,-30.2573\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"277.9579\" y=\"-46.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->3 -->\n",
|
|
"<g id=\"edge16\" class=\"edge\">\n",
|
|
"<title>9->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M315.6311,-15.5976C303.8494,-7.1383 285.0376,2.9462 269.9579,-4.8674 258.5624,-10.7721 250.0062,-22.1272 244.101,-32.6266\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"240.765,-38.997 241.2218,-31.3345 242.3887,-35.8964 244.0124,-32.7958 244.0124,-32.7958 244.0124,-32.7958 242.3887,-35.8964 246.8029,-34.2572 240.765,-38.997 240.765,-38.997\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"273.4579\" y=\"-23.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"269.9579\" y=\"-8.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node11\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#000000\" cx=\"419.9157\" cy=\"-24.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"419.9157\" y=\"-21.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->4 -->\n",
|
|
"<g id=\"edge17\" class=\"edge\">\n",
|
|
"<title>9->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M349.9204,-24.8674C363.4419,-24.8674 380.5635,-24.8674 394.4884,-24.8674\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"401.8523,-24.8674 394.8524,-28.0175 398.3523,-24.8675 394.8523,-24.8675 394.8523,-24.8675 394.8523,-24.8675 398.3523,-24.8675 394.8523,-21.7175 401.8523,-24.8674 401.8523,-24.8674\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"369.4157\" y=\"-28.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10 -->\n",
|
|
"<g id=\"node12\" class=\"node\">\n",
|
|
"<title>10</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#000000\" points=\"515.2479,-37.8674 485.0826,-19.8674 515.2479,-1.8674 545.4132,-19.8674 515.2479,-37.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"515.2479\" y=\"-16.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">10</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->10 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->10</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M434.0464,-13.1902C440.3368,-8.7237 448.0848,-4.1554 455.9157,-1.8674 468.6988,1.8674 482.9837,-2.2116 494.3333,-7.4244\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"500.6431,-10.5741 492.9731,-10.266 497.5116,-9.0109 494.38,-7.4477 494.38,-7.4477 494.38,-7.4477 497.5116,-9.0109 495.7869,-4.6293 500.6431,-10.5741 500.6431,-10.5741\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"461.4157\" y=\"-5.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->4 -->\n",
|
|
"<g id=\"edge18\" class=\"edge\">\n",
|
|
"<title>10->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M487.1607,-21.3406C473.9738,-22.0322 458.3671,-22.8507 445.51,-23.5251\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"438.2967,-23.9034 445.1221,-20.391 441.7919,-23.72 445.2871,-23.5367 445.2871,-23.5367 445.2871,-23.5367 441.7919,-23.72 445.4521,-26.6823 438.2967,-23.9034 438.2967,-23.9034\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"461.4157\" y=\"-27.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</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 0x7f6be431fbd0> >"
|
|
]
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"game = spot.automaton(\"ltlsynt --ins=a --outs=b -f '!b & GFa <-> Gb' --print-game-hoa |\");\n",
|
|
"game"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"In the graphical output, player 0 is represented by circles (or ellipses or rounded rectangles depending on the situations), while player 1's states are diamond shaped. In the case of `ltlsynt`, player 0 plays the role of the environment, and player 1 plays the role of the controler.\n",
|
|
"\n",
|
|
"In the HOA output, a header `spot-state-player` (or `spot.state-player` in HOA 1.1) lists the owner of each state."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"HOA: v1\n",
|
|
"States: 11\n",
|
|
"Start: 0\n",
|
|
"AP: 2 \"b\" \"a\"\n",
|
|
"acc-name: co-Buchi\n",
|
|
"Acceptance: 1 Fin(0)\n",
|
|
"properties: trans-labels explicit-labels trans-acc complete\n",
|
|
"properties: deterministic\n",
|
|
"spot-state-player: 0 0 0 0 0 1 1 1 1 1 1\n",
|
|
"controllable-AP: 0\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[!1] 5\n",
|
|
"[1] 6\n",
|
|
"State: 1\n",
|
|
"[!1] 7\n",
|
|
"[1] 8 {0}\n",
|
|
"State: 2\n",
|
|
"[!1] 7\n",
|
|
"[1] 8 {0}\n",
|
|
"State: 3\n",
|
|
"[t] 9\n",
|
|
"State: 4\n",
|
|
"[t] 10\n",
|
|
"State: 5\n",
|
|
"[!0] 1\n",
|
|
"[0] 3\n",
|
|
"State: 6\n",
|
|
"[!0] 2\n",
|
|
"[0] 3\n",
|
|
"State: 7\n",
|
|
"[t] 1\n",
|
|
"State: 8\n",
|
|
"[t] 2 {0}\n",
|
|
"State: 9\n",
|
|
"[0] 3 {0}\n",
|
|
"[!0] 4\n",
|
|
"State: 10\n",
|
|
"[t] 4\n",
|
|
"--END--\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print(game.to_str('hoa'))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Here is the solution of this particular game."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 10,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.solve_parity_game(game)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"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.40.1 (20161225.0304)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"554pt\" height=\"271pt\"\n",
|
|
" viewBox=\"0.00 0.00 553.58 270.52\" 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 266.5153)\">\n",
|
|
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-266.5153 549.5801,-266.5153 549.5801,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"250.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"275.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"<text text-anchor=\"start\" x=\"291.2901\" y=\"-248.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">)</text>\n",
|
|
"<text text-anchor=\"start\" x=\"240.2901\" y=\"-234.3153\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">[co-Büchi]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"56\" cy=\"-128.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-125.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M1.1233,-128.8674C4.178,-128.8674 17.9448,-128.8674 30.9241,-128.8674\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"37.9807,-128.8674 30.9808,-132.0175 34.4807,-128.8675 30.9807,-128.8675 30.9807,-128.8675 30.9807,-128.8675 34.4807,-128.8675 30.9807,-125.7175 37.9807,-128.8674 37.9807,-128.8674\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"143.9789,-119.8674 121.021,-101.8674 143.9789,-83.8674 166.9368,-101.8674 143.9789,-119.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"143.9789\" y=\"-98.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->5 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M72.693,-121.8718C78.7185,-119.4812 85.6096,-116.9003 92,-114.8674 100.5874,-112.1358 110.1189,-109.6099 118.6503,-107.5253\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"125.5388,-105.8832 119.4601,-110.5706 122.1342,-106.6948 118.7296,-107.5065 118.7296,-107.5065 118.7296,-107.5065 122.1342,-106.6948 117.9991,-104.4423 125.5388,-105.8832 125.5388,-105.8832\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-118.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"143.9789,-173.8674 121.021,-155.8674 143.9789,-137.8674 166.9368,-155.8674 143.9789,-173.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"143.9789\" y=\"-152.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->6 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M73.3818,-134.2018C86.8089,-138.3224 105.5337,-144.0689 120.3252,-148.6083\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"127.2302,-150.7274 119.614,-151.685 123.8842,-149.7005 120.5382,-148.6736 120.5382,-148.6736 120.5382,-148.6736 123.8842,-149.7005 121.4624,-145.6622 127.2302,-150.7274 127.2302,-150.7274\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94\" y=\"-146.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"233.9579\" cy=\"-116.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"233.9579\" y=\"-113.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->1 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>5->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M163.0611,-105.0486C176.4157,-107.2748 194.3902,-110.2713 208.8989,-112.69\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"216.1272,-113.895 208.7044,-115.8509 212.6748,-113.3194 209.2224,-112.7438 209.2224,-112.7438 209.2224,-112.7438 212.6748,-113.3194 209.7405,-109.6367 216.1272,-113.895 216.1272,-113.895\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"184.9579\" y=\"-113.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"233.9579\" cy=\"-55.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"233.9579\" y=\"-52.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->3 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>5->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M158.0381,-94.6799C172.3503,-87.3631 194.7568,-75.9082 211.5243,-67.3362\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"217.8714,-64.0913 213.0726,-70.0825 214.9827,-66.1297 211.8663,-67.7229 211.6387,-67.2777 211.4111,-66.8325 214.5275,-65.2393 210.2048,-64.473 217.8714,-64.0913 217.8714,-64.0913\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"186.9579\" y=\"-83.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"419.9157\" cy=\"-187.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"419.9157\" y=\"-184.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->2 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>6->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M159.0841,-162.2582C194.6639,-176.9224 286.856,-212.6624 367.9157,-224.8674 374.9476,-225.9262 377.3647,-227.6337 383.9157,-224.8674 392.1723,-221.381 399.4715,-214.9726 405.3016,-208.457\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"409.842,-203.0205 407.7726,-210.4124 407.5984,-205.7069 405.3548,-208.3932 405.3548,-208.3932 405.3548,-208.3932 407.5984,-205.7069 402.9371,-206.374 409.842,-203.0205 409.842,-203.0205\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"271.4579\" y=\"-209.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->3 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>6->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M159.8037,-150.0692C171.5369,-145.118 187.2816,-137.0198 197.9579,-125.8674 210.3281,-112.9455 207.7724,-105.7734 215.9579,-89.8674 217.9157,-86.063 220.0209,-82.0334 222.077,-78.1297\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"225.4565,-71.7408 224.9679,-79.4014 224.2619,-75.0684 222.6254,-78.1623 222.1834,-77.9285 221.7414,-77.6947 223.378,-74.6009 219.399,-76.4556 225.4565,-71.7408 225.4565,-71.7408\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"186.9579\" y=\"-139.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"515.2479,-137.8674 492.29,-119.8674 515.2479,-101.8674 538.2058,-119.8674 515.2479,-137.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"515.2479\" y=\"-116.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->7 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M251.9817,-117.0597C299.1929,-117.5632 426.8416,-118.9246 485.2902,-119.5479\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"492.3983,-119.6237 485.365,-122.6988 488.8985,-119.5864 485.3987,-119.549 485.3987,-119.549 485.3987,-119.549 488.8985,-119.5864 485.4323,-116.3992 492.3983,-119.6237 492.3983,-119.6237\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"370.4157\" y=\"-121.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"326.9368,-183.8674 303.9789,-165.8674 326.9368,-147.8674 349.8947,-165.8674 326.9368,-183.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.9368\" y=\"-162.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->8 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M250.1536,-125.4026C265.8624,-133.6812 289.7448,-146.2672 306.6984,-155.2018\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"313.0483,-158.5482 305.387,-158.0713 309.7189,-157.3587 306.6225,-155.7269 306.8556,-155.2846 307.0887,-154.8423 310.1851,-156.4741 308.3242,-152.4979 313.0483,-158.5482 313.0483,-158.5482\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"274.4579\" y=\"-160.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"269.9579\" y=\"-145.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->1 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>7->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M497.0861,-116.0269C471.8433,-110.904 424.6573,-102.1042 383.9157,-98.8674 339.5777,-95.345 288.1593,-104.3931 258.5095,-110.8998\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"251.458,-112.4901 257.5934,-107.8772 254.8722,-111.7201 258.2865,-110.9501 258.2865,-110.9501 258.2865,-110.9501 254.8722,-111.7201 258.9795,-114.0229 251.458,-112.4901 251.458,-112.4901\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"375.9157\" y=\"-102.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->2 -->\n",
|
|
"<g id=\"edge15\" class=\"edge\">\n",
|
|
"<title>8->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M338.7804,-174.6754C346.6071,-179.9301 357.339,-186.1022 367.9157,-188.8674 376.429,-191.0932 385.9963,-191.4795 394.5813,-191.1042\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"401.8217,-190.6055 395.0548,-194.2292 398.33,-190.8461 394.8383,-191.0866 394.8383,-191.0866 394.8383,-191.0866 398.33,-190.8461 394.6218,-187.9441 401.8217,-190.6055 401.8217,-190.6055\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"371.4157\" y=\"-209.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"367.9157\" y=\"-194.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->7 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M434.8114,-177.2424C451.749,-165.1609 479.3864,-145.4473 497.4459,-132.5655\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"503.174,-128.4797 499.3044,-135.1091 500.3246,-130.5122 497.4752,-132.5447 497.4752,-132.5447 497.4752,-132.5447 500.3246,-130.5122 495.646,-129.9802 503.174,-128.4797 503.174,-128.4797\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"455.9157\" y=\"-165.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M407.5965,-174.4176C401.1932,-168.4248 392.8468,-162.0173 383.9157,-158.8674 373.0715,-155.0429 360.4286,-156.0875 349.8109,-158.3891\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"342.8307,-160.1391 348.8546,-155.3813 346.1041,-158.8029 349.499,-157.9518 349.6206,-158.4368 349.7422,-158.9218 346.3473,-159.7729 350.3866,-161.4922 342.8307,-160.1391 342.8307,-160.1391\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"372.4157\" y=\"-177.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"367.9157\" y=\"-162.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>9</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"326.9368,-42.8674 303.9789,-24.8674 326.9368,-6.8674 349.8947,-24.8674 326.9368,-42.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"326.9368\" y=\"-21.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">9</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M251.4465,-50.0366C266.2268,-45.1087 287.5188,-38.0098 303.7246,-32.6066\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"310.771,-30.2573 305.1267,-35.4597 307.4507,-31.3643 304.1303,-32.4714 304.1303,-32.4714 304.1303,-32.4714 307.4507,-31.3643 303.134,-29.4831 310.771,-30.2573 310.771,-30.2573\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"277.9579\" y=\"-46.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->3 -->\n",
|
|
"<g id=\"edge16\" class=\"edge\">\n",
|
|
"<title>9->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M315.6311,-15.5976C303.8494,-7.1383 285.0376,2.9462 269.9579,-4.8674 258.5624,-10.7721 250.0062,-22.1272 244.101,-32.6266\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"240.765,-38.997 241.2218,-31.3345 242.3887,-35.8964 244.0124,-32.7958 244.0124,-32.7958 244.0124,-32.7958 242.3887,-35.8964 246.8029,-34.2572 240.765,-38.997 240.765,-38.997\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"273.4579\" y=\"-23.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"269.9579\" y=\"-8.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node11\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"419.9157\" cy=\"-24.8674\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"419.9157\" y=\"-21.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->4 -->\n",
|
|
"<g id=\"edge17\" class=\"edge\">\n",
|
|
"<title>9->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M349.9204,-24.8674C363.4419,-24.8674 380.5635,-24.8674 394.4884,-24.8674\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"401.8523,-24.8674 394.8524,-28.0175 398.3523,-25.3675 394.8523,-25.3675 394.8523,-24.8675 394.8523,-24.3675 398.3523,-24.3675 394.8523,-21.7175 401.8523,-24.8674 401.8523,-24.8674\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"369.4157\" y=\"-28.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">!b</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10 -->\n",
|
|
"<g id=\"node12\" class=\"node\">\n",
|
|
"<title>10</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"515.2479,-37.8674 485.0826,-19.8674 515.2479,-1.8674 545.4132,-19.8674 515.2479,-37.8674\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"515.2479\" y=\"-16.1674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">10</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->10 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->10</title>\n",
|
|
"<path fill=\"none\" stroke=\"#000000\" d=\"M434.0464,-13.1902C440.3368,-8.7237 448.0848,-4.1554 455.9157,-1.8674 468.6988,1.8674 482.9837,-2.2116 494.3333,-7.4244\"/>\n",
|
|
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"500.6431,-10.5741 492.9731,-10.266 497.5116,-9.0109 494.38,-7.4477 494.38,-7.4477 494.38,-7.4477 497.5116,-9.0109 495.7869,-4.6293 500.6431,-10.5741 500.6431,-10.5741\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"461.4157\" y=\"-5.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->4 -->\n",
|
|
"<g id=\"edge18\" class=\"edge\">\n",
|
|
"<title>10->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M487.1607,-21.3406C473.9738,-22.0322 458.3671,-22.8507 445.51,-23.5251\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"438.2967,-23.9034 445.1221,-20.391 441.7657,-23.2207 445.2609,-23.0374 445.2871,-23.5367 445.3133,-24.036 441.8181,-24.2193 445.4521,-26.6823 438.2967,-23.9034 438.2967,-23.9034\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"461.4157\" y=\"-27.6674\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#000000\">1</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 0x7f6be431fcf0> >"
|
|
]
|
|
},
|
|
"execution_count": 11,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"spot.highlight_strategy(game)"
|
|
]
|
|
}
|
|
],
|
|
"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
|
|
}
|