This notebook shows an example of a non-deterministic automaton that Seminator can turn into a semi-deterministic automaton that is smaller than the minimal equivalent deterministic automaton.
Beside the Spot bindinges (that start with spot.
) we use two functions exported by Seminator: the seminator()
function offer services similar to the command-line tool, and the highlight_components()
can be used to color the first (purple) and second (green) components of a semi-deterministic automaton.
In [1]:
import spot
from spot.jupyter import display_inline
from spot.seminator import seminator, highlight_components
spot.setup(show_default='.v') # vertical display
In [2]:
nba = spot.translate('F(a & GFb) R c')
sdba = seminator(nba)
dba = spot.postprocess(nba, 'det')
# add some colors
spot.highlight_nondet_edges(nba, 5)
highlight_components(sdba)
In [3]:
display_inline(nba, sdba, dba)
To show that the deterministic Büchi automaton on the right is minimal, we use Spot's sat_minimize()
function, that uses a SAT-solver to find a smaller equivalent DBA if one exists.
In [4]:
assert dba.num_states() == spot.sat_minimize(dba).num_states()