spot
0.8.3
|
Iterate over all reachable states of a spot::saba. More...
#include <sabaalgos/sabareachiter.hh>
Public Member Functions | |
saba_reachable_iterator (const saba *a) | |
virtual | ~saba_reachable_iterator () |
void | run () |
Iterate over all reachable states of a spot::saba. | |
virtual bool | want_state (const saba_state *s) const |
virtual void | start () |
Called by run() before starting its iteration. | |
virtual void | end () |
Called by run() once all states have been explored. | |
virtual void | process_state (const saba_state *s, int n) |
virtual void | process_state_conjunction (const saba_state *in_s, int in, const saba_state_conjunction *sc, int sc_id, const saba_succ_iterator *si) |
virtual void | process_link (const saba_state *in_s, int in, const saba_state *out_s, int out, const saba_state_conjunction *sc, int sc_id, const saba_succ_iterator *si) |
Todo list management. | |
Called by run() to register newly discovered states. spot::saba_reachable_iterator_depth_first and spot::saba_reachable_iterator_breadth_first offer two precanned implementations for these functions. | |
virtual void | add_state (const saba_state *s)=0 |
virtual const saba_state * | next_state ()=0 |
Called by run() to obtain the next state to process. | |
Protected Types | |
typedef Sgi::hash_map< const saba_state *, int, saba_state_ptr_hash, saba_state_ptr_equal > | seen_map |
Protected Attributes | |
const saba * | automata_ |
The spot::saba to explore. | |
seen_map | seen |
States already seen. |
Iterate over all reachable states of a spot::saba.
typedef Sgi::hash_map<const saba_state*, int, saba_state_ptr_hash, saba_state_ptr_equal> spot::saba_reachable_iterator::seen_map [protected] |
virtual spot::saba_reachable_iterator::~saba_reachable_iterator | ( | ) | [virtual] |
virtual void spot::saba_reachable_iterator::add_state | ( | const saba_state * | s | ) | [pure virtual] |
Implemented in spot::saba_reachable_iterator_breadth_first, and spot::saba_reachable_iterator_depth_first.
virtual void spot::saba_reachable_iterator::end | ( | ) | [virtual] |
Called by run() once all states have been explored.
virtual const saba_state* spot::saba_reachable_iterator::next_state | ( | ) | [pure virtual] |
Called by run() to obtain the next state to process.
Implemented in spot::saba_reachable_iterator_breadth_first, and spot::saba_reachable_iterator_depth_first.
virtual void spot::saba_reachable_iterator::process_link | ( | const saba_state * | in_s, |
int | in, | ||
const saba_state * | out_s, | ||
int | out, | ||
const saba_state_conjunction * | sc, | ||
int | sc_id, | ||
const saba_succ_iterator * | si | ||
) | [virtual] |
Called by run() to process a transition.
in_s | The source state |
in | The source state number. |
out_s | The destination state |
out | The destination state number. |
sc | The spot::saba_state_conjunction positionned on the current conjunction. |
sc_id | An unique number for the this transition assigned to sc. |
si | The spot::saba_succ_iterator positionned on the current transition. |
The in_s and out_s states are owned by the spot::saba_reachable_iterator instance and destroyed when the instance is destroyed.
virtual void spot::saba_reachable_iterator::process_state | ( | const saba_state * | s, |
int | n | ||
) | [virtual] |
Called by run() to process a state.
s | The current state. |
n | A unique number assigned to s. |
virtual void spot::saba_reachable_iterator::process_state_conjunction | ( | const saba_state * | in_s, |
int | in, | ||
const saba_state_conjunction * | sc, | ||
int | sc_id, | ||
const saba_succ_iterator * | si | ||
) | [virtual] |
Called by run() to process a conjunction of states.
in_s | The current state. |
in | An unique number assigned to in_s. |
sc | The spot::saba_state_conjunction positionned on the current conjunction. |
sc_id | An unique number for the this transition assigned to sc. |
si | The spot::saba_succ_iterator positionned on the current transition. |
void spot::saba_reachable_iterator::run | ( | ) |
Iterate over all reachable states of a spot::saba.
This is a template method that will call add_state(), next_state(), start(), end(), process_state(), process_state_conjunction() and process_link(), while it iterates over states.
virtual void spot::saba_reachable_iterator::start | ( | ) | [virtual] |
Called by run() before starting its iteration.
virtual bool spot::saba_reachable_iterator::want_state | ( | const saba_state * | s | ) | const [virtual] |
Called by add_state or next_states implementations to filter states. Default implementation always return true.
const saba* spot::saba_reachable_iterator::automata_ [protected] |
The spot::saba to explore.
seen_map spot::saba_reachable_iterator::seen [protected] |
States already seen.