30 #ifndef __CLAW_AUTOMATON_HPP__ 31 #define __CLAW_AUTOMATON_HPP__ 55 template<
class State,
class Edge,
class StateComp = std::less<State>,
56 class EdgeComp = std::less<Edge> >
77 typedef std::map<state_type, neighbours_list, state_compare>
adjacent_list;
86 void add_edge(
const state_type& s1,
const state_type& s2,
88 void remove_edge(
const state_type& s1,
const state_type& s2,
91 void add_state(
const state_type& s );
92 void add_initial_state(
const state_type& s );
93 void add_final_state(
const state_type& s );
95 bool state_exists(
const state_type& s )
const;
96 bool state_is_final(
const state_type& s )
const;
97 bool state_is_initial(
const state_type& s )
const;
99 void states( result_state_list& v )
const;
100 void final_states( result_state_list& v )
const;
101 void initial_states( result_state_list& v )
const;
102 void alphabet( result_edge_list& v )
const;
104 template<
class InputIterator>
105 bool match(InputIterator
first, InputIterator last)
const;
107 unsigned int states_count()
const;
109 void reachables(
const state_type& s,
const edge_type& e,
110 result_state_list& l )
const;
111 void reachables(
const state_type& s,
112 result_state_list& l )
const;
114 void edges(
const state_type& s1,
const state_type& s2,
115 result_edge_list& l )
const;
116 void edges(
const state_type& s1,
const edge_type& edge,
117 result_edge_list& l )
const;
120 template<
class InputIterator>
121 bool match_aux(
const state_type& s, InputIterator
first,
122 InputIterator last)
const;
126 static state_compare s_state_compare;
138 adjacent_list m_states;
143 #include <claw/impl/automaton.tpp> 145 #endif // __CLAW_AUTOMATON_HPP__
std::multimap< edge_type, state_type, edge_compare > neighbours_list
The neighbours list associates states to edge symbols.
EdgeComp edge_compare
The type of the operator used to compare edge symbols.
Edge edge_type
The type of the symbols on the edges.
std::map< state_type, neighbours_list, state_compare > adjacent_list
Each state is given a set of reachable states with a neighbours list.
StateComp state_compare
The type of the operator used to compare states.
Fuction object to get the first element of a std::pair.
std::vector< state_type > result_state_list
The return type of the methods returning states.
Basic automaton structure.
State state_type
The type of the states.
std::vector< edge_type > result_edge_list
The return type of the methods returning edges.
This is the main namespace.