import spot
spot.setup()
a = spot.translate('a U b U c')
The #
option of print_dot()
can be used to display the internal number of each transition
a.show('.#')
Using these numbers you can selectively hightlight some transitions. The second argument is a color number (from a list of predefined colors).
a.highlight_edges([2, 4, 5], 1)
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.
They modify the automaton in place.
a.highlight_edge(6, 2).highlight_states((0, 1), 0)
One use of this highlighting is to highlight a run in an automaton.
The following few command generate an automaton, then an accepting run on this automaton, and highlight that accepting run on the automaton. Note that a run knows the automaton from which it was generated, so calling highlight()
will directly decorate that automaton.
b = spot.translate('X (F(Ga <-> b) & GF!b)'); b
r = spot.couvreur99(b).check().accepting_run(); r
r.highlight(5) # the parameter is a color number
b