spot 2.3.3

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spot::twa_reachable_iterator_depth_first_stack Class Reference
TωA (Transition-based ω-Automata) » TωA algorithms » Algorithm patterns

Iterate over all states of an automaton using a DFS. More...

`#include <spot/twaalgos/reachiter.hh>`

Inheritance diagram for spot::twa_reachable_iterator_depth_first_stack:
Collaboration diagram for spot::twa_reachable_iterator_depth_first_stack:

## Public Member Functions
| twa_reachable_iterator_depth_first_stack (const const_twa_ptr &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, twa_succ_iterator *si)
virtual void | process_link (const state *in_s, int in, const state *out_s, int out, const twa_succ_iterator *si)

## Protected Member Functions
virtual void | push (const state *s, int sn) override
| Push a new state in todo. More...
virtual void | pop () override
| Pop the DFS stack. More...

## Protected Attributes
std::unordered_set< int > | stack_
const_twa_ptr | aut_
| The spot::tgba to explore. More...
state_map< int > | seen
| States already seen. More...
std::deque< stack_item > | todo
| the DFS stack More...

## Detailed Description

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.

## Member Function Documentation

virtual void spot::twa_reachable_iterator_depth_first::end | ( |  | ) |
| virtual inherited

Called by run() once all states have been explored.

bool spot::twa_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.

virtual void spot::twa_reachable_iterator_depth_first_stack::pop | ( |  | ) |
| override protected virtual

Pop the DFS stack.

Reimplemented from spot::twa_reachable_iterator_depth_first.

virtual void spot::twa_reachable_iterator_depth_first::process_link | ( | const state * | in_s,
|  | int | in,
|  | const state * | out_s,
|  | int | out,
|  | const twa_succ_iterator * | si
| ) |  |
| virtual inherited

Called by run() to process a transition.

Parameters

  in_s | The source state
  in | The source state number.
  out_s | The destination state
  out | The destination state number.
  si | The spot::twa_succ_iterator positionned on the current transition.

The in_s and out_s states are owned by the spot::twa_reachable_iterator instance and destroyed when the instance is destroyed.

virtual void spot::twa_reachable_iterator_depth_first::process_state | ( | const state * | s,
|  | int | n,
|  | twa_succ_iterator * | si
| ) |  |
| virtual inherited

Called by run() to process a state.

Parameters

  s | The current state.
  n | A unique number assigned to s.
  si | The spot::twa_succ_iterator for s.

virtual void spot::twa_reachable_iterator_depth_first_stack::push | ( | const state * | s,
|  | int | sn
| ) |  |
| override protected virtual

Push a new state in todo.

Reimplemented from spot::twa_reachable_iterator_depth_first.

virtual void spot::twa_reachable_iterator_depth_first::run | ( |  | ) |
| virtual inherited

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.

virtual void spot::twa_reachable_iterator_depth_first::start | ( |  | ) |
| virtual inherited

Called by run() before starting its iteration.

virtual bool spot::twa_reachable_iterator_depth_first::want_state | ( | const state * | s | ) | const
| virtual inherited

Called by add_state or next_states implementations to filter states. Default implementation always return true.

## Member Data Documentation

const_twa_ptr spot::twa_reachable_iterator_depth_first::aut_
| protected inherited

The spot::tgba to explore.

state_map<int> spot::twa_reachable_iterator_depth_first::seen
| protected inherited

States already seen.

std::deque<stack_item> spot::twa_reachable_iterator_depth_first::todo
| protected inherited

the DFS stack

The documentation for this class was generated from the following file:

- spot/twaalgos/reachiter.hh

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.