spot/tests/python/_altscc.ipynb
Arthur Remaud f7bbfd2812 autfilt: Better display of cluster when universal edge loops in it
Fixes #208

* NEWS: Informations about the modifications
* spot/twaalgos/dot.cc (print): Gestion of cluster for
universal transitions
* tests/core/alternating.test: tests added
* tests/core/neverclaimread.test: tests changed for
new dot format
* tests/core/readsave.test: tests changed
* tests/core/sccdot.test: tests changed
* tests/python/_altscc.ipynb: tests changed
* tests/python/decompose.ipynb: tests changed
2017-02-16 18:53:18 +01:00

594 lines
33 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.3"
},
"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",
"<!-- &#45;1 -->\n",
"<g id=\"node2\" class=\"node\"><title>&#45;1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"39.8\" cy=\"-27\" rx=\"1.8\" ry=\"1.8\"/>\n",
"</g>\n",
"<!-- I&#45;&gt;&#45;1 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;&#45;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",
"<!-- &#45;1&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>&#45;1&#45;&gt;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",
"<!-- &#45;1&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>&#45;1&#45;&gt;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&#45;&gt;0 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>0&#45;&gt;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&#45;&gt;1 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>0&#45;&gt;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&#45;&gt;1 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;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 0x7faa50350420> >"
]
}
],
"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=\"244pt\" height=\"210pt\"\n",
" viewBox=\"0.00 0.00 243.90 210.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 206)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-206 239.895,-206 239.895,4 -4,4\"/>\n",
"<text text-anchor=\"start\" x=\"95.4476\" y=\"-187.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
"<text text-anchor=\"start\" x=\"120.448\" y=\"-187.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"<text text-anchor=\"start\" x=\"136.448\" y=\"-187.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=\"70.6,-8 70.6,-93 122.6,-93 122.6,-8 70.6,-8\"/>\n",
"</g>\n",
"<g id=\"clust2\" class=\"cluster\"><title>cluster_1</title>\n",
"<polygon fill=\"none\" stroke=\"red\" points=\"70.6,-101 70.6,-171 227.895,-171 227.895,-101 70.6,-101\"/>\n",
"</g>\n",
"<!-- I -->\n",
"<!-- &#45;1 -->\n",
"<g id=\"node2\" class=\"node\"><title>&#45;1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"39.8\" cy=\"-90\" rx=\"1.8\" ry=\"1.8\"/>\n",
"</g>\n",
"<!-- I&#45;&gt;&#45;1 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;&#45;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.10844,-90C2.6468,-90 20.196,-90 30.7973,-90\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"30.9213,-92.4501 37.9213,-90 30.9212,-87.5501 30.9213,-92.4501\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"96.6\" cy=\"-130\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"96.6\" y=\"-126.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
"</g>\n",
"<!-- &#45;1&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>&#45;1&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M41.7512,-90.6943C45.7938,-93.6451 61.9639,-105.448 75.5392,-115.357\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"81.541,-119.738 74.0298,-118.155 78.714,-117.674 75.887,-115.611 75.887,-115.611 75.887,-115.611 78.714,-117.674 77.7442,-113.067 81.541,-119.738 81.541,-119.738\"/>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g id=\"node4\" class=\"node\"><title>1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"96.6\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"96.6\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- &#45;1&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>&#45;1&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M41.7512,-89.028C46.0802,-84.6041 64.3165,-65.9685 78.3809,-51.5962\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"83.3402,-46.5283 80.6957,-53.7345 80.8923,-49.0298 78.4443,-51.5314 78.4443,-51.5314 78.4443,-51.5314 80.8923,-49.0298 76.1929,-49.3282 83.3402,-46.5283 83.3402,-46.5283\"/>\n",
"</g>\n",
"<!-- &#45;1.1 -->\n",
"<g id=\"node5\" class=\"node\"><title>&#45;1.1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"193.248\" cy=\"-136\" rx=\"26.7961\" ry=\"26.7961\"/>\n",
"<text text-anchor=\"middle\" x=\"193.248\" y=\"-132.3\" font-family=\"Lato\" font-size=\"14.00\">&#45;1.1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;&#45;1.1 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>0&#45;&gt;&#45;1.1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M114.96,-131.1C127.343,-131.885 144.375,-132.965 159.3,-133.911\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"159.287,-136.365 166.428,-134.363 159.597,-131.475 159.287,-136.365\"/>\n",
"<text text-anchor=\"start\" x=\"137.1\" y=\"-151.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<text text-anchor=\"start\" x=\"132.6\" y=\"-136.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M90.2208,-51.0373C88.9189,-60.8579 91.0453,-70 96.6,-70 100.766,-70 103.004,-64.8576 103.313,-58.1433\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"102.979,-51.0373 106.454,-57.8818 103.143,-54.5335 103.308,-58.0296 103.308,-58.0296 103.308,-58.0296 103.143,-54.5335 100.161,-58.1774 102.979,-51.0373 102.979,-51.0373\"/>\n",
"<text text-anchor=\"start\" x=\"92.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 0x7faa50350810> >"
]
}
],
"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": {
"scrolled": true
},
"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=\"320pt\" height=\"147pt\"\n",
" viewBox=\"0.00 0.00 319.90 147.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 143)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-143 315.895,-143 315.895,4 -4,4\"/>\n",
"<text text-anchor=\"start\" x=\"133.448\" y=\"-124.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
"<text text-anchor=\"start\" x=\"158.448\" y=\"-124.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"<text text-anchor=\"start\" x=\"174.448\" y=\"-124.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=\"70.6,-8 70.6,-108 303.895,-108 303.895,-8 70.6,-8\"/>\n",
"</g>\n",
"<!-- I -->\n",
"<!-- &#45;1 -->\n",
"<g id=\"node2\" class=\"node\"><title>&#45;1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"39.8\" cy=\"-5\" rx=\"1.8\" ry=\"1.8\"/>\n",
"</g>\n",
"<!-- I&#45;&gt;&#45;1 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;&#45;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.10844,-5C2.6468,-5 20.196,-5 30.7973,-5\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"30.9213,-7.4501 37.9213,-5 30.9212,-2.5501 30.9213,-7.4501\"/>\n",
"</g>\n",
"<!-- 0 -->\n",
"<g id=\"node3\" class=\"node\"><title>0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"96.6\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"96.6\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
"</g>\n",
"<!-- &#45;1&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>&#45;1&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M41.7512,-5.50335C45.6352,-7.55878 60.7141,-15.5385 73.9308,-22.5327\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"80.2121,-25.8568 72.5516,-25.3667 77.1186,-24.2197 74.025,-22.5826 74.025,-22.5826 74.025,-22.5826 77.1186,-24.2197 75.4985,-19.7984 80.2121,-25.8568 80.2121,-25.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",
"<!-- &#45;1&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>&#45;1&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M41.858,-4.88357C48.5396,-4.17795 85.5371,-0.709466 114.6,-7 129.318,-10.1857 144.906,-16.6879 157.013,-22.5131\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"163.353,-25.6543 155.682,-25.3692 160.217,-24.1005 157.081,-22.5466 157.081,-22.5466 157.081,-22.5466 160.217,-24.1005 158.479,-19.7241 163.353,-25.6543 163.353,-25.6543\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M90.2208,-51.0373C88.9189,-60.8579 91.0453,-70 96.6,-70 100.766,-70 103.004,-64.8576 103.313,-58.1433\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"102.979,-51.0373 106.454,-57.8818 103.143,-54.5335 103.308,-58.0296 103.308,-58.0296 103.308,-58.0296 103.143,-54.5335 100.161,-58.1774 102.979,-51.0373 102.979,-51.0373\"/>\n",
"<text text-anchor=\"start\" x=\"93.1\" y=\"-88.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<text text-anchor=\"start\" x=\"88.6\" y=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M114.778,-34C126.269,-34 141.559,-34 154.293,-34\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"161.447,-34 154.447,-37.1501 157.947,-34 154.447,-34.0001 154.447,-34.0001 154.447,-34.0001 157.947,-34 154.447,-30.8501 161.447,-34 161.447,-34\"/>\n",
"<text text-anchor=\"start\" x=\"132.6\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- &#45;1.0 -->\n",
"<g id=\"node5\" class=\"node\"><title>&#45;1.0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"269.248\" cy=\"-43\" rx=\"26.7961\" ry=\"26.7961\"/>\n",
"<text text-anchor=\"middle\" x=\"269.248\" y=\"-39.3\" font-family=\"Lato\" font-size=\"14.00\">&#45;1.0</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;&#45;1.0 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>1&#45;&gt;&#45;1.0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M197.916,-35.7781C208.593,-36.8744 222.631,-38.3159 235.356,-39.6225\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"235.447,-42.0947 242.661,-40.3726 235.948,-37.2203 235.447,-42.0947\"/>\n",
"<text text-anchor=\"start\" x=\"215.6\" y=\"-41.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 0x7faa50350870> >"
]
}
],
"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\n",
"[!0] 1 {0}\n",
"State: 1\n",
"[1] 1&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=\"235pt\" height=\"132pt\"\n",
" viewBox=\"0.00 0.00 234.60 132.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 128)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-128 230.6,-128 230.6,4 -4,4\"/>\n",
"<text text-anchor=\"start\" x=\"90.8\" y=\"-109.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
"<text text-anchor=\"start\" x=\"115.8\" y=\"-109.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"<text text-anchor=\"start\" x=\"131.8\" y=\"-109.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=\"30,-8 30,-93 218.6,-93 218.6,-8 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=\"-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",
"<!-- I&#45;&gt;0 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-34C2.79388,-34 17.1543,-34 30.6317,-34\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-34 30.9419,-37.1501 34.4419,-34 30.9419,-34.0001 30.9419,-34.0001 30.9419,-34.0001 34.4419,-34 30.9418,-30.8501 37.9419,-34 37.9419,-34\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;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=\"-73.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"144\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M74.4034,-34C87.1928,-34 104.732,-34 118.874,-34\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"125.916,-34 118.916,-37.1501 122.416,-34 118.916,-34.0001 118.916,-34.0001 118.916,-34.0001 122.416,-34 118.916,-30.8501 125.916,-34 125.916,-34\"/>\n",
"<text text-anchor=\"start\" x=\"94.5\" y=\"-52.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"</g>\n",
"<!-- &#45;1.0 -->\n",
"<g id=\"node4\" class=\"node\"><title>&#45;1.0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"208.8\" cy=\"-55\" rx=\"1.8\" ry=\"1.8\"/>\n",
"</g>\n",
"<!-- 1&#45;&gt;&#45;1.0 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;&#45;1.0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M161.97,-31.3847C170.435,-30.8121 180.626,-31.2653 189,-35 195.022,-37.6859 200.027,-43.3116 203.355,-47.9143\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"201.413,-49.4256 207.255,-53.9948 205.538,-46.78 201.413,-49.4256\"/>\n",
"<text text-anchor=\"start\" x=\"180\" y=\"-38.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
"</g>\n",
"<!-- &#45;1.0&#45;&gt;0 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>&#45;1.0&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M207.029,-55.3291C199.425,-58.5247 137.182,-83.5412 92,-66 84.8621,-63.2288 78.2913,-58.2479 72.8175,-53.0285\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"67.7291,-47.8027 74.8694,-50.6204 70.1708,-50.3103 72.6125,-52.8179 72.6125,-52.8179 72.6125,-52.8179 70.1708,-50.3103 70.3556,-55.0155 67.7291,-47.8027 67.7291,-47.8027\"/>\n",
"</g>\n",
"<!-- &#45;1.0&#45;&gt;1 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>&#45;1.0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M206.716,-54.9037C202.95,-54.5484 190.109,-53.1643 180,-50 175.648,-48.6378 171.129,-46.8647 166.841,-44.9966\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"160.351,-42.0283 168.027,-42.0751 163.534,-43.484 166.717,-44.9397 166.717,-44.9397 166.717,-44.9397 163.534,-43.484 165.407,-47.8043 160.351,-42.0283 160.351,-42.0283\"/>\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 0x7faa503508a0> >"
]
}
],
"prompt_number": 6
},
{
"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": 7,
"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=\"237pt\" height=\"147pt\"\n",
" viewBox=\"0.00 0.00 236.60 147.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 143)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-143 232.6,-143 232.6,4 -4,4\"/>\n",
"<text text-anchor=\"start\" x=\"91.8\" y=\"-124.8\" font-family=\"Lato\" font-size=\"14.00\">Fin(</text>\n",
"<text text-anchor=\"start\" x=\"116.8\" y=\"-124.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"<text text-anchor=\"start\" x=\"132.8\" y=\"-124.8\" 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,-8 30,-108 220.6,-108 220.6,-8 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=\"-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",
"<!-- I&#45;&gt;0 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-34C2.79388,-34 17.1543,-34 30.6317,-34\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-34 30.9419,-37.1501 34.4419,-34 30.9419,-34.0001 30.9419,-34.0001 30.9419,-34.0001 34.4419,-34 30.9418,-30.8501 37.9419,-34 37.9419,-34\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;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",
"<!-- 1 -->\n",
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-34\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"139\" y=\"-30.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M74.178,-34C85.6688,-34 100.959,-34 113.693,-34\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"120.847,-34 113.847,-37.1501 117.347,-34 113.847,-34.0001 113.847,-34.0001 113.847,-34.0001 117.347,-34 113.847,-30.8501 120.847,-34 120.847,-34\"/>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"</g>\n",
"<!-- &#45;1.0 -->\n",
"<g id=\"node4\" class=\"node\"><title>&#45;1.0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"210.8\" cy=\"-70\" rx=\"1.8\" ry=\"1.8\"/>\n",
"</g>\n",
"<!-- 1&#45;&gt;&#45;1.0 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;&#45;1.0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M156.81,-30.2475C167.377,-28.8262 180.875,-28.8101 191,-35 200.508,-40.8127 205.503,-53.2288 207.894,-61.5983\"/>\n",
"<polygon fill=\"none\" stroke=\"black\" points=\"205.553,-62.3452 209.557,-68.5878 210.32,-61.2108 205.553,-62.3452\"/>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-53.8\" font-family=\"Lato\" font-size=\"14.00\">b</text>\n",
"<text text-anchor=\"start\" x=\"175\" y=\"-38.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
"</g>\n",
"<!-- &#45;1.0&#45;&gt;0 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>&#45;1.0&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M208.937,-70.1497C205.016,-70.8087 188.487,-73.3597 175,-72 137.348,-68.204 127.098,-67.1511 92,-53 87.4332,-51.1587 82.6985,-48.8714 78.2428,-46.5287\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"71.9664,-43.1024 79.6199,-43.6917 75.0385,-44.7795 78.1106,-46.4566 78.1106,-46.4566 78.1106,-46.4566 75.0385,-44.7795 76.6012,-49.2214 71.9664,-43.1024 71.9664,-43.1024\"/>\n",
"</g>\n",
"<!-- &#45;1.0&#45;&gt;1 -->\n",
"<g id=\"edge6\" class=\"edge\"><title>&#45;1.0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M208.886,-70.0545C204.745,-70.2648 187.406,-70.7466 175,-65 168.261,-61.8783 161.868,-57.0279 156.434,-52.0833\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"151.344,-47.1678 158.567,-49.7641 153.862,-49.599 156.379,-52.0302 156.379,-52.0302 156.379,-52.0302 153.862,-49.599 154.191,-54.2962 151.344,-47.1678 151.344,-47.1678\"/>\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 0x7faa50350cc0> >"
]
}
],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": true,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": null
}
],
"metadata": {}
}
]
}