autfilt: Add --is-terminal and --is-weak.

Fixes #47.

* src/twaalgos/strength.cc, src/twaalgos/strength.hh
(is_weak_automaton): New function.
(is_terminal_automaton): Generalize slightly.
* src/bin/autfilt.cc: Add options --is-terminal and --is-weak.
* src/tests/readsave.test: Add a test.
* NEWS: Update.
This commit is contained in:
Alexandre Duret-Lutz 2015-11-07 15:30:51 +01:00
parent 81cfa05aef
commit f4cf0f4078
5 changed files with 103 additions and 38 deletions

View file

@ -25,9 +25,8 @@ namespace spot
{
/// \brief Whether an automaton is terminal.
///
/// An automaton is terminal if any accepting path ends on an
/// accepting state with only one transition that is a self-loop
/// labelled by true.
/// An automaton is terminal if it is weak, and all accepting SCCs
/// are complete.
///
/// \param aut the automaton to check
///
@ -36,6 +35,19 @@ namespace spot
SPOT_API bool
is_terminal_automaton(const const_twa_graph_ptr& aut, scc_info* sm = nullptr);
/// \brief Whether an automaton is weak.
///
/// An automaton is weak if if any given SCC, all transitions belong
/// to the same acceptance sets.
///
/// \param aut the automaton to check
///
/// \param sm an scc_info object for the automaton if available (it
/// will be built otherwise).
SPOT_API bool
is_weak_automaton(const const_twa_graph_ptr& aut, scc_info* sm = nullptr);
/// \brief Whether a minimized WDBA represents a safety property.
///
/// A minimized WDBA (as returned by a successful run of