{
"metadata": {
"name": "",
"signature": "sha256:c89800970357ab95bbed91a11bd8f6c61d1861b3fb1fb1edf133500904e3a355"
},
"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": "code",
"collapsed": false,
"input": [
"a = spot.translate('a U b U c')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The `#` option of `print_dot()` can be used to display the internal number of each transition "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"a.show('.#')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 3,
"svg": [
""
],
"text": [
""
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using these numbers you can selectively hightlight some transitions. The second argument is a color number (from a list of predefined colors)."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"a.highlight_edges([2, 4, 5], 1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"svg": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text": [
" *' at 0x7f6f600c1690> >"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that these `highlight_` functions work for edges and states, and come with both singular (changing the color of single state or edge) and plural versions.\n",
"\n",
"They modify the automaton in place."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"a.highlight_edge(6, 2).highlight_states((0, 1), 0)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"svg": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text": [
" *' at 0x7f6f60140b40> >"
]
}
],
"prompt_number": 5
}
],
"metadata": {}
}
]
}