17 #ifndef VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HXX
18 # define VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HXX
24 # include <vaucanson/algebra/concept/series_base.hh>
28 #define AutoType(Type) \
29 typename Element<S, T>::Type
31 template<
typename S,
typename T,
typename U>
35 dst = op_convert(concept, dst, src);
38 template<
typename S,
typename T>
45 template<
typename S,
typename T>
52 template<
typename S,
typename R,
typename T>
56 typedef typename automaton_traits<R>::hstate_t dst_hstate_t;
57 typedef typename automaton_traits<T>::hstate_t src_hstate_t;
58 typedef typename automaton_traits<T>::transition_iterator transition_iterator;
59 typedef typename automaton_traits<T>::final_iterator final_iterator;
60 typedef typename automaton_traits<T>::initial_iterator initial_iterator;
61 typedef typename automaton_traits<T>::state_iterator state_iterator;
64 std::map<src_hstate_t, dst_hstate_t> states_map;
67 for (state_iterator s =
op_states(concept, src).begin(),
68 s_end =
op_states(concept, src).end(); s != s_end; ++s)
81 for (initial_iterator i =
op_initial(concept, src).begin(),
82 i_end =
op_initial(concept, src).end(); i != i_end; ++i)
89 for (final_iterator f =
op_final(concept, src).begin(),
90 f_end =
op_final(concept, src).end(); f != f_end; ++f)
102 template <
class S,
class T>
103 const typename automaton_traits<T>::tag_t&
109 template <
class S,
class T>
110 typename automaton_traits<T>::tag_t&
116 template <
class S,
class T>
117 const typename automaton_traits<T>::geometry_t&
123 template <
class S,
class T>
124 typename automaton_traits<T>::geometry_t&
130 template <
class S,
class T>
137 template <
class S,
class T>
138 typename automaton_traits<T>::states_t
144 template <
class S,
class T>
145 typename automaton_traits<T>::hstate_t
148 return v.get_state(state);
151 template <
class S,
class T>
152 typename automaton_traits<T>::transitions_t
158 template <
class S,
class T>
159 typename automaton_traits<T>::initial_support_t
165 template <
class S,
class T>
166 typename automaton_traits<T>::final_support_t
172 template <
class S,
class T>
175 const typename automaton_traits<T>::hstate_t& state,
176 const AutoType(series_set_elt_t)& s)
183 SELECT(series_set_elt_value_t)));
186 template <
class S,
class T>
187 typename Element<S, T>::series_set_elt_t
190 const typename automaton_traits<T>::hstate_t& state)
196 SELECT(AutoType(series_set_elt_value_t)))));
199 template <
class S,
class T>
203 const typename automaton_traits<T>::hstate_t& state)
205 return v.is_initial(state, zero_value(s.
series(),
206 SELECT(AutoType(series_set_elt_value_t))));
209 template <
class S,
class T>
212 const typename automaton_traits<T>::hstate_t& state,
218 SELECT(AutoType(series_set_elt_value_t))));
221 template <
class S,
class T>
225 const AutoType(series_set_elt_t)& s)
230 template <
class S,
class T>
231 typename Element<S, T>::series_set_elt_t
239 template <
class S,
class T>
248 template <
class S,
class T>
257 template <
class S,
class T>
258 typename Element<S, T>::series_set_elt_t
261 const typename automaton_traits<T>::hstate_t& state)
267 SELECT(AutoType(series_set_elt_value_t)))));
270 template <
class S,
class T>
271 typename Element<S, T>::series_set_elt_t
279 template <
class S,
class T>
283 const typename automaton_traits<T>::hstate_t& state)
285 return v.is_final(state, zero_value(s.
series(),
286 SELECT(AutoType(series_set_elt_value_t))));
289 template <
class S,
class T>
298 template <
class S,
class T>
302 return v.clear_initial();
305 template <
class S,
class T>
309 return v.clear_final();
312 template <
class S,
class T>
313 typename automaton_traits<T>::hstate_t
316 return v.add_state();
319 template <
class S,
class T>
320 typename automaton_traits<T>::hstate_t
323 typedef typename automaton_traits<T>::states_t states_t;
324 typedef typename states_t::const_iterator state_iterator;
326 assertion(st.size() > 0);
328 state_iterator ss = st.begin();
334 template <
class S,
class T>
335 typename automaton_traits<T>::htransition_t
337 const typename automaton_traits<T>::hstate_t& from,
338 const typename automaton_traits<T>::hstate_t& to,
341 return v.add_edge(from, to, label);
344 template <
class S,
class T>
345 typename automaton_traits<T>::htransition_t
355 template<
class S,
class T>
356 typename automaton_traits<T>::htransition_t
358 const typename automaton_traits<T>::hstate_t& from,
359 const typename automaton_traits<T>::hstate_t& to,
364 series.assoc(m, w.
value());
368 template<
class S,
class T>
369 typename automaton_traits<T>::htransition_t
380 template <
class S,
class T>
381 typename automaton_traits<T>::htransition_t
383 const typename automaton_traits<T>::hstate_t& from,
384 const typename automaton_traits<T>::hstate_t& to,
390 template <
class S,
class T>
391 typename automaton_traits<T>::htransition_t
401 template <
class S,
class T>
402 typename automaton_traits<T>::htransition_t
404 const typename automaton_traits<T>::hstate_t& from,
405 const typename automaton_traits<T>::hstate_t& to,
408 AutoType(series_set_elt_t) ss(s.
series());
409 ss.assoc(algebra::identity_as<AutoType(monoid_elt_value_t)>::
410 of(s.
series().monoid()), w);
414 template <
class S,
class T>
415 typename automaton_traits<T>::htransition_t
425 template <
class S,
class T>
426 typename automaton_traits<T>::htransition_t
428 const typename automaton_traits<T>::hstate_t& from,
429 const typename automaton_traits<T>::hstate_t& to,
435 template <
class S,
class T>
436 typename automaton_traits<T>::htransition_t
446 template <
class S,
class T>
449 const typename automaton_traits<T>::htransition_t& e,
450 const AutoType(label_t)& l)
456 template <
class S,
class T>
459 const typename automaton_traits<T>::hstate_t& s)
464 template <
class S,
class T>
472 template <
class S,
class T>
475 const typename automaton_traits<T>::htransition_t& e)
480 template <
class S,
class T>
483 const typename automaton_traits<T>::hstate_t& s)
485 return v.has_state(s);
488 template <
class S,
class T>
496 template <
class S,
class T>
499 const typename automaton_traits<T>::htransition_t& e)
501 return v.has_edge(e);
504 template <
class S,
class T>
505 typename automaton_traits<T>::hstate_t
507 const typename automaton_traits<T>::htransition_t& e)
512 template <
class S,
class T>
513 typename automaton_traits<T>::hstate_t
515 const typename automaton_traits<T>::htransition_t& e)
520 template <
class S,
class T>
521 typename Element<S, T>::label_t
523 const typename automaton_traits<T>::htransition_t& e)
525 return v.label_of(e);
528 template <
class S,
class T>
529 const typename Element<S, T>::series_set_elt_t
531 const typename automaton_traits<T>::htransition_t& e)
538 template <
class S,
class T>
539 typename Element<S, T>::series_set_elt_value_t
541 const typename automaton_traits<T>::htransition_t& e)
546 template <
class S,
class T>
547 typename Element<S, T>::monoid_elt_t
549 const typename automaton_traits<T>::htransition_t& e)
556 template <
class S,
class T>
557 typename Element<S, T>::semiring_elt_t
559 const typename automaton_traits<T>::htransition_t& e)
564 template <
class S,
class T>
565 typename Element<S, T>::monoid_elt_value_t
567 const typename automaton_traits<T>::htransition_t& e)
572 template <
class S,
class T>
573 typename Element<S, T>::letter_t
575 const typename automaton_traits<T>::htransition_t& e)
577 return v.label_of(e);
580 template <
class S,
class T>
583 const typename automaton_traits<T>::htransition_t& e)
586 algebra::identity_as<AutoType(series_set_elt_value_t)>::of(s.
series()));
593 #endif // ! VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HXX