00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_ALGORITHMS_PAIR_TO_FMP_HH
00018 # define VCSN_ALGORITHMS_PAIR_TO_FMP_HH
00019 
00020 # include <map>
00021 # include <utility>
00022 
00023 # include <vaucanson/automata/concept/automata.hh>
00024 # include <vaucanson/algebra/concept/freemonoid_product.hh>
00025 # include <vaucanson/algebra/implementation/alphabets/alphabet_set.hh>
00026 # include <vaucanson/algebra/implementation/monoid/free_monoid.hh>
00027 
00028 
00029 # include <vaucanson/algebra/implementation/monoid/pair_str_words.hh>
00030 
00044 
00045 
00046 
00047 namespace vcsn
00048 {
00051 
00052 
00053 
00054 
00055   
00056   template <typename S, typename T>
00057   struct mute_pair_to_fmp
00058   {
00059     
00060     typedef Element<S, T> automaton_t;
00061 
00062     
00063     typedef typename automaton_t::monoid_elt_t monoid_elt_t;
00064 
00065     
00066     typedef typename monoid_elt_t::set_t::alphabet_t alphabet_t;
00067 
00068     
00069     typedef algebra::alphabet_traits<typename alphabet_t::set_t,
00070               typename alphabet_t::value_t> alphabet_traits_t;
00071 
00072     
00073     typedef algebra::word_traits<typename monoid_elt_t::set_t,
00074               typename monoid_elt_t::value_t> word_traits_t;
00075 
00076     
00077     typedef typename word_traits_t::first_monoid_t first_monoid_t;
00078 
00079     
00080     typedef typename word_traits_t::second_monoid_t second_monoid_t;
00081 
00082     
00083     typedef typename automaton_t::semiring_t semiring_t;
00084 
00085     
00086     typedef typename first_monoid_t::alphabet_t ret_first_alphabet_t;
00087 
00088     
00089     typedef typename second_monoid_t::alphabet_t ret_second_alphabet_t;
00090 
00091     
00092 
00093     
00094     typedef algebra::FreeMonoidProduct<first_monoid_t,
00095                                        second_monoid_t> ret_monoid_t;
00096 
00097     
00098     typedef std::pair<typename word_traits_t::first_projection_t::value_t,
00099                       typename word_traits_t::second_projection_t::value_t>
00100         ret_word_impl_t;
00101 
00102     
00103     typedef Element<ret_monoid_t, ret_word_impl_t> ret_monoid_elt_t;
00104 
00105     
00106 
00107     
00108     typedef typename algebra::
00109         mute_series_traits<typename automaton_t::series_set_t,
00110                            typename automaton_t::semiring_t,
00111                            ret_monoid_t>::ret
00112         ret_series_set_t;
00113     typedef Automata<ret_series_set_t, typename automaton_t::kind_t> ret_set_t;
00114 
00115     
00116     typedef typename mute_graph_impl_monoid_traits<typename automaton_t::
00117         value_t, ret_word_impl_t, undefined_type>::ret ret_impl_t;
00118 
00119     
00120     typedef Element<ret_set_t, ret_impl_t> ret;
00121 
00122     
00123     static ret
00124     make_automaton(const ret_first_alphabet_t&, const ret_second_alphabet_t&);
00125 
00126     static ret
00127     make_automaton(const automaton_t&);
00128 
00129     
00130     static typename ret::series_set_elt_t
00131     series_convert(const ret_series_set_t&,
00132                    const typename automaton_t::series_set_elt_t&);
00133   };
00134 
00135   template <typename S, typename T>
00136   void
00137   pair_to_fmp(const Element<S, T>& aut,
00138               typename mute_pair_to_fmp<S, T>::ret& res);
00139 
00140   template <typename S, typename T>
00141   typename mute_pair_to_fmp<S, T>::ret
00142   pair_to_fmp(const Element<S, T>& aut);
00143 
00145 
00148 } 
00149 
00150 # if !defined VCSN_USE_INTERFACE_ONLY && !defined VCSN_USE_LIB
00151 #  include <vaucanson/algorithms/pair_to_fmp.hxx>
00152 # endif // ! VCSN_USE_INTERFACE_ONLY
00153 
00154 #endif // ! VCSN_ALGORITHMS_PAIR_TO_FMP_HH