20 #ifndef LIMI_LIST_AUTOMATON_H
21 #define LIMI_LIST_AUTOMATON_H
25 #include "automaton.h"
26 #include "internal/helpers.h"
43 template <
class Symbol>
50 std::vector<Symbol> symbol_list;
64 template <
class InputIterator>
66 symbol_list.insert(symbol_list.begin(), first, last);
69 bool int_is_final_state(
const unsigned& state)
const {
return state >= symbol_list.size(); }
71 void int_initial_states(State_vector& states)
const { states.push_back(0); }
73 void int_successors(
const unsigned& state,
const Symbol& sigma, State_vector&
successors)
const
75 if (state < symbol_list.size() && std::equal_to<Symbol>()(symbol_list[state], sigma))
76 successors.push_back(state+1);
79 void int_next_symbols(
const unsigned& state, Symbol_vector& symbols)
const {
80 if (state < symbol_list.size())
81 symbols.push_back(symbol_list[state]);
84 inline const printer_base<Symbol>& symbol_printer()
const {
return symbol_printer_; }
86 inline bool int_is_epsilon(
const Symbol& symbol)
const {
return false; }
The main namespace of the library.
Definition: antichain_algo.h:40
This automaton represents accepts exactly one word.
Definition: list_automaton.h:44
list_automaton(InputIterator first, InputIterator last, const printer_base< Symbol > &symbol_printer=printer< Symbol >())
Constructs an automaton that accepts a specified word.
Definition: list_automaton.h:65
void successors(const unsigned &state, const Symbol &sigma, State_vector &successors1) const
Returns the successor for a specific state.
Definition: automaton.h:201
Automata need to inherit from this class and implement certain methods.
Definition: automaton.h:49