diff --git a/tests/python/highlighting.ipynb b/tests/python/highlighting.ipynb index 2b73e6071..04b9c5699 100644 --- a/tests/python/highlighting.ipynb +++ b/tests/python/highlighting.ipynb @@ -15,10 +15,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.4.3+" + "version": "3.5.3rc1" }, - "name": "", - "signature": "sha256:30e1abf38b76bd072ff688d2b48f94eb5945807bfa9583a8f457ad3bc4966c4e" + "name": "" }, "nbformat": 3, "nbformat_minor": 0, @@ -155,7 +154,7 @@ "" ], "text": [ - "" + "" ] } ], @@ -255,7 +254,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d01be8a0> >" + " *' at 0x7fd9b0b5ab70> >" ] } ], @@ -357,7 +356,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d0132f90> >" + " *' at 0x7fd9b0aeb270> >" ] } ], @@ -572,7 +571,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b10f0> >" + " *' at 0x7fd9b0aeb390> >" ] } ], @@ -751,7 +750,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b10f0> >" + " *' at 0x7fd9b0aeb390> >" ] } ], @@ -831,7 +830,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1090> >" + " *' at 0x7fd9b0aeb660> >" ] }, { @@ -877,7 +876,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1030> >" + " *' at 0x7fd9b0aeb300> >" ] } ], @@ -963,7 +962,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d0132fc0> >" + " *' at 0x7fd9b0aeb150> >" ] } ], @@ -1088,7 +1087,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d0132fc0> >" + " *' at 0x7fd9b0aeb150> >" ] }, { @@ -1145,7 +1144,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1090> >" + " *' at 0x7fd9b0aeb660> >" ] }, { @@ -1191,7 +1190,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1030> >" + " *' at 0x7fd9b0aeb300> >" ] } ], @@ -1398,7 +1397,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1150> >" + " *' at 0x7fd9b0aeb750> >" ] }, { @@ -1472,7 +1471,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1120> >" + " *' at 0x7fd9b0aeb630> >" ] }, { @@ -1556,7 +1555,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1180> >" + " *' at 0x7fd9b0aeb2d0> >" ] } ], @@ -1702,7 +1701,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1270> >" + " *' at 0x7fd9b0aeb810> >" ] } ], @@ -1847,7 +1846,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1270> >" + " *' at 0x7fd9b0aeb810> >" ] } ], @@ -1990,7 +1989,7 @@ "\n" ], "text": [ - " *' at 0x7fc0d57b1270> >" + " *' at 0x7fd9b0aeb810> >" ] }, { @@ -2094,7 +2093,7 @@ "" ], "text": [ - "" + "" ] }, { @@ -2147,14 +2146,243 @@ "" ], "text": [ - "" + "" ] } ], "prompt_number": 19 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Highlighting languages\n", + "\n", + "For deterministic automata, the function `spot.highlight_languages()` can be used to highlight states that recognize the same language. This can be a great help in reading automata. States with a colored border share their language, and states with a black border all have a language different from all other states." + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "aut = spot.translate('(b W Xa) & GF(c <-> Xb) | a', 'generic', 'det')\n", + "spot.highlight_languages(aut)\n", + "aut.show('.bas')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 20, + "svg": [ + "\n", + "\n", + "G\n", + "\n", + "Fin(\n", + "\u24ff\n", + ") & Inf(\n", + "\u2776\n", + ")\n", + "cluster_0\n", + "\n", + "\n", + "cluster_1\n", + "\n", + "\n", + "cluster_2\n", + "\n", + "\n", + "cluster_3\n", + "\n", + "\n", + "cluster_4\n", + "\n", + "\n", + "\n", + "\n", + "1\n", + "\n", + "1\n", + "\n", + "\n", + "I->1\n", + "\n", + "\n", + "\n", + "\n", + "0\n", + "\n", + "0\n", + "\n", + "\n", + "1->0\n", + "\n", + "\n", + "a\n", + "\n", + "\n", + "2\n", + "\n", + "2\n", + "\n", + "\n", + "1->2\n", + "\n", + "\n", + "!a & !b\n", + "\n", + "\n", + "3\n", + "\n", + "3\n", + "\n", + "\n", + "1->3\n", + "\n", + "\n", + "!a & b\n", + "\n", + "\n", + "0->0\n", + "\n", + "\n", + "1\n", + "\u2776\n", + "\n", + "\n", + "4\n", + "\n", + "4\n", + "\n", + "\n", + "6\n", + "\n", + "6\n", + "\n", + "\n", + "4->6\n", + "\n", + "\n", + "!c\n", + "\n", + "\n", + "7\n", + "\n", + "7\n", + "\n", + "\n", + "4->7\n", + "\n", + "\n", + "c\n", + "\n", + "\n", + "6->4\n", + "\n", + "\n", + "!b\n", + "\u2776\n", + "\n", + "\n", + "6->6\n", + "\n", + "\n", + "b & !c\n", + "\n", + "\n", + "6->7\n", + "\n", + "\n", + "b & c\n", + "\n", + "\n", + "7->4\n", + "\n", + "\n", + "b\n", + "\u2776\n", + "\n", + "\n", + "7->6\n", + "\n", + "\n", + "!b & !c\n", + "\n", + "\n", + "7->7\n", + "\n", + "\n", + "!b & c\n", + "\n", + "\n", + "2->4\n", + "\n", + "\n", + "a\n", + "\n", + "\n", + "3->4\n", + "\n", + "\n", + "a\n", + "\n", + "\n", + "3->2\n", + "\n", + "\n", + "!a & !b\n", + "\n", + "\n", + "3->3\n", + "\n", + "\n", + "!a & b & !c\n", + "\n", + "\n", + "5\n", + "\n", + "5\n", + "\n", + "\n", + "3->5\n", + "\n", + "\n", + "!a & b & c\n", + "\n", + "\n", + "5->4\n", + "\n", + "\n", + "a\n", + "\n", + "\n", + "5->2\n", + "\n", + "\n", + "!a & !b\n", + "\n", + "\n", + "5->3\n", + "\n", + "\n", + "!a & b\n", + "\u2776\n", + "\n", + "\n", + "" + ], + "text": [ + "" + ] + } + ], + "prompt_number": 20 } ], "metadata": {} } ] -} \ No newline at end of file +}