00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_CYCLIC_SEMIRING_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_CYCLIC_SEMIRING_HH
00019 
00020 # include <vaucanson/algebra/concept/cyclic_semiring.hh>
00021 
00022 namespace vcsn {
00023 
00024   namespace algebra {
00025 
00026     
00027     
00028 
00029     
00030 
00031 
00032     template<unsigned int n, typename T>
00033     T identity_value(SELECTOR(algebra::CyclicSemiring<n>),
00034                      SELECTOR(T));
00035 
00036     template<unsigned int n, typename T>
00037     bool show_identity_value(SELECTOR(algebra::CyclicSemiring<n>),
00038                              SELECTOR(T));
00039 
00040     template<unsigned int n, typename T>
00041     bool
00042     is_positive_semiring(SELECTOR(algebra::CyclicSemiring<n>), SELECTOR(T));
00043 
00044     template<unsigned int n, typename T>
00045     T zero_value(SELECTOR(algebra::CyclicSemiring<n>),
00046                  SELECTOR(T));
00047 
00048     template<unsigned int n, typename T>
00049     T zero_value(SELECTOR(algebra::CyclicSemiring<n>),
00050                  SELECTOR(T));
00051 
00052     
00053 
00054 
00055     template<unsigned int n, typename T>
00056     bool op_contains(const algebra::CyclicSemiring<n>& s, T c);
00057 
00058     
00059 
00060 
00061     template<unsigned int n, typename T, typename U>
00062     void op_in_mul(const algebra::CyclicSemiring<n>& s1,
00063                    T& dst, U arg);
00064 
00065     template<unsigned int n, typename T, typename U>
00066     T op_mul(const algebra::CyclicSemiring<n>& s, T a, U b);
00067 
00068     
00069 
00070 
00071 
00072     template<>
00073     void op_in_mul<2, bool, bool>(const algebra::CyclicSemiring<2>&,
00074                                   bool& dst, bool arg);
00075 
00076     template<>
00077     bool op_mul<2, bool, bool>(const algebra::CyclicSemiring<2>&, bool a, bool b);
00078 
00079     
00080 
00081 
00082     template<unsigned int n, typename T, typename U>
00083     void op_in_add(const algebra::CyclicSemiring<n>& s1,
00084                    T& dst, U arg);
00085 
00086     template<unsigned int n, typename T, typename U>
00087     T op_add(const algebra::CyclicSemiring<n>& s,
00088              T a, U b);
00089 
00090     
00091 
00092 
00093 
00094     template<>
00095     void op_in_add<2, bool, bool>(const algebra::CyclicSemiring<2>&,
00096                                   bool& dst, bool arg);
00097 
00098     template<>
00099     bool op_add<2, bool, bool>(const algebra::CyclicSemiring<2>&, bool a, bool b);
00100 
00101     
00102 
00103 
00104 
00105     template<unsigned int n, typename T, typename U>
00106     void op_in_div(const algebra::CyclicSemiring<n>& s1,
00107                    T& dst, U arg);
00108 
00109     template<unsigned int n, typename T, typename U>
00110     T op_div(const algebra::CyclicSemiring<n>& s, T a, U b);
00111 
00112     
00113 
00114 
00115 
00116     template<>
00117     void op_in_div<2, bool, bool> (const algebra::CyclicSemiring<2>& s1,
00118                                    bool& dst, bool arg);
00119 
00120     template<>
00121     bool op_div<2, bool, bool> (const algebra::CyclicSemiring<2>& s, bool a, bool b);
00122 
00123     
00124 
00125 
00126 
00127     template<unsigned int n, typename T, typename U>
00128     void op_in_sub(const algebra::CyclicSemiring<n>& s1,
00129                    T& dst, U arg);
00130 
00131     template<unsigned int n, typename T, typename U>
00132     T op_sub(const algebra::CyclicSemiring<n>& s,
00133              T a, U b);
00134 
00135     
00136 
00137 
00138 
00139     template<>
00140     void op_in_sub<2, bool, bool> (const algebra::CyclicSemiring<2>& s1,
00141                                    bool& dst, bool arg);
00142 
00143     template<>
00144     bool op_sub(const algebra::CyclicSemiring<2>& s,
00145                 bool a, bool b);
00146 
00147     
00148 
00149 
00150     template <unsigned int n, typename T>
00151     bool
00152     op_starable(const algebra::CyclicSemiring<n>&, T b);
00153 
00154     template <unsigned int n, class T>
00155     void
00156     op_in_star(const algebra::CyclicSemiring<n>& s, T& b);
00157 
00158     template <unsigned int n, class T>
00159     Element<algebra::CyclicSemiring<n>, T>
00160     op_choose(const algebra::CyclicSemiring<n>& set, SELECTOR(T));
00161 
00162     template <unsigned int n, typename T>
00163     bool
00164     op_can_choose_non_starable(const algebra::CyclicSemiring<n>&
00165                                set, SELECTOR(T));
00166 
00167     template <unsigned int n, typename T>
00168     Element<algebra::CyclicSemiring<n>, T>
00169     op_choose_starable(const algebra::CyclicSemiring<n>& set,
00170                        SELECTOR(T));
00171 
00172     template <unsigned int n, typename T>
00173     Element<algebra::CyclicSemiring<n>, T>
00174     op_choose_non_starable(const algebra::CyclicSemiring<n>& set,
00175                            SELECTOR(T));
00176 
00177     
00178 
00179 
00180     template<unsigned int n, typename St, typename T>
00181     St& op_rout(const algebra::CyclicSemiring<n>& s,
00182                 St& st, const T& v);
00183 
00184   } 
00185 
00186 } 
00187 
00188 
00189 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00190 #  include <vaucanson/algebra/implementation/semiring/cyclic_semiring.hxx>
00191 # endif // VCSN_USE_INTERFACE_ONLY
00192 
00193 
00194 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SEMIRING_CYCLIC_SEMIRING_HH