20 #ifndef LIMI_REACHABLE_H
21 #define LIMI_REACHABLE_H
22 #include "automaton.h"
27 #include <unordered_set>
29 #include <unordered_map>
45 template <
class State,
class Symbol,
class Implementation>
47 std::unordered_set<State> seen;
48 std::deque<State> frontier;
50 frontier.push_back(s);
52 while (!frontier.empty()) {
53 State next = frontier.front();
55 if (seen.find(next) == seen.end()) {
57 for (
const Symbol& symbol : automaton.
next_symbols(next)) {
58 for (
const State& succ : automaton.
successors(next, symbol)) {
59 frontier.push_back(succ);
70 #endif // LIMI_REACHABLE_H
void next_symbols(const State &state, Symbol_vector &symbols) const
Returns possible successor symbols for a state.
Definition: automaton.h:256
The main namespace of the library.
Definition: antichain_algo.h:40
std::unordered_set< State > explore(const automaton< State, Symbol, Implementation > &automaton)
This function fully explores an automaton and returns a set of all reachable states.
Definition: reachable.h:46
void successors(const State &state, const Symbol &sigma, State_vector &successors1) const
Returns the successor for a specific state.
Definition: automaton.h:201
void initial_states(State_vector &states) const
Returns the initial states.
Definition: automaton.h:167
Automata need to inherit from this class and implement certain methods.
Definition: automaton.h:49