00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH
00019 # define VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH
00020
00021
00022 # include <string>
00023
00024 # include <vaucanson/algebra/implementation/monoid/free_monoid.hh>
00025 # include <vaucanson/algebra/implementation/alphabets/alphabet_set.hh>
00026
00027 namespace vcsn {
00028
00029 namespace algebra {
00030
00031
00032
00033
00034
00035 template <typename A>
00036 std::pair<bool, int>
00037 op_parse(const FreeMonoid<A>& s,
00038 std::basic_string<typename A::letter_t>& v,
00039 const std::string& in);
00040
00041 template <typename A>
00042 void
00043 op_in_mul(const algebra::FreeMonoid<A>& s,
00044 std::basic_string<typename A::letter_t>& dst,
00045 const std::basic_string<typename A::letter_t>& src);
00046
00047 template<typename A>
00048 std::basic_string<typename A::letter_t>
00049 op_mul(const algebra::FreeMonoid<A>& s,
00050 const std::basic_string<typename A::letter_t>& a,
00051 const std::basic_string<typename A::letter_t>& b);
00052
00053 template<typename A, typename St, typename U, typename V>
00054 St&
00055 op_rout(const FreeMonoid<A>& s,
00056 St& st,
00057 const std::basic_string<typename A::letter_t, U, V>& v);
00058
00059 template<typename A>
00060 const std::basic_string<typename A::letter_t>&
00061 identity_value(SELECTOR(algebra::FreeMonoid<A>),
00062 SELECTOR(std::basic_string<typename A::letter_t>));
00063
00064
00065 template<typename A>
00066 std::basic_string<typename A::letter_t>
00067 op_convert(SELECTOR(algebra::FreeMonoid<A>),
00068 SELECTOR(std::basic_string<typename A::letter_t>),
00069 const typename A::letter_t& c);
00070
00071 template<typename A, typename B, typename C, typename D>
00072 bool
00073 op_is_atom(const algebra::FreeMonoid<A>&,
00074 const std::basic_string<B, C, D>& v);
00075
00076
00077
00078
00079
00084 template <typename A>
00085 struct word_traits<FreeMonoid<A>,
00086 std::basic_string<typename A::letter_t> >
00087 {
00089 typedef A alphabet_t;
00090
00092 typedef Element<FreeMonoid<A>,
00093 std::basic_string<typename alphabet_t::letter_t> > word_t;
00094
00096 typedef typename word_t::value_t word_value_t;
00097
00099 typedef typename alphabet_traits<typename alphabet_t::set_t,
00100 typename alphabet_t::value_t>::
00101 first_projection_t first_projection_alphabet_t;
00102
00104 typedef typename alphabet_traits<typename alphabet_t::set_t,
00105 typename alphabet_t::value_t>::
00106 second_projection_t second_projection_alphabet_t;
00107
00109 typedef FreeMonoid<first_projection_alphabet_t> first_monoid_t;
00110
00112 typedef FreeMonoid<second_projection_alphabet_t> second_monoid_t;
00113
00115 typedef Element<first_monoid_t,
00116 std::basic_string<typename first_projection_alphabet_t::
00117 letter_t> > first_projection_t;
00118
00120 typedef typename first_projection_t::value_t first_projection_value_t;
00121
00123 typedef Element<second_monoid_t,
00124 std::basic_string<typename second_projection_alphabet_t::
00125 letter_t> > second_projection_t;
00126
00128 typedef typename second_projection_t::value_t second_projection_value_t;
00129
00131 static first_projection_t first_projection(const first_monoid_t&,
00132 const word_t&);
00133 static first_projection_value_t first_projection(const word_value_t&);
00134
00136 static second_projection_t second_projection(const second_monoid_t&,
00137 const word_t&);
00138 static second_projection_value_t second_projection(const word_value_t&);
00139 };
00140
00141 }
00142
00143 }
00144
00145 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00146 # include <vaucanson/algebra/implementation/monoid/str_words.hxx>
00147 # endif // ! VCSN_USE_INTERFACE_ONLY
00148
00149 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_MONOID_STR_WORDS_HH