* doc/spot.bib (perez.19.hoa): New entry. * spot/parseaut/public.hh: Mention it. * spot/parseaut/parseaut.yy, spot/parseaut/scanaut.ll: Learn to parse the controllable-AP header. * spot/twaalgos/hoa.cc: Print it. * tests/core/ltlsynt.test, tests/core/parseaut.test, tests/core/readsave.test, tests/python/_synthesis.ipynb, tests/python/except.py, tests/python/games.ipynb, tests/python/mealy.py, tests/python/synthesis.py: Adjust or augment test cases.
1333 lines
80 KiB
Text
1333 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.43.0 (0)\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=\"white\" 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\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\">[all]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">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.04,-126C1.93,-126 15.66,-126 29.98,-126\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37,-126 30,-129.15 33.5,-126 30,-126 30,-126 30,-126 33.5,-126 30,-122.85 37,-126 37,-126\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M82.53,-120.28C93.75,-119.1 108.43,-118.93 120.64,-119.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"127.86,-120.43 120.61,-122.94 124.38,-120.12 120.89,-119.8 120.89,-119.8 120.89,-119.8 124.38,-120.12 121.17,-116.66 127.86,-120.43 127.86,-120.43\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M78.05,-117.08C90.47,-108.59 109.36,-95.68 123.74,-85.85\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"129.6,-81.85 125.59,-88.4 126.71,-83.82 123.82,-85.8 123.82,-85.8 123.82,-85.8 126.71,-83.82 122.04,-83.2 129.6,-81.85 129.6,-81.85\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M127.86,-131.57C116.84,-132.84 102.04,-133.09 89.56,-132.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"82.53,-131.72 89.77,-129.16 86.02,-132.01 89.51,-132.3 89.51,-132.3 89.51,-132.3 86.02,-132.01 89.25,-135.44 82.53,-131.72 82.53,-131.72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M162.37,-120.41C173.4,-119.15 188.15,-118.92 200.56,-119.71\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"207.56,-120.29 200.32,-122.85 204.07,-120 200.58,-119.71 200.58,-119.71 200.58,-119.71 204.07,-120 200.84,-116.57 207.56,-120.29 207.56,-120.29\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M160.49,-81.9C173.24,-90.62 191.89,-103.37 205.86,-112.92\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"211.91,-117.05 204.36,-115.7 209.02,-115.08 206.13,-113.1 206.13,-113.1 206.13,-113.1 209.02,-115.08 207.91,-110.5 211.91,-117.05 211.91,-117.05\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M163.14,-72C171.54,-72 181.95,-72 191.82,-72\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"198.87,-72 191.87,-75.15 195.37,-72 191.87,-72 191.87,-72 191.87,-72 195.37,-72 191.87,-68.85 198.87,-72 198.87,-72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M160.49,-62.1C173.24,-53.38 191.89,-40.63 205.86,-31.08\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"211.91,-26.95 207.91,-33.5 209.02,-28.92 206.13,-30.9 206.13,-30.9 206.13,-30.9 209.02,-28.92 204.36,-28.3 211.91,-26.95 211.91,-26.95\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M207.56,-131.71C196.4,-132.89 181.78,-133.07 169.59,-132.24\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"162.37,-131.59 169.62,-129.08 165.85,-131.9 169.34,-132.22 169.34,-132.22 169.34,-132.22 165.85,-131.9 169.06,-135.35 162.37,-131.59 162.37,-131.59\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M246.38,-121.49C287.92,-111.82 385.57,-89.09 432.67,-78.13\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"439.51,-76.54 433.41,-81.19 436.1,-77.33 432.69,-78.12 432.69,-78.12 432.69,-78.12 436.1,-77.33 431.98,-75.06 439.51,-76.54 439.51,-76.54\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M244.53,-12.28C255.75,-11.1 270.43,-10.93 282.64,-11.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"289.86,-12.43 282.61,-14.94 286.38,-12.12 282.89,-11.8 282.89,-11.8 282.89,-11.8 286.38,-12.12 283.17,-8.66 289.86,-12.43 289.86,-12.43\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M289.86,-23.57C278.84,-24.84 264.04,-25.09 251.56,-24.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"244.53,-23.72 251.77,-21.16 248.02,-24.01 251.51,-24.3 251.51,-24.3 251.51,-24.3 248.02,-24.01 251.25,-27.44 244.53,-23.72 244.53,-23.72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->8 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>7->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M323.88,-25.03C333.28,-29.2 345.33,-34.53 355.67,-39.11\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"362.18,-41.99 354.5,-42.04 358.98,-40.58 355.78,-39.16 355.78,-39.16 355.78,-39.16 358.98,-40.58 357.05,-36.28 362.18,-41.99 362.18,-41.99\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M396.37,-53.77C407.17,-56.91 421.54,-61.1 433.79,-64.66\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"440.72,-66.68 433.12,-67.75 437.36,-65.7 434,-64.72 434,-64.72 434,-64.72 437.36,-65.7 434.88,-61.7 440.72,-66.68 440.72,-66.68\"/>\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.43.0 (0)\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=\"white\" 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\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\">[all]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">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.04,-126C1.93,-126 15.66,-126 29.98,-126\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37,-126 30,-129.15 33.5,-126 30,-126 30,-126 30,-126 33.5,-126 30,-122.85 37,-126 37,-126\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M82.53,-120.28C93.75,-119.1 108.43,-118.93 120.64,-119.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"127.86,-120.43 120.61,-122.94 124.38,-120.12 120.89,-119.8 120.89,-119.8 120.89,-119.8 124.38,-120.12 121.17,-116.66 127.86,-120.43 127.86,-120.43\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M78.05,-117.08C90.47,-108.59 109.36,-95.68 123.74,-85.85\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"129.6,-81.85 125.59,-88.4 126.71,-83.82 123.82,-85.8 123.82,-85.8 123.82,-85.8 126.71,-83.82 122.04,-83.2 129.6,-81.85 129.6,-81.85\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M127.86,-131.57C116.84,-132.84 102.04,-133.09 89.56,-132.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"82.53,-131.72 89.77,-129.16 86.02,-132.01 89.51,-132.3 89.51,-132.3 89.51,-132.3 86.02,-132.01 89.25,-135.44 82.53,-131.72 82.53,-131.72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M162.37,-120.41C173.4,-119.15 188.15,-118.92 200.56,-119.71\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"207.56,-120.29 200.32,-122.85 204.07,-120 200.58,-119.71 200.58,-119.71 200.58,-119.71 204.07,-120 200.84,-116.57 207.56,-120.29 207.56,-120.29\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M160.49,-81.9C173.24,-90.62 191.89,-103.37 205.86,-112.92\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"211.91,-117.05 204.36,-115.7 209.02,-115.08 206.13,-113.1 206.13,-113.1 206.13,-113.1 209.02,-115.08 207.91,-110.5 211.91,-117.05 211.91,-117.05\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M163.14,-72C174.12,-72 188.52,-72 200.67,-72\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"207.89,-72 200.89,-75.15 204.39,-72 200.89,-72 200.89,-72 200.89,-72 204.39,-72 200.89,-68.85 207.89,-72 207.89,-72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->6 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>3->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M160.49,-62.1C173.24,-53.38 191.89,-40.63 205.86,-31.08\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"211.91,-26.95 207.91,-33.5 209.02,-28.92 206.13,-30.9 206.13,-30.9 206.13,-30.9 209.02,-28.92 204.36,-28.3 211.91,-26.95 211.91,-26.95\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 2->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M207.56,-131.71C196.4,-132.89 181.78,-133.07 169.59,-132.24\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"162.37,-131.59 169.62,-129.08 165.85,-131.9 169.34,-132.22 169.34,-132.22 169.34,-132.22 165.85,-131.9 169.06,-135.35 162.37,-131.59 162.37,-131.59\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" 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\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M246.38,-121.49C287.92,-111.82 385.57,-89.09 432.67,-78.13\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"439.51,-76.54 433.41,-81.19 436.1,-77.33 432.69,-78.12 432.69,-78.12 432.69,-78.12 436.1,-77.33 431.98,-75.06 439.51,-76.54 439.51,-76.54\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M244.53,-12.28C255.75,-11.1 270.43,-10.93 282.64,-11.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"289.86,-12.43 282.61,-14.94 286.38,-12.12 282.89,-11.8 282.89,-11.8 282.89,-11.8 286.38,-12.12 283.17,-8.66 289.86,-12.43 289.86,-12.43\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M289.86,-23.57C278.84,-24.84 264.04,-25.09 251.56,-24.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"244.53,-23.72 251.77,-21.16 248.02,-24.01 251.51,-24.3 251.51,-24.3 251.51,-24.3 248.02,-24.01 251.25,-27.44 244.53,-23.72 244.53,-23.72\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" 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\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->8 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>7->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M323.88,-25.03C333.28,-29.2 345.33,-34.53 355.67,-39.11\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"362.18,-41.99 354.5,-42.04 358.98,-40.58 355.78,-39.16 355.78,-39.16 355.78,-39.16 358.98,-40.58 357.05,-36.28 362.18,-41.99 362.18,-41.99\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 8->5 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>8->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M396.37,-53.77C407.17,-56.91 421.54,-61.1 433.79,-64.66\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"440.72,-66.68 433.12,-67.75 437.36,-65.7 434,-64.72 434,-64.72 434,-64.72 437.36,-65.7 434.88,-61.7 440.72,-66.68 440.72,-66.68\"/>\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.43.0 (0)\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=\"white\" 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\">t</text>\n",
|
|
"<text text-anchor=\"start\" x=\"232.5\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\">[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\">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.04,-126C1.93,-126 15.66,-126 29.98,-126\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37,-126 30,-129.15 33.5,-126 30,-126 30,-126 30,-126 33.5,-126 30,-122.85 37,-126 37,-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\">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.53,-120.28C93.75,-119.1 108.43,-118.93 120.64,-119.78\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"127.86,-120.43 120.61,-122.94 124.33,-120.62 120.84,-120.3 120.89,-119.8 120.94,-119.3 124.42,-119.62 121.17,-116.66 127.86,-120.43 127.86,-120.43\"/>\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\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->3 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M78.05,-117.08C90.47,-108.59 109.36,-95.68 123.74,-85.85\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"129.6,-81.85 125.59,-88.4 126.71,-83.82 123.82,-85.8 123.82,-85.8 123.82,-85.8 126.71,-83.82 122.04,-83.2 129.6,-81.85 129.6,-81.85\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M127.86,-131.57C116.84,-132.84 102.04,-133.09 89.56,-132.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"82.53,-131.72 89.77,-129.16 86.02,-132.01 89.51,-132.3 89.51,-132.3 89.51,-132.3 86.02,-132.01 89.25,-135.44 82.53,-131.72 82.53,-131.72\"/>\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\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->2 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M162.37,-120.41C173.4,-119.15 188.15,-118.92 200.56,-119.71\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"207.56,-120.29 200.32,-122.85 204.07,-120 200.58,-119.71 200.58,-119.71 200.58,-119.71 204.07,-120 200.84,-116.57 207.56,-120.29 207.56,-120.29\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 3->2 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>3->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M160.49,-81.9C173.24,-90.62 191.89,-103.37 205.86,-112.92\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"211.91,-117.05 204.36,-115.7 209.02,-115.08 206.13,-113.1 206.13,-113.1 206.13,-113.1 209.02,-115.08 207.91,-110.5 211.91,-117.05 211.91,-117.05\"/>\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\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->4 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>3->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M163.14,-72C174.12,-72 188.52,-72 200.67,-72\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"207.89,-72 200.89,-75.15 204.39,-72 200.89,-72 200.89,-72 200.89,-72 204.39,-72 200.89,-68.85 207.89,-72 207.89,-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\">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.49,-62.1C173.24,-53.38 191.89,-40.63 205.86,-31.08\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"211.91,-26.95 207.91,-33.5 209.31,-29.33 206.42,-31.31 206.13,-30.9 205.85,-30.48 208.74,-28.51 204.36,-28.3 211.91,-26.95 211.91,-26.95\"/>\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.56,-131.71C196.4,-132.89 181.78,-133.07 169.59,-132.24\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"162.37,-131.59 169.62,-129.08 165.9,-131.41 169.39,-131.72 169.34,-132.22 169.3,-132.71 165.81,-132.4 169.06,-135.35 162.37,-131.59 162.37,-131.59\"/>\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\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->5 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>2->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M246.38,-121.49C287.92,-111.82 385.57,-89.09 432.67,-78.13\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"439.51,-76.54 433.41,-81.19 436.1,-77.33 432.69,-78.12 432.69,-78.12 432.69,-78.12 436.1,-77.33 431.98,-75.06 439.51,-76.54 439.51,-76.54\"/>\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\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->7 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M244.53,-12.28C255.75,-11.1 270.43,-10.93 282.64,-11.78\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"289.86,-12.43 282.61,-14.94 286.38,-12.12 282.89,-11.8 282.89,-11.8 282.89,-11.8 286.38,-12.12 283.17,-8.66 289.86,-12.43 289.86,-12.43\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 7->6 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M289.86,-23.57C278.84,-24.84 264.04,-25.09 251.56,-24.3\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"244.53,-23.72 251.77,-21.16 248.02,-24.01 251.51,-24.3 251.51,-24.3 251.51,-24.3 248.02,-24.01 251.25,-27.44 244.53,-23.72 244.53,-23.72\"/>\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\">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.88,-25.03C333.28,-29.2 345.33,-34.53 355.67,-39.11\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"362.18,-41.99 354.5,-42.04 358.78,-41.03 355.58,-39.62 355.78,-39.16 355.98,-38.7 359.18,-40.12 357.05,-36.28 362.18,-41.99 362.18,-41.99\"/>\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.37,-53.77C407.17,-56.91 421.54,-61.1 433.79,-64.66\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"440.72,-66.68 433.12,-67.75 437.22,-66.18 433.86,-65.2 434,-64.72 434.14,-64.24 437.5,-65.22 434.88,-61.7 440.72,-66.68 440.72,-66.68\"/>\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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"567pt\" height=\"353pt\"\n",
|
|
" viewBox=\"0.00 0.00 566.58 353.20\" 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 349.2)\">\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-349.2 562.58,-349.2 562.58,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"133.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"156.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"<text text-anchor=\"start\" x=\"172.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) & (Inf(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"218.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"<text text-anchor=\"start\" x=\"234.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) | (Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"276.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff7f00\">❷</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) & (Inf(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"338.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"<text text-anchor=\"start\" x=\"354.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) | Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"392.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"<text text-anchor=\"start\" x=\"408.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">))))</text>\n",
|
|
"<text text-anchor=\"start\" x=\"223.79\" y=\"-317\" font-family=\"Lato\" font-size=\"14.00\">[parity max odd 5]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-167.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-163.5\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->4 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15,-167.2C2.79,-167.2 17.15,-167.2 30.63,-167.2\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.94,-167.2 30.94,-170.35 34.44,-167.2 30.94,-167.2 30.94,-167.2 30.94,-167.2 34.44,-167.2 30.94,-164.05 37.94,-167.2 37.94,-167.2\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 10 -->\n",
|
|
"<g id=\"node12\" class=\"node\">\n",
|
|
"<title>10</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"156.33,-159.2 126.17,-141.2 156.33,-123.2 186.5,-141.2 156.33,-159.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"156.33\" y=\"-137.5\" font-family=\"Lato\" font-size=\"14.00\">10</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->10 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>4->10</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M69.9,-155.12C76.09,-150.11 83.91,-144.86 92,-142.2 102.1,-138.88 113.6,-137.92 124.01,-138.02\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"131.01,-138.24 123.92,-141.17 127.51,-138.13 124.01,-138.02 124.01,-138.02 124.01,-138.02 127.51,-138.13 124.11,-134.87 131.01,-138.24 131.01,-138.24\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94.5\" y=\"-161\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-146\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11 -->\n",
|
|
"<g id=\"node13\" class=\"node\">\n",
|
|
"<title>11</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"156.33,-213.2 126.17,-195.2 156.33,-177.2 186.5,-195.2 156.33,-213.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"156.33\" y=\"-191.5\" font-family=\"Lato\" font-size=\"14.00\">11</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->11 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->11</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M73.68,-171.95C88.64,-176.21 110.86,-182.54 128.35,-187.52\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"135.51,-189.56 127.92,-190.67 132.15,-188.6 128.78,-187.64 128.78,-187.64 128.78,-187.64 132.15,-188.6 129.64,-184.61 135.51,-189.56 135.51,-189.56\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"96.5\" y=\"-200\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-185\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"256.66\" cy=\"-86.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"256.66\" y=\"-82.5\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"349.64,-141.2 326.69,-123.2 349.64,-105.2 372.6,-123.2 349.64,-141.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-119.5\" font-family=\"Lato\" font-size=\"14.00\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->5 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M274.79,-83.62C284.97,-82.78 297.96,-82.97 308.66,-87.2 318.91,-91.25 328.2,-99.21 335.24,-106.62\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"340.16,-112.1 333.14,-109 337.83,-109.5 335.49,-106.89 335.49,-106.89 335.49,-106.89 337.83,-109.5 337.83,-104.79 340.16,-112.1 340.16,-112.1\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"295.16\" y=\"-106\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-91\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"349.64,-71.2 326.69,-53.2 349.64,-35.2 372.6,-53.2 349.64,-71.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-49.5\" font-family=\"Lato\" font-size=\"14.00\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->6 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M263.84,-69.53C269.36,-57.32 278.74,-41.62 292.66,-34.2 305.05,-27.61 320.17,-33.47 331.57,-40.37\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"337.48,-44.24 329.9,-43.04 334.55,-42.32 331.62,-40.41 331.62,-40.41 331.62,-40.41 334.55,-42.32 333.35,-37.77 337.48,-44.24 337.48,-44.24\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"297.16\" y=\"-53\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-38\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->0 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>5->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M327.39,-123.94C316.58,-123.58 303.48,-121.98 292.66,-117.2 285.87,-114.2 279.46,-109.39 274.03,-104.44\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"268.95,-99.5 276.16,-102.12 271.46,-101.94 273.97,-104.38 273.97,-104.38 273.97,-104.38 271.46,-101.94 271.78,-106.64 268.95,-99.5 268.95,-99.5\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.16\" y=\"-141\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-126\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"442.62\" cy=\"-80.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"442.62\" y=\"-76.5\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->1 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M360.03,-63.46C367.5,-70.81 378.66,-80.11 390.62,-84.2 399.29,-87.17 409.25,-87.1 418.05,-85.95\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"425.12,-84.78 418.73,-89.03 421.67,-85.35 418.22,-85.92 418.22,-85.92 418.22,-85.92 421.67,-85.35 417.7,-82.82 425.12,-84.78 425.12,-84.78\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"394.12\" y=\"-106\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-91\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->6 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M429.13,-67.92C422.9,-62.64 414.93,-57.03 406.62,-54.2 397.16,-50.98 386.28,-50.18 376.63,-50.39\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"369.54,-50.71 376.39,-47.24 373.04,-50.55 376.53,-50.39 376.53,-50.39 376.53,-50.39 373.04,-50.55 376.68,-53.54 369.54,-50.71 369.54,-50.71\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"395.12\" y=\"-73\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-58\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"535.6,-38.2 512.64,-20.2 535.6,-2.2 558.56,-20.2 535.6,-38.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"535.6\" y=\"-16.5\" font-family=\"Lato\" font-size=\"14.00\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->7 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M458.24,-70.56C474.17,-60.06 499.65,-43.25 516.75,-31.98\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"522.63,-28.09 518.52,-34.58 519.71,-30.02 516.79,-31.95 516.79,-31.95 516.79,-31.95 519.71,-30.02 515.06,-29.32 522.63,-28.09 522.63,-28.09\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"481.12\" y=\"-75\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-60\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->0 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M518.26,-15.49C476.71,-4.55 365.2,18.28 292.66,-28.2 280.22,-36.18 271.55,-50.31 265.96,-62.63\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"263.16,-69.23 262.99,-61.56 264.53,-66.01 265.89,-62.78 265.89,-62.78 265.89,-62.78 264.53,-66.01 268.79,-64.01 263.16,-69.23 263.16,-69.23\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"394.12\" y=\"-20\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-5\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"442.62\" cy=\"-271.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"442.62\" y=\"-267.5\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"535.6,-288.2 512.64,-270.2 535.6,-252.2 558.56,-270.2 535.6,-288.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"535.6\" y=\"-266.5\" font-family=\"Lato\" font-size=\"14.00\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M460.68,-273.55C466.37,-274.22 472.76,-274.87 478.62,-275.2 485.72,-275.61 487.52,-275.64 494.62,-275.2 499.2,-274.92 504.06,-274.45 508.76,-273.91\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"515.93,-273.03 509.37,-277.01 512.46,-273.45 508.99,-273.88 508.99,-273.88 508.99,-273.88 512.46,-273.45 508.6,-270.76 515.93,-273.03 515.93,-273.03\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"482.12\" y=\"-294\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-279\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->2 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>8->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M525.42,-260.02C514.59,-249.31 495.87,-234.82 478.62,-241.2 471.75,-243.74 465.32,-248.3 459.9,-253.11\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"454.82,-257.93 457.73,-250.83 457.36,-255.52 459.9,-253.11 459.9,-253.11 459.9,-253.11 457.36,-255.52 462.07,-255.39 454.82,-257.93 454.82,-257.93\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"482.12\" y=\"-260\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-245\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"256.66\" cy=\"-241.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"256.66\" y=\"-237.5\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g id=\"node11\" class=\"node\">\n",
|
|
"<title>9</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"black\" points=\"349.64,-289.2 326.69,-271.2 349.64,-253.2 372.6,-271.2 349.64,-289.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-267.5\" font-family=\"Lato\" font-size=\"14.00\">9</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>3->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M267.54,-255.55C273.75,-263.24 282.5,-271.99 292.66,-276.2 303.06,-280.51 315.46,-279.92 325.94,-277.97\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"332.84,-276.45 326.69,-281.03 329.42,-277.2 326.01,-277.96 326.01,-277.96 326.01,-277.96 329.42,-277.2 325.33,-274.88 332.84,-276.45 332.84,-276.45\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.16\" y=\"-298\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-283\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->2 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>9->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M372.67,-271.2C386.07,-271.2 403.21,-271.2 417.05,-271.2\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"424.35,-271.2 417.35,-274.35 420.85,-271.2 417.35,-271.2 417.35,-271.2 417.35,-271.2 420.85,-271.2 417.35,-268.05 424.35,-271.2 424.35,-271.2\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"392.62\" y=\"-290\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-275\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->3 -->\n",
|
|
"<g id=\"edge15\" class=\"edge\">\n",
|
|
"<title>9->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M338.79,-261.38C331.25,-254.57 320.21,-246.07 308.66,-242.2 300.14,-239.34 290.35,-238.59 281.64,-238.73\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"274.63,-239.03 281.49,-235.59 278.13,-238.88 281.63,-238.73 281.63,-238.73 281.63,-238.73 278.13,-238.88 281.76,-241.88 274.63,-239.03 274.63,-239.03\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.66\" y=\"-261\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-246\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->0 -->\n",
|
|
"<g id=\"edge16\" class=\"edge\">\n",
|
|
"<title>10->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M165.88,-128.7C174.34,-117.42 188.34,-101.38 204.66,-93.2 212.78,-89.14 222.48,-87.2 231.24,-86.33\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"238.31,-85.84 231.55,-89.47 234.82,-86.08 231.33,-86.33 231.33,-86.33 231.33,-86.33 234.82,-86.08 231.11,-83.18 238.31,-85.84 238.31,-85.84\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"206.66\" y=\"-112\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-97\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->3 -->\n",
|
|
"<g id=\"edge17\" class=\"edge\">\n",
|
|
"<title>10->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M173.02,-149.34C186.74,-157.01 206.62,-169.5 220.66,-184.2 230.32,-194.31 238.63,-207.52 244.73,-218.67\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"248.06,-224.96 242,-220.25 246.42,-221.87 244.79,-218.77 244.79,-218.77 244.79,-218.77 246.42,-221.87 247.57,-217.3 248.06,-224.96 248.06,-224.96\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"208.66\" y=\"-203\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-188\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11->1 -->\n",
|
|
"<g id=\"edge18\" class=\"edge\">\n",
|
|
"<title>11->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M184.56,-193.82C226.83,-190.75 309.89,-180.98 372.62,-150.2 395.54,-138.96 415.24,-116.94 427.66,-100.59\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"431.89,-94.85 430.27,-102.36 429.81,-97.67 427.73,-100.49 427.73,-100.49 427.73,-100.49 429.81,-97.67 425.2,-98.61 431.89,-94.85 431.89,-94.85\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"294.66\" y=\"-196\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-181\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11->3 -->\n",
|
|
"<g id=\"edge19\" class=\"edge\">\n",
|
|
"<title>11->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M174.01,-203.01C190.27,-210.61 215.09,-222.22 233.1,-230.65\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"239.88,-233.82 232.2,-233.71 236.71,-232.34 233.54,-230.85 233.54,-230.85 233.54,-230.85 236.71,-232.34 234.87,-228 239.88,-233.82 239.88,-233.82\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"208.66\" y=\"-242\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-227\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</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 0x7f5c143ec630> >"
|
|
]
|
|
},
|
|
"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: 12\n",
|
|
"Start: 4\n",
|
|
"AP: 2 \"b\" \"a\"\n",
|
|
"acc-name: parity max odd 5\n",
|
|
"Acceptance: 5 Fin(4) & (Inf(3) | (Fin(2) & (Inf(1) | Fin(0))))\n",
|
|
"properties: trans-labels explicit-labels trans-acc colored complete\n",
|
|
"properties: deterministic\n",
|
|
"spot-state-player: 0 0 0 0 0 1 1 1 1 1 1 1\n",
|
|
"controllable-AP: 0\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[!1] 5 {1}\n",
|
|
"[1] 6 {1}\n",
|
|
"State: 1\n",
|
|
"[1] 6 {1}\n",
|
|
"[!1] 7 {1}\n",
|
|
"State: 2\n",
|
|
"[t] 8 {1}\n",
|
|
"State: 3\n",
|
|
"[t] 9 {1}\n",
|
|
"State: 4\n",
|
|
"[!1] 10 {1}\n",
|
|
"[1] 11 {1}\n",
|
|
"State: 5\n",
|
|
"[t] 0 {3}\n",
|
|
"State: 6\n",
|
|
"[t] 1 {4}\n",
|
|
"State: 7\n",
|
|
"[t] 0 {4}\n",
|
|
"State: 8\n",
|
|
"[t] 2 {3}\n",
|
|
"State: 9\n",
|
|
"[!0] 2 {3}\n",
|
|
"[0] 3 {4}\n",
|
|
"State: 10\n",
|
|
"[!0] 0 {3}\n",
|
|
"[0] 3 {3}\n",
|
|
"State: 11\n",
|
|
"[!0] 1 {3}\n",
|
|
"[0] 3 {3}\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.43.0 (0)\n",
|
|
" -->\n",
|
|
"<!-- Pages: 1 -->\n",
|
|
"<svg width=\"567pt\" height=\"353pt\"\n",
|
|
" viewBox=\"0.00 0.00 566.58 353.20\" 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 349.2)\">\n",
|
|
"<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-349.2 562.58,-349.2 562.58,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"133.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"156.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"<text text-anchor=\"start\" x=\"172.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) & (Inf(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"218.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"<text text-anchor=\"start\" x=\"234.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) | (Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"276.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff7f00\">❷</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) & (Inf(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"338.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"<text text-anchor=\"start\" x=\"354.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">) | Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"392.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
|
|
"<text text-anchor=\"start\" x=\"408.79\" y=\"-331\" font-family=\"Lato\" font-size=\"14.00\">))))</text>\n",
|
|
"<text text-anchor=\"start\" x=\"223.79\" y=\"-317\" font-family=\"Lato\" font-size=\"14.00\">[parity max odd 5]</text>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 4 -->\n",
|
|
"<g id=\"node2\" class=\"node\">\n",
|
|
"<title>4</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"56\" cy=\"-167.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-163.5\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->4 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\">\n",
|
|
"<title>I->4</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15,-167.2C2.79,-167.2 17.15,-167.2 30.63,-167.2\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.94,-167.2 30.94,-170.35 34.44,-167.2 30.94,-167.2 30.94,-167.2 30.94,-167.2 34.44,-167.2 30.94,-164.05 37.94,-167.2 37.94,-167.2\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 10 -->\n",
|
|
"<g id=\"node12\" class=\"node\">\n",
|
|
"<title>10</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"156.33,-159.2 126.17,-141.2 156.33,-123.2 186.5,-141.2 156.33,-159.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"156.33\" y=\"-137.5\" font-family=\"Lato\" font-size=\"14.00\">10</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->10 -->\n",
|
|
"<g id=\"edge8\" class=\"edge\">\n",
|
|
"<title>4->10</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M69.9,-155.12C76.09,-150.11 83.91,-144.86 92,-142.2 102.1,-138.88 113.6,-137.92 124.01,-138.02\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"131.01,-138.24 123.92,-141.17 127.51,-138.13 124.01,-138.02 124.01,-138.02 124.01,-138.02 127.51,-138.13 124.11,-134.87 131.01,-138.24 131.01,-138.24\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94.5\" y=\"-161\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-146\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11 -->\n",
|
|
"<g id=\"node13\" class=\"node\">\n",
|
|
"<title>11</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"156.33,-213.2 126.17,-195.2 156.33,-177.2 186.5,-195.2 156.33,-213.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"156.33\" y=\"-191.5\" font-family=\"Lato\" font-size=\"14.00\">11</text>\n",
|
|
"</g>\n",
|
|
"<!-- 4->11 -->\n",
|
|
"<g id=\"edge9\" class=\"edge\">\n",
|
|
"<title>4->11</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M73.68,-171.95C88.64,-176.21 110.86,-182.54 128.35,-187.52\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"135.51,-189.56 127.92,-190.67 132.15,-188.6 128.78,-187.64 128.78,-187.64 128.78,-187.64 132.15,-188.6 129.64,-184.61 135.51,-189.56 135.51,-189.56\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"96.5\" y=\"-200\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-185\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node3\" class=\"node\">\n",
|
|
"<title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"256.66\" cy=\"-86.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"256.66\" y=\"-82.5\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5 -->\n",
|
|
"<g id=\"node4\" class=\"node\">\n",
|
|
"<title>5</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"349.64,-141.2 326.69,-123.2 349.64,-105.2 372.6,-123.2 349.64,-141.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-119.5\" font-family=\"Lato\" font-size=\"14.00\">5</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->5 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\">\n",
|
|
"<title>0->5</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M274.79,-83.62C284.97,-82.78 297.96,-82.97 308.66,-87.2 318.91,-91.25 328.2,-99.21 335.24,-106.62\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"340.16,-112.1 333.14,-109 337.83,-109.5 335.49,-106.89 335.49,-106.89 335.49,-106.89 337.83,-109.5 337.83,-104.79 340.16,-112.1 340.16,-112.1\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"295.16\" y=\"-106\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-91\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6 -->\n",
|
|
"<g id=\"node5\" class=\"node\">\n",
|
|
"<title>6</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"349.64,-71.2 326.69,-53.2 349.64,-35.2 372.6,-53.2 349.64,-71.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-49.5\" font-family=\"Lato\" font-size=\"14.00\">6</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->6 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\">\n",
|
|
"<title>0->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M263.84,-69.53C269.36,-57.32 278.74,-41.62 292.66,-34.2 305.05,-27.61 320.17,-33.47 331.57,-40.37\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"337.48,-44.24 329.9,-43.04 334.28,-42.74 331.35,-40.83 331.62,-40.41 331.9,-39.99 334.82,-41.9 333.35,-37.77 337.48,-44.24 337.48,-44.24\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"297.16\" y=\"-53\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-38\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 5->0 -->\n",
|
|
"<g id=\"edge10\" class=\"edge\">\n",
|
|
"<title>5->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M327.39,-123.94C316.58,-123.58 303.48,-121.98 292.66,-117.2 285.87,-114.2 279.46,-109.39 274.03,-104.44\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"268.95,-99.5 276.16,-102.12 271.46,-101.94 273.97,-104.38 273.97,-104.38 273.97,-104.38 271.46,-101.94 271.78,-106.64 268.95,-99.5 268.95,-99.5\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.16\" y=\"-141\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-126\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node6\" class=\"node\">\n",
|
|
"<title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" cx=\"442.62\" cy=\"-80.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"442.62\" y=\"-76.5\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 6->1 -->\n",
|
|
"<g id=\"edge11\" class=\"edge\">\n",
|
|
"<title>6->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M360.03,-63.46C367.5,-70.81 378.66,-80.11 390.62,-84.2 399.29,-87.17 409.25,-87.1 418.05,-85.95\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"425.12,-84.78 418.73,-89.03 421.67,-85.35 418.22,-85.92 418.22,-85.92 418.22,-85.92 421.67,-85.35 417.7,-82.82 425.12,-84.78 425.12,-84.78\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"394.12\" y=\"-106\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-91\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->6 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\">\n",
|
|
"<title>1->6</title>\n",
|
|
"<path fill=\"none\" stroke=\"#e31a1c\" stroke-width=\"2\" d=\"M429.13,-67.92C422.9,-62.64 414.93,-57.03 406.62,-54.2 397.16,-50.98 386.28,-50.18 376.63,-50.39\"/>\n",
|
|
"<polygon fill=\"#e31a1c\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"369.54,-50.71 376.39,-47.24 373.02,-50.05 376.51,-49.89 376.53,-50.39 376.56,-50.89 373.06,-51.05 376.68,-53.54 369.54,-50.71 369.54,-50.71\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"395.12\" y=\"-73\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-58\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7 -->\n",
|
|
"<g id=\"node7\" class=\"node\">\n",
|
|
"<title>7</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#e31a1c\" stroke-width=\"2\" points=\"535.6,-38.2 512.64,-20.2 535.6,-2.2 558.56,-20.2 535.6,-38.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"535.6\" y=\"-16.5\" font-family=\"Lato\" font-size=\"14.00\">7</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->7 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\">\n",
|
|
"<title>1->7</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M458.24,-70.56C474.17,-60.06 499.65,-43.25 516.75,-31.98\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"522.63,-28.09 518.52,-34.58 519.71,-30.02 516.79,-31.95 516.79,-31.95 516.79,-31.95 519.71,-30.02 515.06,-29.32 522.63,-28.09 522.63,-28.09\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"481.12\" y=\"-75\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-60\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 7->0 -->\n",
|
|
"<g id=\"edge12\" class=\"edge\">\n",
|
|
"<title>7->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M518.26,-15.49C476.71,-4.55 365.2,18.28 292.66,-28.2 280.22,-36.18 271.55,-50.31 265.96,-62.63\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"263.16,-69.23 262.99,-61.56 264.53,-66.01 265.89,-62.78 265.89,-62.78 265.89,-62.78 264.53,-66.01 268.79,-64.01 263.16,-69.23 263.16,-69.23\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"394.12\" y=\"-20\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-5\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2 -->\n",
|
|
"<g id=\"node8\" class=\"node\">\n",
|
|
"<title>2</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"442.62\" cy=\"-271.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"442.62\" y=\"-267.5\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8 -->\n",
|
|
"<g id=\"node9\" class=\"node\">\n",
|
|
"<title>8</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"535.6,-288.2 512.64,-270.2 535.6,-252.2 558.56,-270.2 535.6,-288.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"535.6\" y=\"-266.5\" font-family=\"Lato\" font-size=\"14.00\">8</text>\n",
|
|
"</g>\n",
|
|
"<!-- 2->8 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\">\n",
|
|
"<title>2->8</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M460.68,-273.55C466.37,-274.22 472.76,-274.87 478.62,-275.2 485.72,-275.61 487.52,-275.64 494.62,-275.2 499.2,-274.92 504.06,-274.45 508.76,-273.91\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"515.93,-273.03 509.37,-277.01 512.46,-273.45 508.99,-273.88 508.99,-273.88 508.99,-273.88 512.46,-273.45 508.6,-270.76 515.93,-273.03 515.93,-273.03\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"482.12\" y=\"-294\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-279\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 8->2 -->\n",
|
|
"<g id=\"edge13\" class=\"edge\">\n",
|
|
"<title>8->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M525.42,-260.02C514.59,-249.31 495.87,-234.82 478.62,-241.2 471.75,-243.74 465.32,-248.3 459.9,-253.11\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"454.82,-257.93 457.73,-250.83 457.02,-255.16 459.55,-252.75 459.9,-253.11 460.24,-253.47 457.71,-255.88 462.07,-255.39 454.82,-257.93 454.82,-257.93\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"482.12\" y=\"-260\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"478.62\" y=\"-245\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3 -->\n",
|
|
"<g id=\"node10\" class=\"node\">\n",
|
|
"<title>3</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" cx=\"256.66\" cy=\"-241.2\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"256.66\" y=\"-237.5\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9 -->\n",
|
|
"<g id=\"node11\" class=\"node\">\n",
|
|
"<title>9</title>\n",
|
|
"<polygon fill=\"#ffffaa\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"349.64,-289.2 326.69,-271.2 349.64,-253.2 372.6,-271.2 349.64,-289.2\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"349.64\" y=\"-267.5\" font-family=\"Lato\" font-size=\"14.00\">9</text>\n",
|
|
"</g>\n",
|
|
"<!-- 3->9 -->\n",
|
|
"<g id=\"edge7\" class=\"edge\">\n",
|
|
"<title>3->9</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M267.54,-255.55C273.75,-263.24 282.5,-271.99 292.66,-276.2 303.06,-280.51 315.46,-279.92 325.94,-277.97\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"332.84,-276.45 326.69,-281.03 329.42,-277.2 326.01,-277.96 326.01,-277.96 326.01,-277.96 329.42,-277.2 325.33,-274.88 332.84,-276.45 332.84,-276.45\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.16\" y=\"-298\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-283\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->2 -->\n",
|
|
"<g id=\"edge14\" class=\"edge\">\n",
|
|
"<title>9->2</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M372.67,-271.2C386.07,-271.2 403.21,-271.2 417.05,-271.2\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"424.35,-271.2 417.35,-274.35 420.85,-271.7 417.35,-271.7 417.35,-271.2 417.35,-270.7 420.85,-270.7 417.35,-268.05 424.35,-271.2 424.35,-271.2\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"392.62\" y=\"-290\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"390.62\" y=\"-275\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 9->3 -->\n",
|
|
"<g id=\"edge15\" class=\"edge\">\n",
|
|
"<title>9->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M338.79,-261.38C331.25,-254.57 320.21,-246.07 308.66,-242.2 300.14,-239.34 290.35,-238.59 281.64,-238.73\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"274.63,-239.03 281.49,-235.59 278.13,-238.88 281.63,-238.73 281.63,-238.73 281.63,-238.73 278.13,-238.88 281.76,-241.88 274.63,-239.03 274.63,-239.03\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"296.66\" y=\"-261\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-246\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#33a02c\">❹</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->0 -->\n",
|
|
"<g id=\"edge16\" class=\"edge\">\n",
|
|
"<title>10->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M165.88,-128.7C174.34,-117.42 188.34,-101.38 204.66,-93.2 212.78,-89.14 222.48,-87.2 231.24,-86.33\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"238.31,-85.84 231.55,-89.47 234.82,-86.08 231.33,-86.33 231.33,-86.33 231.33,-86.33 234.82,-86.08 231.11,-83.18 238.31,-85.84 238.31,-85.84\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"206.66\" y=\"-112\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-97\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 10->3 -->\n",
|
|
"<g id=\"edge17\" class=\"edge\">\n",
|
|
"<title>10->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M173.02,-149.34C186.74,-157.01 206.62,-169.5 220.66,-184.2 230.32,-194.31 238.63,-207.52 244.73,-218.67\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"248.06,-224.96 242,-220.25 245.98,-222.1 244.35,-219.01 244.79,-218.77 245.23,-218.54 246.87,-221.63 247.57,-217.3 248.06,-224.96 248.06,-224.96\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"208.66\" y=\"-203\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-188\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11->1 -->\n",
|
|
"<g id=\"edge18\" class=\"edge\">\n",
|
|
"<title>11->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M184.56,-193.82C226.83,-190.75 309.89,-180.98 372.62,-150.2 395.54,-138.96 415.24,-116.94 427.66,-100.59\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"431.89,-94.85 430.27,-102.36 429.81,-97.67 427.73,-100.49 427.73,-100.49 427.73,-100.49 429.81,-97.67 425.2,-98.61 431.89,-94.85 431.89,-94.85\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"294.66\" y=\"-196\" font-family=\"Lato\" font-size=\"14.00\">!b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"292.66\" y=\"-181\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</text>\n",
|
|
"</g>\n",
|
|
"<!-- 11->3 -->\n",
|
|
"<g id=\"edge19\" class=\"edge\">\n",
|
|
"<title>11->3</title>\n",
|
|
"<path fill=\"none\" stroke=\"#33a02c\" stroke-width=\"2\" d=\"M174.01,-203.01C190.27,-210.61 215.09,-222.22 233.1,-230.65\"/>\n",
|
|
"<polygon fill=\"#33a02c\" stroke=\"#33a02c\" stroke-width=\"2\" points=\"239.88,-233.82 232.2,-233.71 236.5,-232.79 233.33,-231.31 233.54,-230.85 233.75,-230.4 236.92,-231.88 234.87,-228 239.88,-233.82 239.88,-233.82\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"208.66\" y=\"-242\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"204.66\" y=\"-227\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#6a3d9a\">❸</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 0x7f5c143fdf30> >"
|
|
]
|
|
},
|
|
"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
|
|
}
|