* src/tgba/bddprint.hh (bdd_format_set): New function.
* src/tgba/bddprint.cc (bdd_format_set): Likewise. * src/tgba/state.hh: Add Doxygen comments. (state::compare): Take a state*, not a state&. (state_ptr_less_than): New functor. * src/tgba/statebdd.hh (state_bdd::compare): Take a state*, not a state&. * src/tgba/statebdd.cc (state_bdd::compare): Likewise. * src/tgba/succiter.hh: Add Doxygen comments. * src/tgba/tgba.hh: Mention promises. (tgba::formate_state): New pure virtual method. * src/tgba/tgbabddconcrete.hh (tgba_bdd_concrete::formate_state): New method. * src/tgba/tgbabddconcrete.cc (tgba_bdd_concrete::formate_state): Likewise. * src/tgbaalgos/dotty.cc: Adjust to use state_ptr_less_than and tgba::formate_state.
This commit is contained in:
parent
3f0e95f061
commit
fb5ff901d0
11 changed files with 178 additions and 49 deletions
|
|
@ -5,25 +5,48 @@
|
|||
|
||||
namespace spot
|
||||
{
|
||||
|
||||
/// \brief Abstract class for states.
|
||||
class state
|
||||
{
|
||||
public:
|
||||
// Compares two states (that come from the same automaton).
|
||||
//
|
||||
// This method returns an integer less than, equal to, or greater
|
||||
// than zero if THIS is found, respectively, to be less than, equal
|
||||
// to, or greater than OTHER according to some implicit total order.
|
||||
//
|
||||
// This method should not be called to compare state from
|
||||
// different automata.
|
||||
virtual int compare(const state& other) const = 0;
|
||||
|
||||
virtual bdd as_bdd() const = 0;
|
||||
/// \brief Compares two states (that come from the same automaton).
|
||||
///
|
||||
/// This method returns an integer less than, equal to, or greater
|
||||
/// than zero if \a this is found, respectively, to be less than, equal
|
||||
/// to, or greater than \a other according to some implicit total order.
|
||||
///
|
||||
/// This method should not be called to compare states from
|
||||
/// different automata.
|
||||
///
|
||||
/// \sa spot::state_ptr_less_than
|
||||
virtual int compare(const state* other) const = 0;
|
||||
|
||||
virtual ~state()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Strict Weak Ordering for \c state*.
|
||||
///
|
||||
/// This is meant to be used as a comparison functor for
|
||||
/// STL \c map whose key are of type \c state*.
|
||||
///
|
||||
/// For instance here is how one could declare
|
||||
/// a map of \c state*.
|
||||
/// \code
|
||||
/// // Remember how many times each state has been visited.
|
||||
/// std::map<spot::state*, int, spot::state_ptr_less_than> seen;
|
||||
/// \endcode
|
||||
struct state_ptr_less_than
|
||||
{
|
||||
bool
|
||||
operator()(const state* left, const state *right)
|
||||
{
|
||||
return left->compare(right) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // SPOT_TGBA_STATE_HH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue