word.ipynb 23.2 KB
Newer Older
1
2
3
{
 "metadata": {
  "name": "",
4
  "signature": "sha256:6461a5fa3f321dac24ae47d88c90f911822e003b658d05d4ef7c102ff64e058e"
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import spot\n",
      "spot.setup()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Let's build a small automaton to use as example."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "aut = spot.translate('G(Fa <-> Xb)'); aut"
     ],
     "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=\"386pt\" height=\"155pt\"\n",
        " viewBox=\"0.00 0.00 385.50 155.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 151)\">\n",
        "<title>G</title>\n",
        "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-151 381.5,-151 381.5,4 -4,4\"/>\n",
        "<!-- I -->\n",
        "<!-- 0 -->\n",
        "<g id=\"node2\" class=\"node\"><title>0</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-45\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"56\" y=\"-41.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,-45C2.79388,-45 17.1543,-45 30.6317,-45\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-45 30.9419,-48.1501 34.4419,-45 30.9419,-45.0001 30.9419,-45.0001 30.9419,-45.0001 34.4419,-45 30.9418,-41.8501 37.9419,-45 37.9419,-45\"/>\n",
        "</g>\n",
        "<!-- 1 -->\n",
        "<g id=\"node3\" class=\"node\"><title>1</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"139\" cy=\"-96\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"139\" y=\"-92.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
        "</g>\n",
        "<!-- 0&#45;&gt;1 -->\n",
        "<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M71.8566,-54.3542C84.5306,-62.3341 102.896,-73.8976 117.061,-82.816\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"123.238,-86.7051 115.636,-85.641 120.276,-84.8402 117.314,-82.9754 117.314,-82.9754 117.314,-82.9754 120.276,-84.8402 118.992,-80.3097 123.238,-86.7051 123.238,-86.7051\"/>\n",
        "<text text-anchor=\"start\" x=\"92\" y=\"-76.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
        "</g>\n",
        "<!-- 2 -->\n",
        "<g id=\"node4\" class=\"node\"><title>2</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"248\" cy=\"-61\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"248\" y=\"-57.3\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
        "</g>\n",
        "<!-- 0&#45;&gt;2 -->\n",
        "<g id=\"edge3\" class=\"edge\"><title>0&#45;&gt;2</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M74.1963,-46.4481C108.109,-49.3039 183.696,-55.6692 222.691,-58.953\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"229.979,-59.5667 222.74,-62.1181 226.492,-59.2729 223.004,-58.9792 223.004,-58.9792 223.004,-58.9792 226.492,-59.2729 223.268,-55.8403 229.979,-59.5667 229.979,-59.5667\"/>\n",
        "<text text-anchor=\"start\" x=\"135.5\" y=\"-56.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
        "</g>\n",
        "<!-- 3 -->\n",
        "<g id=\"node5\" class=\"node\"><title>3</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"357\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"357\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
        "</g>\n",
        "<!-- 0&#45;&gt;3 -->\n",
        "<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;3</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M74.3679,-43.4317C125.166,-38.8446 273.551,-25.4452 331.97,-20.17\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"338.957,-19.539 332.268,-23.3059 335.471,-19.8538 331.985,-20.1687 331.985,-20.1687 331.985,-20.1687 335.471,-19.8538 331.702,-17.0314 338.957,-19.539 338.957,-19.539\"/>\n",
        "<text text-anchor=\"start\" x=\"188\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
        "</g>\n",
        "<!-- 1&#45;&gt;1 -->\n",
        "<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;1</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M131.969,-112.664C130.406,-122.625 132.75,-132 139,-132 143.688,-132 146.178,-126.727 146.471,-119.888\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"146.031,-112.664 149.601,-119.46 146.244,-116.158 146.456,-119.651 146.456,-119.651 146.456,-119.651 146.244,-116.158 143.312,-119.842 146.031,-112.664 146.031,-112.664\"/>\n",
        "<text text-anchor=\"start\" x=\"120.5\" y=\"-135.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
        "</g>\n",
        "<!-- 1&#45;&gt;2 -->\n",
        "<g id=\"edge6\" class=\"edge\"><title>1&#45;&gt;2</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M157,-98.8379C172.054,-100.594 194.318,-101.307 212,-94 219.178,-91.0336 225.76,-85.8674 231.231,-80.4911\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"236.314,-75.1185 233.791,-82.3685 233.908,-77.6611 231.503,-80.2038 231.503,-80.2038 231.503,-80.2038 233.908,-77.6611 229.215,-78.039 236.314,-75.1185 236.314,-75.1185\"/>\n",
        "<text text-anchor=\"start\" x=\"176.5\" y=\"-118.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
        "<text text-anchor=\"start\" x=\"185.5\" y=\"-103.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
        "</g>\n",
        "<!-- 2&#45;&gt;1 -->\n",
        "<g id=\"edge7\" class=\"edge\"><title>2&#45;&gt;1</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M229.954,-62.6225C215.066,-64.4327 193.072,-68.0686 175,-75 169.996,-76.9191 164.895,-79.5369 160.19,-82.2732\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"154.066,-86.0235 158.39,-79.6814 157.05,-84.1956 160.035,-82.3677 160.035,-82.3677 160.035,-82.3677 157.05,-84.1956 161.68,-85.054 154.066,-86.0235 154.066,-86.0235\"/>\n",
        "<text text-anchor=\"start\" x=\"175\" y=\"-78.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
        "</g>\n",
        "<!-- 2&#45;&gt;2 -->\n",
        "<g id=\"edge8\" class=\"edge\"><title>2&#45;&gt;2</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M238.767,-76.5414C236.169,-86.9087 239.246,-97 248,-97 254.702,-97 258.077,-91.0847 258.124,-83.6591\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"257.233,-76.5414 261.229,-83.0955 257.668,-80.0143 258.103,-83.4871 258.103,-83.4871 258.103,-83.4871 257.668,-80.0143 254.977,-83.8788 257.233,-76.5414 257.233,-76.5414\"/>\n",
        "<text text-anchor=\"start\" x=\"231\" y=\"-115.8\" font-family=\"Lato\" font-size=\"14.00\">a &amp; b</text>\n",
        "<text text-anchor=\"start\" x=\"240\" y=\"-100.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
        "</g>\n",
        "<!-- 2&#45;&gt;3 -->\n",
        "<g id=\"edge9\" class=\"edge\"><title>2&#45;&gt;3</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M265.251,-54.4692C283.425,-47.1658 312.983,-35.2873 333.402,-27.0815\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"339.947,-24.4513 334.626,-29.9844 336.699,-25.7565 333.452,-27.0616 333.452,-27.0616 333.452,-27.0616 336.699,-25.7565 332.277,-24.1388 339.947,-24.4513 339.947,-24.4513\"/>\n",
        "<text text-anchor=\"start\" x=\"284\" y=\"-48.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; b</text>\n",
        "</g>\n",
        "<!-- 3&#45;&gt;3 -->\n",
        "<g id=\"edge10\" class=\"edge\"><title>3&#45;&gt;3</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M347.767,-33.5414C345.169,-43.9087 348.246,-54 357,-54 363.702,-54 367.077,-48.0847 367.124,-40.6591\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"366.233,-33.5414 370.229,-40.0955 366.668,-37.0143 367.103,-40.4871 367.103,-40.4871 367.103,-40.4871 366.668,-37.0143 363.977,-40.8788 366.233,-33.5414 366.233,-33.5414\"/>\n",
        "<text text-anchor=\"start\" x=\"336.5\" y=\"-72.8\" font-family=\"Lato\" font-size=\"14.00\">!a &amp; !b</text>\n",
        "<text text-anchor=\"start\" x=\"349\" y=\"-57.8\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#5da5da\">\u24ff</text>\n",
        "</g>\n",
        "</g>\n",
        "</svg>\n"
       ],
       "text": [
142
        "<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fdd0c5d9330> >"
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The call to `couvreur99()` just instanciate the emptiness check, but does not run the check.  Calling `check()` will return `None` if no accepting run was found.  Otherwise the presence of the accepting run is established, but an accepting run hasn't necessarily been calculated: calling `accepting_run()` on the result will cause this computation to happen.\n",
      "\n",
      "\n",
      "In the example below, we do not check the result of `check()` because we know that the input formula is satisfiable, so the automaton has an accepting run."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "run = spot.couvreur99(aut).check().accepting_run(); run"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "Prefix:\n",
        "  0\n",
        "  |  !a\n",
        "Cycle:\n",
        "  1\n",
        "  |  a & b\t{0}\n",
        "  2\n",
        "  |  !a & b"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Accessing the contents of the run can be done via the `prefix` and `cycle` lists."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.bdd_format_formula(aut.get_dict(), run.prefix[0].label))\n",
      "print(run.cycle[0].acc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "!a\n",
        "{0}\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "To convert the run into a word, using `spot.twa_word()`.  Note that our runs are labeled by Boolean formulas that are not necessarily a conjunction of all involved litterals.   The word is just the projection of the run on its labels."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "word = spot.twa_word(run); word"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "!a; cycle{a & b; !a & b}"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Accessing the different formulas (stored as BDDs) can be done again via the `prefix` and `cycle` lists."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.bdd_format_formula(aut.get_dict(), word.prefix[0]))\n",
      "print(spot.bdd_format_formula(aut.get_dict(), word.cycle[0]))\n",
      "print(spot.bdd_format_formula(aut.get_dict(), word.cycle[1]))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "!a\n",
        "a & b\n",
        "!a & b\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Calling `simplifify()` will produce a shorter word that is compatible with the original word. For instance in the above word, the initial `!a` is compatible with both `a & b` and `!a & b`.   The word obtained by restricting `!a` to `!a & b` is therefore still accepted, but it allows removing the prefix by rotating the cycle:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "word.simplify()\n",
      "word"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "cycle{!a & b; a & b}"
       ]
      }
     ],
     "prompt_number": 7
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.parse_word('a; b; cycle{a&b}'))\n",
      "print(spot.parse_word('cycle{a&bb|bac&(aaa|bbb)}'))\n",
      "print(spot.parse_word('a; b;b; qiwuei;\"a;b&c;a\" ;cycle{a}'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a; b; cycle{a & b}\n",
        "cycle{(a & bb) | (aaa & bac) | (bac & bbb)}\n",
        "a; b; b; qiwuei; \"a;b&c;a\"; cycle{a}\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.parse_word('a; b&!a; b'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "SyntaxError",
       "evalue": "\n>>> a; b&!a; b\n              ^\nA twa_word must contain a cycle\n (<string>)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;36m  File \u001b[0;32m\"<string>\"\u001b[0;36m, line \u001b[0;32munknown\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m \n>>> a; b&!a; b\n              ^\nA twa_word must contain a cycle\n\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.parse_word('a; b; c}'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "SyntaxError",
       "evalue": "\n>>> a; b; c}\n           ^\nExpected ';' delimiter :'}' stands for ending a cycle\n (<string>)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;36m  File \u001b[0;32m\"<string>\"\u001b[0;36m, line \u001b[0;32munknown\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m \n>>> a; b; c}\n           ^\nExpected ';' delimiter :'}' stands for ending a cycle\n\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.parse_word('a; cycle{}'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "SyntaxError",
       "evalue": "\n>>> a; cycle{}\n             ^\nempty input\n\n (<string>)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;36m  File \u001b[0;32m\"<string>\"\u001b[0;36m, line \u001b[0;32munknown\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m \n>>> a; cycle{}\n             ^\nempty input\n\n\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print(spot.parse_word('a; cycle{!a}; a'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "SyntaxError",
       "evalue": "\n>>> a; cycle{!a}; a\n                ^\nInput should be finished after cycle\n (<string>)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;36m  File \u001b[0;32m\"<string>\"\u001b[0;36m, line \u001b[0;32munknown\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m \n>>> a; cycle{!a}; a\n                ^\nInput should be finished after cycle\n\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "w1 = spot.parse_word('a; !a; cycle{a; !a; a}')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "w1.as_automaton()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 14,
       "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=\"406pt\" height=\"74pt\"\n",
        " viewBox=\"0.00 0.00 406.00 74.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 70)\">\n",
        "<title>G</title>\n",
        "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-70 402,-70 402,4 -4,4\"/>\n",
        "<!-- I -->\n",
        "<!-- 0 -->\n",
        "<g id=\"node2\" class=\"node\"><title>0</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"56\" y=\"-14.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,-18C2.79388,-18 17.1543,-18 30.6317,-18\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-18 30.9419,-21.1501 34.4419,-18 30.9419,-18.0001 30.9419,-18.0001 30.9419,-18.0001 34.4419,-18 30.9418,-14.8501 37.9419,-18 37.9419,-18\"/>\n",
        "</g>\n",
        "<!-- 1 -->\n",
        "<g id=\"node3\" class=\"node\"><title>1</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"135\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"135\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
        "</g>\n",
        "<!-- 0&#45;&gt;1 -->\n",
        "<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M74.0888,-18C84.5562,-18 98.1196,-18 109.693,-18\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"116.959,-18 109.959,-21.1501 113.459,-18 109.959,-18.0001 109.959,-18.0001 109.959,-18.0001 113.459,-18 109.959,-14.8501 116.959,-18 116.959,-18\"/>\n",
        "<text text-anchor=\"start\" x=\"92\" y=\"-21.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
        "</g>\n",
        "<!-- 2 -->\n",
        "<g id=\"node4\" class=\"node\"><title>2</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"218\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"218\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">2</text>\n",
        "</g>\n",
        "<!-- 1&#45;&gt;2 -->\n",
        "<g id=\"edge3\" class=\"edge\"><title>1&#45;&gt;2</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M153.178,-18C164.669,-18 179.959,-18 192.693,-18\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"199.847,-18 192.847,-21.1501 196.347,-18 192.847,-18.0001 192.847,-18.0001 192.847,-18.0001 196.347,-18 192.847,-14.8501 199.847,-18 199.847,-18\"/>\n",
        "<text text-anchor=\"start\" x=\"171\" y=\"-21.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
        "</g>\n",
        "<!-- 3 -->\n",
        "<g id=\"node5\" class=\"node\"><title>3</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"297\" cy=\"-48\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"297\" y=\"-44.3\" font-family=\"Lato\" font-size=\"14.00\">3</text>\n",
        "</g>\n",
        "<!-- 2&#45;&gt;3 -->\n",
        "<g id=\"edge4\" class=\"edge\"><title>2&#45;&gt;3</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M234.954,-24.216C246.105,-28.5603 261.15,-34.4223 273.515,-39.2395\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"280.066,-41.7919 272.4,-42.1858 276.805,-40.5213 273.544,-39.2507 273.544,-39.2507 273.544,-39.2507 276.805,-40.5213 274.687,-36.3156 280.066,-41.7919 280.066,-41.7919\"/>\n",
        "<text text-anchor=\"start\" x=\"254\" y=\"-36.8\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
        "</g>\n",
        "<!-- 4 -->\n",
        "<g id=\"node6\" class=\"node\"><title>4</title>\n",
        "<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"380\" cy=\"-18\" rx=\"18\" ry=\"18\"/>\n",
        "<text text-anchor=\"middle\" x=\"380\" y=\"-14.3\" font-family=\"Lato\" font-size=\"14.00\">4</text>\n",
        "</g>\n",
        "<!-- 3&#45;&gt;4 -->\n",
        "<g id=\"edge5\" class=\"edge\"><title>3&#45;&gt;4</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M314.003,-42.073C326.017,-37.6233 342.638,-31.4675 356.064,-26.4947\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"362.753,-24.0174 357.283,-29.4026 359.471,-25.233 356.189,-26.4487 356.189,-26.4487 356.189,-26.4487 359.471,-25.233 355.095,-23.4948 362.753,-24.0174 362.753,-24.0174\"/>\n",
        "<text text-anchor=\"start\" x=\"333\" y=\"-37.8\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
        "</g>\n",
        "<!-- 4&#45;&gt;2 -->\n",
        "<g id=\"edge6\" class=\"edge\"><title>4&#45;&gt;2</title>\n",
        "<path fill=\"none\" stroke=\"black\" d=\"M362.276,-13.9842C349.433,-11.115 331.209,-7.50646 315,-6 299.069,-4.51934 294.922,-4.4234 279,-6 266.86,-7.20214 253.537,-9.74069 242.536,-12.1747\"/>\n",
        "<polygon fill=\"black\" stroke=\"black\" points=\"235.677,-13.744 241.798,-9.11188 239.089,-12.9632 242.501,-12.1825 242.501,-12.1825 242.501,-12.1825 239.089,-12.9632 243.204,-15.2532 235.677,-13.744 235.677,-13.744\"/>\n",
        "<text text-anchor=\"start\" x=\"293.5\" y=\"-9.8\" font-family=\"Lato\" font-size=\"14.00\">a</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 0x7fdd0c5d96c0> >"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
515
516
517
518
519
520
    }
   ],
   "metadata": {}
  }
 ]
}