spot
1.2.4
|
Iterate over all states of an automaton using a DFS. More...
#include <tgbaalgos/reachiter.hh>
Public Member Functions | |
tgba_reachable_iterator_depth_first_stack (const tgba *a) | |
bool | on_stack (int sn) const |
Whether state sn is on the DFS stack. More... | |
virtual void | run () |
Iterate over all reachable states of a spot::tgba. More... | |
virtual bool | want_state (const state *s) const |
virtual void | start () |
Called by run() before starting its iteration. More... | |
virtual void | end () |
Called by run() once all states have been explored. More... | |
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) |
Protected Types | |
typedef Sgi::hash_map< const state *, int, state_ptr_hash, state_ptr_equal > | seen_map |
Protected Member Functions | |
virtual void | push (const state *s, int sn) |
Push a new state in todo. More... | |
virtual void | pop () |
Pop the DFS stack. More... | |
Protected Attributes | |
Sgi::hash_set< int > | stack_ |
const tgba * | aut_ |
The spot::tgba to explore. More... | |
seen_map | seen |
States already seen. More... | |
std::deque< stack_item > | todo |
the DFS stack More... | |
Iterate over all states of an automaton using a DFS.
This variant also maintains a set of states that are on the DFS stack. It can be checked using the on_stack() method.
|
virtualinherited |
Called by run() once all states have been explored.
bool spot::tgba_reachable_iterator_depth_first_stack::on_stack | ( | int | sn) | const |
Whether state sn is on the DFS stack.
Note the destination state of a transition is only pushed to the stack after process_link() has been called.
|
protectedvirtual |
Pop the DFS stack.
Reimplemented from spot::tgba_reachable_iterator_depth_first.
|
virtualinherited |
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.
|
virtualinherited |
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. |
|
protectedvirtual |
Push a new state in todo.
Reimplemented from spot::tgba_reachable_iterator_depth_first.
|
virtualinherited |
Iterate over all reachable states of a spot::tgba.
This is a template method that will call start(), end(), want_state(), process_state(), and process_link(), while it iterates over states.
|
virtualinherited |
Called by run() before starting its iteration.
|
virtualinherited |
Called by add_state or next_states implementations to filter states. Default implementation always return true.
|
protectedinherited |
The spot::tgba to explore.
|
protectedinherited |
States already seen.
|
protectedinherited |
the DFS stack