and call it after parsing * spot/twa/twagraph.cc, spot/twa/twagraph.hh (twa_graph::merge_univ_dests): New method. * spot/parseaut/parseaut.yy: Call it. * spot/twaalgos/dot.cc: Improve output, now that several edges can use the same universal destination. * tests/core/alternating.test, tests/core/complete.test, tests/core/parseaut.test, tests/python/_altscc.ipynb, tests/python/alternating.py, tests/python/alternation.ipynb: Adjust test case. * doc/org/tut24.org: Adjust example.
582 lines
32 KiB
Text
582 lines
32 KiB
Text
{
|
|
"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.5.2+"
|
|
},
|
|
"name": ""
|
|
},
|
|
"nbformat": 3,
|
|
"nbformat_minor": 0,
|
|
"worksheets": [
|
|
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"These examples are tests for scc_info on alternating automata."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": true,
|
|
"input": [
|
|
"import spot\n",
|
|
"spot.setup(show_default='.bas')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"prompt_number": 1
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": false,
|
|
"input": [
|
|
"spot.automaton('''\n",
|
|
"HOA: v1\n",
|
|
"States: 2\n",
|
|
"Start: 0&1\n",
|
|
"AP: 2 \"a\" \"b\"\n",
|
|
"acc-name: Buchi\n",
|
|
"Acceptance: 1 Inf(0)\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[0] 0\n",
|
|
"[!0] 1\n",
|
|
"State: 1\n",
|
|
"[1] 1 {0}\n",
|
|
"--END--\n",
|
|
"''')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"metadata": {},
|
|
"output_type": "pyout",
|
|
"prompt_number": 2,
|
|
"svg": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"222pt\" height=\"154pt\"\n",
|
|
" viewBox=\"0.00 0.00 221.60 154.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 1) rotate(0) translate(4 150)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-150 217.6,-150 217.6,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"85.8\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\">Inf(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"107.8\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"<text text-anchor=\"start\" x=\"123.8\" y=\"-131.8\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
|
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"green\" points=\"153.6,-8 153.6,-108 205.6,-108 205.6,-8 153.6,-8\"/>\n",
|
|
"</g>\n",
|
|
"<g id=\"clust2\" class=\"cluster\"><title>cluster_1</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"red\" points=\"70.6,-30 70.6,-115 122.6,-115 122.6,-30 70.6,-30\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- -1 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>-1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"39.8\" cy=\"-27\" rx=\"1.8\" ry=\"1.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I->-1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.10844,-27C2.6468,-27 20.196,-27 30.7973,-27\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"30.9213,-29.4501 37.9213,-27 30.9212,-24.5501 30.9213,-29.4501\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"96.6\" cy=\"-56\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"96.6\" y=\"-52.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>-1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M41.7512,-27.5033C45.6352,-29.5588 60.7141,-37.5385 73.9308,-44.5327\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"80.2121,-47.8568 72.5516,-47.3667 77.1186,-46.2197 74.025,-44.5826 74.025,-44.5826 74.025,-44.5826 77.1186,-46.2197 75.4985,-41.7984 80.2121,-47.8568 80.2121,-47.8568\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"179.6\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"179.6\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>-1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M41.9364,-26.9481C45.8913,-26.7705 59.4203,-26.1875 70.6,-26 93.7079,-25.6124 99.547,-24.3617 122.6,-26 133.061,-26.7434 144.538,-28.2585 154.363,-29.7722\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"161.511,-30.9167 154.101,-32.9203 158.055,-30.3633 154.599,-29.8099 154.599,-29.8099 154.599,-29.8099 158.055,-30.3633 155.097,-26.6995 161.511,-30.9167 161.511,-30.9167\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M90.2208,-73.0373C88.9189,-82.8579 91.0453,-92 96.6,-92 100.766,-92 103.004,-86.8576 103.313,-80.1433\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"102.979,-73.0373 106.454,-79.8818 103.143,-76.5335 103.308,-80.0296 103.308,-80.0296 103.308,-80.0296 103.143,-76.5335 100.161,-80.1774 102.979,-73.0373 102.979,-73.0373\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"93.1\" y=\"-95.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\"><title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M114.383,-51.4416C126.191,-48.2346 142.151,-43.8996 155.206,-40.3538\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"162.115,-38.4773 156.186,-43.352 158.738,-39.3947 155.36,-40.3121 155.36,-40.3121 155.36,-40.3121 158.738,-39.3947 154.534,-37.2723 162.115,-38.4773 162.115,-38.4773\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"132.6\" y=\"-50.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\"><title>1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M172.569,-50.6641C171.006,-60.625 173.35,-70 179.6,-70 184.288,-70 186.778,-64.7266 187.071,-57.8876\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"186.631,-50.6641 190.201,-57.4598 186.844,-54.1576 187.056,-57.6511 187.056,-57.6511 187.056,-57.6511 186.844,-54.1576 183.912,-57.8425 186.631,-50.6641 186.631,-50.6641\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"175.1\" y=\"-88.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"171.6\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7620378330> >"
|
|
]
|
|
}
|
|
],
|
|
"prompt_number": 2
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"universal edges are handled as if they were many distinct existencial edges from the point of view of `scc_info`, so the acceptance / rejection status is not always meaningful."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": false,
|
|
"input": [
|
|
"spot.automaton('''\n",
|
|
"HOA: v1\n",
|
|
"States: 2\n",
|
|
"Start: 0&1\n",
|
|
"AP: 2 \"a\" \"b\"\n",
|
|
"Acceptance: 1 Fin(0)\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[0] 0&1 {0}\n",
|
|
"State: 1\n",
|
|
"[1] 1\n",
|
|
"--END--\n",
|
|
"''')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"metadata": {},
|
|
"output_type": "pyout",
|
|
"prompt_number": 3,
|
|
"svg": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"154pt\" height=\"192pt\"\n",
|
|
" viewBox=\"0.00 0.00 153.60 192.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 1) rotate(0) translate(4 188)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-188 149.6,-188 149.6,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"50.3\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"75.3\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"<text text-anchor=\"start\" x=\"91.3\" y=\"-169.8\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
|
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"green\" points=\"85.6,-8 85.6,-93 137.6,-93 137.6,-8 85.6,-8\"/>\n",
|
|
"</g>\n",
|
|
"<g id=\"clust2\" class=\"cluster\"><title>cluster_1</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"red\" points=\"85.6,-101 85.6,-153 137.6,-153 137.6,-101 85.6,-101\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- -1 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>-1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"39.8\" cy=\"-82\" rx=\"1.8\" ry=\"1.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I->-1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.10844,-82C2.6468,-82 20.196,-82 30.7973,-82\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"30.9213,-84.4501 37.9213,-82 30.9212,-79.5501 30.9213,-84.4501\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"111.6\" cy=\"-127\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"111.6\" y=\"-123.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>-1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M41.2389,-83.4339C42.8255,-88.3703 48.7502,-104.807 59.6,-113 67.3475,-118.85 77.3952,-122.256 86.5214,-124.239\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"93.5814,-125.543 86.1255,-127.369 90.1396,-124.907 86.6979,-124.272 86.6979,-124.272 86.6979,-124.272 90.1396,-124.907 87.2703,-121.174 93.5814,-125.543 93.5814,-125.543\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"111.6\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"111.6\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>-1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M41.5839,-81.4609C46.3474,-78.1852 71.8242,-60.6653 90.4426,-47.8618\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"96.4539,-43.728 92.471,-50.2899 93.57,-45.7112 90.6861,-47.6944 90.6861,-47.6944 90.6861,-47.6944 93.57,-45.7112 88.9012,-45.0989 96.4539,-43.728 96.4539,-43.728\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->-1 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>0->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M98.8419,-113.981C94.4601,-108.857 89.5866,-102.816 85.6,-97 80.4256,-89.4515 83.4876,-83.6411 75.6,-79 67.3683,-74.1565 56.0932,-76.4083 48.6353,-78.8582\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"47.3759,-76.7198 41.7465,-81.5482 49.1582,-81.2841 47.3759,-76.7198\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"64.1\" y=\"-97.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"59.6\" y=\"-82.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->1 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\"><title>1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M103.932,-50.2903C102.083,-60.3892 104.639,-70 111.6,-70 116.821,-70 119.564,-64.5939 119.829,-57.6304\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"119.268,-50.2903 122.942,-57.0299 119.535,-53.7801 119.801,-57.2699 119.801,-57.2699 119.801,-57.2699 119.535,-53.7801 116.66,-57.5099 119.268,-50.2903 119.268,-50.2903\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"107.1\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7620378870> >"
|
|
]
|
|
}
|
|
],
|
|
"prompt_number": 3
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": false,
|
|
"input": [
|
|
"spot.automaton('''\n",
|
|
"HOA: v1\n",
|
|
"States: 2\n",
|
|
"Start: 0&1\n",
|
|
"AP: 2 \"a\" \"b\"\n",
|
|
"Acceptance: 1 Fin(0)\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[0] 0 {0}\n",
|
|
"[!0] 1\n",
|
|
"State: 1\n",
|
|
"[1] 1&0\n",
|
|
"--END--\n",
|
|
"''')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"metadata": {},
|
|
"output_type": "pyout",
|
|
"prompt_number": 4,
|
|
"svg": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"181pt\" height=\"170pt\"\n",
|
|
" viewBox=\"0.00 0.00 181.00 169.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 165.8)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-165.8 177,-165.8 177,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"64\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"89\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"<text text-anchor=\"start\" x=\"105\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
|
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"green\" points=\"30,-8 30,-108 165,-108 165,-8 30,-8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- -1 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>-1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-137\" rx=\"1.8\" ry=\"1.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I->-1 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-137C3.52733,-137 32.5548,-137 46.9758,-137\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"47.1189,-139.45 54.1189,-137 47.1188,-134.55 47.1189,-139.45\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>-1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M56,-135.01C56,-109.75 56,-84.4902 56,-59.2301\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"56,-52.1055 59.1501,-59.1054 56,-55.6055 56.0001,-59.1055 56.0001,-59.1055 56.0001,-59.1055 56,-55.6055 52.8501,-59.1055 56,-52.1055 56,-52.1055\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-82\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"139\" y=\"-78.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>-1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M58.1975,-136.505C63.6262,-134.235 86.3798,-124.441 103,-113 108.892,-108.944 114.875,-104.007 120.188,-99.2761\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"125.655,-94.275 122.616,-101.324 123.072,-96.6375 120.49,-99.0001 120.49,-99.0001 120.49,-99.0001 123.072,-96.6375 118.364,-96.676 125.655,-94.275 125.655,-94.275\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-51.0373C48.3189,-60.8579 50.4453,-70 56,-70 60.166,-70 62.4036,-64.8576 62.7128,-58.1433\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-51.0373 65.8541,-57.8818 62.5434,-54.5335 62.7076,-58.0296 62.7076,-58.0296 62.7076,-58.0296 62.5434,-54.5335 59.561,-58.1774 62.3792,-51.0373 62.3792,-51.0373\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"52.5\" y=\"-88.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"48\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\"><title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M72.6567,-41.0787C81.7089,-45.355 93.2089,-51.105 103,-57 108.128,-60.0874 113.476,-63.6923 118.403,-67.188\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"124.372,-71.5104 116.855,-69.9558 121.537,-69.4575 118.702,-67.4046 118.702,-67.4046 118.702,-67.4046 121.537,-69.4575 120.55,-64.8533 124.372,-71.5104 124.372,-71.5104\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-60.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1->-1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\"><title>1->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M120.788,-83.8666C111.67,-85.4769 100.608,-88.4653 92,-94 84.4423,-98.8591 69.2944,-119.499 61.6458,-130.319\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"59.6115,-128.953 57.6175,-136.096 63.6309,-131.756 59.6115,-128.953\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"93\" y=\"-97.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7620378390> >"
|
|
]
|
|
}
|
|
],
|
|
"prompt_number": 4
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": false,
|
|
"input": [
|
|
"spot.automaton('''\n",
|
|
"HOA: v1\n",
|
|
"States: 2\n",
|
|
"Start: 0\n",
|
|
"AP: 2 \"a\" \"b\"\n",
|
|
"Acceptance: 1 Fin(0)\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[0] 0\n",
|
|
"[!0] 1 {0}\n",
|
|
"State: 1\n",
|
|
"[1] 1&0\n",
|
|
"--END--\n",
|
|
"''')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"metadata": {},
|
|
"output_type": "pyout",
|
|
"prompt_number": 5,
|
|
"svg": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"186pt\" height=\"155pt\"\n",
|
|
" viewBox=\"0.00 0.00 186.00 154.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 150.8)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-150.8 182,-150.8 182,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"66.5\" y=\"-132.6\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"91.5\" y=\"-132.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"<text text-anchor=\"start\" x=\"107.5\" y=\"-132.6\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
|
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"green\" points=\"30,-30.8 30,-115.8 170,-115.8 170,-30.8 30,-30.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-56.8\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-53.1\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-56.8C2.79388,-56.8 17.1543,-56.8 30.6317,-56.8\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-56.8 30.9419,-59.9501 34.4419,-56.8 30.9419,-56.8001 30.9419,-56.8001 30.9419,-56.8001 34.4419,-56.8 30.9418,-53.6501 37.9419,-56.8 37.9419,-56.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-73.8373C48.3189,-83.6579 50.4453,-92.8 56,-92.8 60.166,-92.8 62.4036,-87.6576 62.7128,-80.9433\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-73.8373 65.8541,-80.6818 62.5434,-77.3335 62.7076,-80.8296 62.7076,-80.8296 62.7076,-80.8296 62.5434,-77.3335 59.561,-80.9774 62.3792,-73.8373 62.3792,-73.8373\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"52.5\" y=\"-96.6\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-56.8\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"144\" y=\"-53.1\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M74.4034,-56.8C87.1928,-56.8 104.732,-56.8 118.874,-56.8\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"125.916,-56.8 118.916,-59.9501 122.416,-56.8 118.916,-56.8001 118.916,-56.8001 118.916,-56.8001 122.416,-56.8 118.916,-53.6501 125.916,-56.8 125.916,-56.8\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94.5\" y=\"-75.6\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-60.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1 -->\n",
|
|
"<g id=\"node4\" class=\"node\"><title>-1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-1.8\" rx=\"1.8\" ry=\"1.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->-1 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>1->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M128.216,-47.3452C109.582,-35.428 78.2908,-15.4162 64.2282,-6.42267\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"65.183,-4.12514 57.9658,-2.41768 62.543,-8.25315 65.183,-4.12514\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"95.5\" y=\"-38.6\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->0 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\"><title>-1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M56,-3.94844C56,-13.1613 56,-22.3742 56,-31.5871\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"56,-38.6323 52.8501,-31.6322 56,-35.1323 56.0001,-31.6323 56.0001,-31.6323 56.0001,-31.6323 56,-35.1323 59.1501,-31.6323 56,-38.6323 56,-38.6323\"/>\n",
|
|
"</g>\n",
|
|
"<!-- -1->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\"><title>-1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M58.3605,-2.07433C64.5216,-3.36203 90.2737,-9.23561 108,-20.8 115.043,-25.3947 121.748,-31.6386 127.37,-37.6363\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"132.206,-43.0208 125.185,-39.9183 129.867,-40.4171 127.528,-37.8133 127.528,-37.8133 127.528,-37.8133 129.867,-40.4171 129.872,-35.7083 132.206,-43.0208 132.206,-43.0208\"/>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f76203783c0> >"
|
|
]
|
|
}
|
|
],
|
|
"prompt_number": 5
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": false,
|
|
"input": [
|
|
"spot.automaton('''\n",
|
|
"HOA: v1\n",
|
|
"States: 2\n",
|
|
"Start: 0\n",
|
|
"AP: 2 \"a\" \"b\"\n",
|
|
"Acceptance: 1 Fin(0)\n",
|
|
"--BODY--\n",
|
|
"State: 0\n",
|
|
"[0] 0 {0}\n",
|
|
"[!0] 1 \n",
|
|
"State: 1\n",
|
|
"[1] 1&0 {0}\n",
|
|
"--END--\n",
|
|
"''')"
|
|
],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"metadata": {},
|
|
"output_type": "pyout",
|
|
"prompt_number": 6,
|
|
"svg": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
|
|
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
|
|
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
|
|
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
|
|
" -->\n",
|
|
"<!-- Title: G Pages: 1 -->\n",
|
|
"<svg width=\"186pt\" height=\"170pt\"\n",
|
|
" viewBox=\"0.00 0.00 186.00 169.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
|
|
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 165.8)\">\n",
|
|
"<title>G</title>\n",
|
|
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-165.8 182,-165.8 182,4 -4,4\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"66.5\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
|
|
"<text text-anchor=\"start\" x=\"91.5\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"<text text-anchor=\"start\" x=\"107.5\" y=\"-147.6\" font-family=\"Lato\" font-size=\"14.00\">)</text>\n",
|
|
"<g id=\"clust1\" class=\"cluster\"><title>cluster_0</title>\n",
|
|
"<polygon fill=\"none\" stroke=\"orange\" points=\"30,-30.8 30,-130.8 170,-130.8 170,-30.8 30,-30.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- I -->\n",
|
|
"<!-- 0 -->\n",
|
|
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-56.8\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"56\" y=\"-53.1\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
|
|
"</g>\n",
|
|
"<!-- I->0 -->\n",
|
|
"<g id=\"edge1\" class=\"edge\"><title>I->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-56.8C2.79388,-56.8 17.1543,-56.8 30.6317,-56.8\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-56.8 30.9419,-59.9501 34.4419,-56.8 30.9419,-56.8001 30.9419,-56.8001 30.9419,-56.8001 34.4419,-56.8 30.9418,-53.6501 37.9419,-56.8 37.9419,-56.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 0->0 -->\n",
|
|
"<g id=\"edge2\" class=\"edge\"><title>0->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-73.8373C48.3189,-83.6579 50.4453,-92.8 56,-92.8 60.166,-92.8 62.4036,-87.6576 62.7128,-80.9433\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-73.8373 65.8541,-80.6818 62.5434,-77.3335 62.7076,-80.8296 62.7076,-80.8296 62.7076,-80.8296 62.5434,-77.3335 59.561,-80.9774 62.3792,-73.8373 62.3792,-73.8373\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"52.5\" y=\"-111.6\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
|
|
"<text text-anchor=\"start\" x=\"48\" y=\"-96.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"<!-- 1 -->\n",
|
|
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-56.8\" rx=\"18\" ry=\"18\"/>\n",
|
|
"<text text-anchor=\"middle\" x=\"144\" y=\"-53.1\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
|
|
"</g>\n",
|
|
"<!-- 0->1 -->\n",
|
|
"<g id=\"edge3\" class=\"edge\"><title>0->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M74.4034,-56.8C87.1928,-56.8 104.732,-56.8 118.874,-56.8\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"125.916,-56.8 118.916,-59.9501 122.416,-56.8 118.916,-56.8001 118.916,-56.8001 118.916,-56.8001 122.416,-56.8 118.916,-53.6501 125.916,-56.8 125.916,-56.8\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"94.5\" y=\"-60.6\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1 -->\n",
|
|
"<g id=\"node4\" class=\"node\"><title>-1</title>\n",
|
|
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-1.8\" rx=\"1.8\" ry=\"1.8\"/>\n",
|
|
"</g>\n",
|
|
"<!-- 1->-1 -->\n",
|
|
"<g id=\"edge4\" class=\"edge\"><title>1->-1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M131.685,-43.6003C125.268,-36.7206 116.782,-28.5634 108,-22.8 94.1305,-13.6981 75.6755,-7.29775 65.1938,-4.11103\"/>\n",
|
|
"<polygon fill=\"none\" stroke=\"black\" points=\"65.7549,-1.72327 58.3508,-2.15071 64.4054,-6.4338 65.7549,-1.72327\"/>\n",
|
|
"<text text-anchor=\"start\" x=\"95.5\" y=\"-41.6\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
|
|
"<text text-anchor=\"start\" x=\"92\" y=\"-26.6\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
|
|
"</g>\n",
|
|
"<!-- -1->0 -->\n",
|
|
"<g id=\"edge5\" class=\"edge\"><title>-1->0</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M56,-3.94844C56,-13.1613 56,-22.3742 56,-31.5871\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"56,-38.6323 52.8501,-31.6322 56,-35.1323 56.0001,-31.6323 56.0001,-31.6323 56.0001,-31.6323 56,-35.1323 59.1501,-31.6323 56,-38.6323 56,-38.6323\"/>\n",
|
|
"</g>\n",
|
|
"<!-- -1->1 -->\n",
|
|
"<g id=\"edge6\" class=\"edge\"><title>-1->1</title>\n",
|
|
"<path fill=\"none\" stroke=\"black\" d=\"M58.3854,-1.69527C64.6542,-1.28831 90.8043,-0.315741 108,-10.8 117.607,-16.6573 125.513,-26.2081 131.364,-35.0934\"/>\n",
|
|
"<polygon fill=\"black\" stroke=\"black\" points=\"135.083,-41.0848 128.715,-36.7985 133.237,-38.111 131.391,-35.1373 131.391,-35.1373 131.391,-35.1373 133.237,-38.111 134.068,-33.4761 135.083,-41.0848 135.083,-41.0848\"/>\n",
|
|
"</g>\n",
|
|
"</g>\n",
|
|
"</svg>\n"
|
|
],
|
|
"text": [
|
|
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f7620378360> >"
|
|
]
|
|
}
|
|
],
|
|
"prompt_number": 6
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"collapsed": true,
|
|
"input": [],
|
|
"language": "python",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"prompt_number": null
|
|
}
|
|
],
|
|
"metadata": {}
|
|
}
|
|
]
|
|
}
|