spot
0.8.1
|
Iterate over all reachable states of a spot::tgba. More...
#include <tgbaalgos/reachiter.hh>
Public Member Functions | |
tgba_reachable_iterator (const tgba *a) | |
virtual | ~tgba_reachable_iterator () |
void | run () |
Iterate over all reachable states of a spot::tgba. | |
virtual bool | want_state (const 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 state *s, int n, tgba_succ_iterator *si) |
virtual void | process_link (const state *in_s, int in, const state *out_s, int out, const tgba_succ_iterator *si) |
Todo list management. | |
Called by run() to register newly discovered states. spot::tgba_reachable_iterator_depth_first and spot::tgba_reachable_iterator_breadth_first offer two precanned implementations for these functions. | |
virtual void | add_state (const state *s)=0 |
virtual const state * | next_state ()=0 |
Called by run() to obtain the next state to process. | |
Protected Types | |
typedef Sgi::hash_map< const state *, int, state_ptr_hash, state_ptr_equal > | seen_map |
Protected Attributes | |
const tgba * | automata_ |
The spot::tgba to explore. | |
seen_map | seen |
States already seen. |
Iterate over all reachable states of a spot::tgba.
typedef Sgi::hash_map<const state*, int, state_ptr_hash, state_ptr_equal> spot::tgba_reachable_iterator::seen_map [protected] |
virtual spot::tgba_reachable_iterator::~tgba_reachable_iterator | ( | ) | [virtual] |
virtual void spot::tgba_reachable_iterator::add_state | ( | const state * | s | ) | [pure virtual] |
Implemented in spot::tgba_reachable_iterator_breadth_first, and spot::tgba_reachable_iterator_depth_first.
virtual void spot::tgba_reachable_iterator::end | ( | ) | [virtual] |
Called by run() once all states have been explored.
virtual const state* spot::tgba_reachable_iterator::next_state | ( | ) | [pure virtual] |
Called by run() to obtain the next state to process.
Implemented in spot::tgba_reachable_iterator_breadth_first, and spot::tgba_reachable_iterator_depth_first.
virtual void spot::tgba_reachable_iterator::process_link | ( | const state * | in_s, |
int | in, | ||
const state * | out_s, | ||
int | out, | ||
const tgba_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. |
si | The spot::tgba_succ_iterator positionned on the current transition. |
The in_s and out_s states are owned by the spot::tgba_reachable_iterator instance and destroyed when the instance is destroyed.
virtual void spot::tgba_reachable_iterator::process_state | ( | const state * | s, |
int | n, | ||
tgba_succ_iterator * | si | ||
) | [virtual] |
Called by run() to process a state.
s | The current state. |
n | A unique number assigned to s. |
si | The spot::tgba_succ_iterator for s. |
Reimplemented in spot::parity_game_graph, and spot::tgba_reduc.
void spot::tgba_reachable_iterator::run | ( | ) |
Iterate over all reachable states of a spot::tgba.
This is a template method that will call add_state(), next_state(), start(), end(), process_state(), and process_link(), while it iterates over states.
virtual void spot::tgba_reachable_iterator::start | ( | ) | [virtual] |
Called by run() before starting its iteration.
virtual bool spot::tgba_reachable_iterator::want_state | ( | const state * | s | ) | const [virtual] |
Called by add_state or next_states implementations to filter states. Default implementation always return true.
const tgba* spot::tgba_reachable_iterator::automata_ [protected] |
The spot::tgba to explore.
seen_map spot::tgba_reachable_iterator::seen [protected] |
States already seen.