00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HH
00018 # define VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HH
00019
00030 # include <vaucanson/automata/concept/automata_base.hh>
00031
00032 namespace vcsn {
00033
00034 #define AutoType(Type) \
00035 typename Element<S, T>::Type
00036
00040
00041
00042
00044 template<typename S, typename R, typename T>
00045 R op_convert(const AutomataBase<S> &se,
00046 SELECTOR(R), const T& data);
00047
00048 template<typename S, typename T>
00049 const T& op_convert(const AutomataBase<S>&,
00050 SELECTOR(T), const T& from_data);
00051
00053 template<typename S, typename T, typename U>
00054 void
00055 op_assign(const AutomataBase<S>& s,
00056 T& dst, const U& src);
00057
00058 template<typename S, typename T>
00059 void
00060 op_assign(const AutomataBase<S>& concept, T& dst, const T& src);
00061
00062 template <class S, class T>
00063 const typename automaton_traits<T>::tag_t&
00064 op_get_tag(const AutomataBase<S>&, const T&);
00065
00066 template <class S, class T>
00067 typename automaton_traits<T>::tag_t&
00068 op_get_tag(const AutomataBase<S>&, T&);
00069
00070 template <class S, class T>
00071 const typename automaton_traits<T>::geometry_t&
00072 op_get_geometry(const AutomataBase<S>&, const T&);
00073
00074 template <class S, class T>
00075 typename automaton_traits<T>::geometry_t&
00076 op_get_geometry(const AutomataBase<S>&, T&);
00077
00078 template <class S, class T>
00079 bool
00080 op_exists(const AutomataBase<S>& s, const T&);
00081
00082 template <class S, class T>
00083 typename automaton_traits<T>::states_t
00084 op_states(const AutomataBase<S>&, const T&);
00085
00086 template <class S, class T>
00087 typename automaton_traits<T>::hstate_t
00088 op_get_state(const AutomataBase<S>&, const T&, int state);
00089
00090 template <class S, class T>
00091 typename automaton_traits<T>::transitions_t
00092 op_transitions(const AutomataBase<S>&, const T&);
00093
00094 template <class S, class T>
00095 typename automaton_traits<T>::initial_support_t
00096 op_initial(const AutomataBase<S>&, const T&);
00097
00098 template <class S, class T>
00099 typename automaton_traits<T>::final_support_t
00100 op_final(const AutomataBase<S>&, const T&);
00101
00102 template <class S, class T>
00103 void
00104 op_set_initial(const AutomataBase<S>&, T&,
00105 const typename automaton_traits<T>::hstate_t& state,
00106 const AutoType(series_set_elt_t)& s);
00107
00108 template <class S, class T>
00109 AutoType(series_set_elt_t)
00110 op_get_initial(const AutomataBase<S>&,
00111 const T&,
00112 const typename automaton_traits<T>::hstate_t& state);
00113
00114 template <class S, class T>
00115 bool
00116 op_is_initial(const AutomataBase<S>&,
00117 const T&,
00118 const typename automaton_traits<T>::hstate_t& state);
00119
00120 template <class S, class T>
00121 void
00122 op_set_final(const AutomataBase<S>&, T&,
00123 const typename automaton_traits<T>::hstate_t& state,
00124 const typename Element<S, T>::series_set_elt_t& s);
00125
00126 template <class S, class T>
00127 typename Element<S, T>::series_set_elt_t
00128 op_get_final(const AutomataBase<S>&,
00129 const T&,
00130 const typename automaton_traits<T>::hstate_t& state);
00131
00132 template <class S, class T>
00133 bool
00134 op_is_final(const AutomataBase<S>&,
00135 const T&,
00136 const typename automaton_traits<T>::hstate_t& state);
00137
00138 template <class S, class T>
00139 void
00140 op_set_initial(const AutomataBase<S>&, T&,
00141 int state,
00142 const AutoType(series_set_elt_t)& s);
00143
00144 template <class S, class T>
00145 AutoType(series_set_elt_t)
00146 op_get_initial(const AutomataBase<S>&,
00147 const T&,
00148 int state);
00149
00150 template <class S, class T>
00151 bool
00152 op_is_initial(const AutomataBase<S>&,
00153 const T&,
00154 int state);
00155
00156 template <class S, class T>
00157 void
00158 op_set_final(const AutomataBase<S>&, T&,
00159 int state,
00160 const typename Element<S, T>::series_set_elt_t& s);
00161
00162 template <class S, class T>
00163 typename Element<S, T>::series_set_elt_t
00164 op_get_final(const AutomataBase<S>&,
00165 const T&,
00166 int state);
00167
00168 template <class S, class T>
00169 bool
00170 op_is_final(const AutomataBase<S>&,
00171 const T&,
00172 int state);
00173
00174 template <class S, class T>
00175 void
00176 op_clear_initial(const AutomataBase<S>&, T&);
00177
00178 template <class S, class T>
00179 void
00180 op_clear_final(const AutomataBase<S>&, T&);
00181
00182 template <class S, class T>
00183 typename automaton_traits<T>::hstate_t
00184 op_add_state(const AutomataBase<S>&, T&);
00185
00186 template <class S, class T>
00187 typename automaton_traits<T>::hstate_t
00188 op_choose_state(const AutomataBase<S>&, T&);
00189
00190 template <class S, class T>
00191 typename automaton_traits<T>::htransition_t
00192 op_add_transition(const AutomataBase<S>&, T&,
00193 const typename automaton_traits<T>::hstate_t& from,
00194 const typename automaton_traits<T>::hstate_t& to,
00195 const typename Element<S, T>::label_t& label);
00196
00197 template<class S, class T>
00198 typename automaton_traits<T>::htransition_t
00199 op_add_weighted_transition(const AutomataBase<S>&, T&,
00200 const typename automaton_traits<T>::hstate_t& from,
00201 const typename automaton_traits<T>::hstate_t& to,
00202 const typename Element<S, T>::semiring_elt_t& w,
00203 const typename Element<S, T>::monoid_elt_value_t& m);
00204
00205 template <class S, class T>
00206 typename automaton_traits<T>::htransition_t
00207 op_add_series_transition(const AutomataBase<S>&, T&,
00208 const typename automaton_traits<T>::hstate_t& from,
00209 const typename automaton_traits<T>::hstate_t& to,
00210 const typename Element<S, T>::series_set_elt_t&);
00211
00212 template <class S, class T>
00213 typename automaton_traits<T>::htransition_t
00214 op_add_spontaneous(const AutomataBase<S>&, T&,
00215 const typename automaton_traits<T>::hstate_t& from,
00216 const typename automaton_traits<T>::hstate_t& to,
00217 const typename Element<S, T>::semiring_elt_t&);
00218
00219 template <class S, class T>
00220 typename automaton_traits<T>::htransition_t
00221 op_add_letter_transition(const AutomataBase<S>&, T&,
00222 const typename automaton_traits<T>::hstate_t& from,
00223 const typename automaton_traits<T>::hstate_t& to,
00224 const typename Element<S, T>::letter_t&);
00225
00226 template <class S, class T>
00227 typename automaton_traits<T>::htransition_t
00228 op_add_transition(const AutomataBase<S>&, T&,
00229 int from,
00230 int to,
00231 const typename Element<S, T>::label_t& label);
00232
00233 template<class S, class T>
00234 typename automaton_traits<T>::htransition_t
00235 op_add_weighted_transition(const AutomataBase<S>&, T&,
00236 int from,
00237 int to,
00238 const typename Element<S, T>::semiring_elt_t& w,
00239 const typename Element<S, T>::monoid_elt_value_t& m);
00240
00241 template <class S, class T>
00242 typename automaton_traits<T>::htransition_t
00243 op_add_series_transition(const AutomataBase<S>&, T&,
00244 int from,
00245 int to,
00246 const typename Element<S, T>::series_set_elt_t&);
00247
00248 template <class S, class T>
00249 typename automaton_traits<T>::htransition_t
00250 op_add_spontaneous(const AutomataBase<S>&, T&,
00251 int from,
00252 int to,
00253 const typename Element<S, T>::semiring_elt_t&);
00254
00255 template <class S, class T>
00256 typename automaton_traits<T>::htransition_t
00257 op_add_letter_transition(const AutomataBase<S>&, T&,
00258 int from,
00259 int to,
00260 const typename Element<S, T>::letter_t&);
00261
00262 template <class S, class T>
00263 void
00264 op_update(const AutomataBase<S>&, T&,
00265 const typename automaton_traits<T>::htransition_t&,
00266 const AutoType(label_t)& l);
00267
00268 template <class S, class T>
00269 void
00270 op_del_state(const AutomataBase<S>&, T&,
00271 const typename automaton_traits<T>::hstate_t&);
00272
00273 template <class S, class T>
00274 void
00275 op_del_state(const AutomataBase<S>&, T&,
00276 int);
00277
00278 template <class S, class T>
00279 void
00280 op_del_transition(const AutomataBase<S>&, T&,
00281 const typename automaton_traits<T>::htransition_t&);
00282
00283 template <class S, class T>
00284 bool
00285 op_has_state(const AutomataBase<S>&, const T&,
00286 const typename automaton_traits<T>::hstate_t&);
00287
00288 template <class S, class T>
00289 bool
00290 op_has_state(const AutomataBase<S>&, const T&,
00291 int);
00292
00293 template <class S, class T>
00294 bool
00295 op_has_transition(const AutomataBase<S>&, const T&,
00296 const typename automaton_traits<T>::htransition_t&);
00297
00298 template <class S, class T>
00299 typename automaton_traits<T>::hstate_t
00300 op_src_of(const AutomataBase<S>&, const T&,
00301 const typename automaton_traits<T>::htransition_t&);
00302
00303 template <class S, class T>
00304 typename automaton_traits<T>::hstate_t
00305 op_dst_of(const AutomataBase<S>&, const T&,
00306 const typename automaton_traits<T>::htransition_t&);
00307
00308 template <class S, class T>
00309 typename Element<S, T>::label_t
00310 op_label_of(const AutomataBase<S>&, const T&,
00311 const typename automaton_traits<T>::htransition_t&);
00312
00313 template <class S, class T>
00314 const typename Element<S, T>::series_set_elt_t
00315 op_series_of(const AutomataBase<S>&, const T&,
00316 const typename automaton_traits<T>::htransition_t&);
00317
00318 template <class S, class T>
00319 typename Element<S, T>::series_set_elt_value_t
00320 op_series_value_of(const AutomataBase<S>&, const T&,
00321 const typename automaton_traits<T>::htransition_t&);
00322
00323
00324 template <class S, class T>
00325 typename Element<S, T>::monoid_elt_t
00326 op_word_of(const AutomataBase<S>&, const T&,
00327 const typename automaton_traits<T>::htransition_t&);
00328
00329 template <class S, class T>
00330 typename Element<S, T>::semiring_elt_t
00331 op_weight_of(const AutomataBase<S>&, const T&,
00332 const typename automaton_traits<T>::htransition_t&);
00333
00334 template <class S, class T>
00335 typename Element<S, T>::monoid_elt_value_t
00336 op_word_value_of(const AutomataBase<S>&, const T&,
00337 const typename automaton_traits<T>::htransition_t&);
00338
00339 template <class S, class T>
00340 typename Element<S, T>::letter_t
00341 op_letter_of(const AutomataBase<S>&, const T&,
00342 const typename automaton_traits<T>::htransition_t&);
00343
00344 template <class S, class T>
00345 bool
00346 op_is_spontaneous(const AutomataBase<S>&, const T&,
00347 const typename automaton_traits<T>::htransition_t&);
00348
00350
00351
00352
00353
00354
00356 template <class S, class T,
00357 typename OutputIterator, typename Kind>
00358 void op_delta(const AutomataBase<S>&, const T&,
00359 OutputIterator res,
00360 const typename automaton_traits<T>::hstate_t& from,
00361 delta_kind::kind<Kind> k);
00362
00363 template <class S, class T,
00364 typename OutputIterator, typename Kind>
00365 void op_delta(const AutomataBase<S>&, const T&,
00366 OutputIterator res,
00367 int from,
00368 delta_kind::kind<Kind> k);
00369
00376 template <class S, class T,
00377 typename OutputIterator, typename L, typename Kind>
00378 void op_delta(const AutomataBase<S>&, const T&,
00379 OutputIterator res,
00380 const typename automaton_traits<T>::hstate_t& from,
00381 const L& query,
00382 delta_kind::kind<Kind> k);
00383
00384 template <class S, class T,
00385 typename OutputIterator, typename L, typename Kind>
00386 void op_delta(const AutomataBase<S>&, const T&,
00387 OutputIterator res,
00388 int from,
00389 const L& query,
00390 delta_kind::kind<Kind> k);
00391
00398 template <class S, class T,
00399 typename OutputIterator, typename L, typename Kind>
00400 void op_letter_delta(const AutomataBase<S>&, const T&,
00401 OutputIterator res,
00402 const typename automaton_traits<T>::hstate_t& from,
00403 const L& letter,
00404 delta_kind::kind<Kind> k);
00405
00406 template <class S, class T,
00407 typename OutputIterator, typename L, typename Kind>
00408 void op_letter_delta(const AutomataBase<S>&, const T&,
00409 OutputIterator res,
00410 int from,
00411 const L& letter,
00412 delta_kind::kind<Kind> k);
00413
00415 template <class S, class T,
00416 typename OutputIterator, typename Kind>
00417 void op_spontaneous_delta(const AutomataBase<S>&, const T&,
00418 OutputIterator res,
00419 const typename automaton_traits<T>::hstate_t& from,
00420 delta_kind::kind<Kind> k);
00421
00422 template <class S, class T,
00423 typename OutputIterator, typename Kind>
00424 void op_spontaneous_delta(const AutomataBase<S>&, const T&,
00425 OutputIterator res,
00426 int from,
00427 delta_kind::kind<Kind> k);
00428
00429
00430
00431
00432
00434 template <class S, class T,
00435 typename Container, typename Kind>
00436 void op_deltac(const AutomataBase<S>&, const T&,
00437 Container& res,
00438 const typename automaton_traits<T>::hstate_t& from,
00439 delta_kind::kind<Kind> k);
00440
00441 template <class S, class T,
00442 typename Container, typename Kind>
00443 void op_deltac(const AutomataBase<S>&, const T&,
00444 Container& res,
00445 int from,
00446 delta_kind::kind<Kind> k);
00447
00454 template <class S, class T,
00455 typename Container, typename L, typename Kind>
00456 void op_deltac(const AutomataBase<S>&, const T&,
00457 Container& res,
00458 const typename automaton_traits<T>::hstate_t& from,
00459 const L& query,
00460 delta_kind::kind<Kind> k);
00461
00462 template <class S, class T,
00463 typename Container, typename L, typename Kind>
00464 void op_deltac(const AutomataBase<S>&, const T&,
00465 Container& res,
00466 int from,
00467 const L& query,
00468 delta_kind::kind<Kind> k);
00469
00476 template <class S, class T,
00477 typename Container, typename L, typename Kind>
00478 void op_letter_deltac(const AutomataBase<S>&, const T&,
00479 Container& res,
00480 const typename automaton_traits<T>::hstate_t& from,
00481 const L& letter,
00482 delta_kind::kind<Kind> k);
00483
00484 template <class S, class T,
00485 typename Container, typename L, typename Kind>
00486 void op_letter_deltac(const AutomataBase<S>&, const T&,
00487 Container& res,
00488 int from,
00489 const L& letter,
00490 delta_kind::kind<Kind> k);
00491
00493 template <class S, class T, class Container, typename Kind>
00494 void op_spontaneous_deltac(const AutomataBase<S>&, const T&,
00495 Container& res,
00496 const typename automaton_traits<T>::hstate_t& from,
00497 delta_kind::kind<Kind> k);
00498
00499 template <class S, class T, class Container, typename Kind>
00500 void op_spontaneous_deltac(const AutomataBase<S>&, const T&,
00501 Container& res,
00502 int from,
00503 delta_kind::kind<Kind> k);
00504
00505
00506
00507
00508
00509
00510
00511
00512
00514 template<class S, class T, typename OutputIterator, typename Kind>
00515 void op_rdelta(const AutomataBase<S>&, const T&,
00516 OutputIterator res,
00517 const typename automaton_traits<T>::hstate_t& from,
00518 delta_kind::kind<Kind> k);
00519
00520 template<class S, class T, typename OutputIterator, typename Kind>
00521 void op_rdelta(const AutomataBase<S>&, const T&,
00522 OutputIterator res,
00523 int from,
00524 delta_kind::kind<Kind> k);
00525
00532 template<class S, class T, typename OutputIterator, typename L, typename Kind>
00533 void op_rdelta(const AutomataBase<S>&, const T&,
00534 OutputIterator res,
00535 const typename automaton_traits<T>::hstate_t& from,
00536 const L& query,
00537 delta_kind::kind<Kind> k);
00538
00539 template<class S, class T, typename OutputIterator, typename L, typename Kind>
00540 void op_rdelta(const AutomataBase<S>&, const T&,
00541 OutputIterator res,
00542 int from,
00543 const L& query,
00544 delta_kind::kind<Kind> k);
00545
00552 template<class S, class T, typename OutputIterator, typename L, typename Kind>
00553 void op_letter_rdelta(const AutomataBase<S>&, const T&,
00554 OutputIterator res,
00555 const typename automaton_traits<T>::hstate_t& from,
00556 const L& letter,
00557 delta_kind::kind<Kind> k);
00558
00559 template<class S, class T, typename OutputIterator, typename L, typename Kind>
00560 void op_letter_rdelta(const AutomataBase<S>&, const T&,
00561 OutputIterator res,
00562 int from,
00563 const L& letter,
00564 delta_kind::kind<Kind> k);
00565
00567 template<class S, class T, typename OutputIterator, typename Kind>
00568 void op_spontaneous_rdelta(const AutomataBase<S>&, const T&,
00569 OutputIterator res,
00570 const typename automaton_traits<T>::hstate_t& from,
00571 delta_kind::kind<Kind> k);
00572
00573 template<class S, class T, typename OutputIterator, typename Kind>
00574 void op_spontaneous_rdelta(const AutomataBase<S>&, const T&,
00575 OutputIterator res,
00576 int from,
00577 delta_kind::kind<Kind> k);
00578
00579
00580
00581
00582
00583
00585 template<class S, class T, typename Container, typename Kind>
00586 void op_rdeltac(const AutomataBase<S>&, const T&,
00587 Container& res,
00588 const typename automaton_traits<T>::hstate_t& from,
00589 delta_kind::kind<Kind> k);
00590
00591 template<class S, class T, typename Container, typename Kind>
00592 void op_rdeltac(const AutomataBase<S>&, const T&,
00593 Container& res,
00594 int from,
00595 delta_kind::kind<Kind> k);
00596
00603 template<class S, class T, typename Container, typename L, typename Kind>
00604 void op_rdeltac(const AutomataBase<S>&, const T&,
00605 Container& res,
00606 const typename automaton_traits<T>::hstate_t& from,
00607 const L& query,
00608 delta_kind::kind<Kind> k);
00609
00610 template<class S, class T, typename Container, typename L, typename Kind>
00611 void op_rdeltac(const AutomataBase<S>&, const T&,
00612 Container& res,
00613 int from,
00614 const L& query,
00615 delta_kind::kind<Kind> k);
00616
00623 template<class S, class T, typename Container, typename L, typename Kind>
00624 void op_letter_rdeltac(const AutomataBase<S>&, const T&,
00625 Container& res,
00626 const typename automaton_traits<T>::hstate_t& from,
00627 const L& letter,
00628 delta_kind::kind<Kind> k);
00629
00630 template<class S, class T, typename Container, typename L, typename Kind>
00631 void op_letter_rdeltac(const AutomataBase<S>&, const T&,
00632 Container& res,
00633 int from,
00634 const L& letter,
00635 delta_kind::kind<Kind> k);
00636
00638 template<class S, class T, typename Container, typename Kind>
00639 void op_spontaneous_rdeltac(const AutomataBase<S>&, const T&,
00640 Container& res,
00641 const typename automaton_traits<T>::hstate_t& from,
00642 delta_kind::kind<Kind> k);
00643
00644 template<class S, class T, typename Container, typename Kind>
00645 void op_spontaneous_rdeltac(const AutomataBase<S>&, const T&,
00646 Container& res,
00647 int from,
00648 delta_kind::kind<Kind> k);
00649
00650
00651
00652
00653
00657 }
00658
00659
00660 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00661 # include <vaucanson/automata/concept/automata_ops.hxx>
00662 # endif // VCSN_USE_INTERFACE_ONLY
00663
00664 #endif // ! VCSN_AUTOMATA_CONCEPT_AUTOMATA_OPS_HH