00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH
00019 # define VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH
00020 
00021 # include <vaucanson/algebra/concept/semigroup_base.hh>
00022 
00023 namespace vcsn {
00024 
00025   namespace algebra {
00026 
00030     
00031 
00032 
00033 
00040     template<class Self>
00041     struct MonoidBase : SemigroupBase<Self>
00042     {
00044       template<typename T>
00045       Element<Self, T> identity(SELECTOR(T)) const;
00046 
00048       template<typename T>
00049       Element<Self, T> zero(SELECTOR(T)) const;
00050 
00051     protected:
00053       MonoidBase();
00054 
00056       MonoidBase(const MonoidBase& other);
00057     };
00058 
00059     template <class T>
00060     struct identity_as
00061     {
00062       template <class S>
00063       static
00064       Element<S, T> of(const S& s);
00065     };
00066 
00067     template <class T>
00068     struct zero_as
00069     {
00070       template <class S>
00071       static
00072       Element<S, T> of(const S& s);
00073     };
00074 
00075     
00076 
00077 
00078 
00084     template <typename S, typename T>
00085     struct word_traits
00086     {
00088       typedef undefined_type alphabet_t;
00089 
00091       typedef undefined_type word_t;
00092 
00094       typedef undefined_type first_monoid_t;
00095 
00097       typedef undefined_type second_monoid_t;
00098 
00100       typedef undefined_type first_projection_t;
00101 
00103       typedef undefined_type second_projection_t;
00104     };
00105 
00109   } 
00110    
00114   
00115 
00116 
00117 
00118   template<class Self>
00119   struct dynamic_traits<algebra::MonoidBase<Self> >
00120     : dynamic_traits<algebra::SemigroupBase<Self> >
00121   { };
00122 
00123   template<typename S>
00124   struct virtual_types<algebra::MonoidBase<S> >
00125     : virtual_types<algebra::SemigroupBase<S> >
00126   { };
00127 
00128   
00129 
00130 
00131 
00133   template<class Self, typename T>
00134   struct MetaElement<algebra::MonoidBase<Self>, T>
00135     : MetaElement<algebra::SemigroupBase<Self>, T>
00136   {
00137   protected:
00139     MetaElement();
00140 
00142     MetaElement(const MetaElement& other);
00143   };
00144 
00148   namespace algebra {
00149 
00150     template<typename T, typename Self>
00151     T op_default(SELECTOR(algebra::MonoidBase<Self>), SELECTOR(T));
00152 
00153   } 
00154 
00155 } 
00156 
00157 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00158 #  include <vaucanson/algebra/concept/monoid_base.hxx>
00159 # endif // VCSN_USE_INTERFACE_ONLY
00160 
00161 #endif // ! VCSN_ALGEBRA_CONCEPT_MONOID_BASE_HH