series.hh

00001 // series.hh: this file is part of the Vaucanson project.
00002 //
00003 // Vaucanson, a generic library for finite state machines.
00004 //
00005 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 The Vaucanson Group.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
00016 //
00017 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH
00018 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH
00019 
00020 #include <vaucanson/algebra/concept/series_base.hh>
00021 #include <vaucanson/design_pattern/slots.hh>
00022 
00023 
00024 namespace vcsn {
00025 
00026   namespace algebra {
00027 
00028     /*-------------------------.
00029     | Series<Semiring, Monoid> |
00030     `-------------------------*/
00031 
00032     struct semiring_slot_tag {};
00033     struct monoid_slot_tag {};
00034 
00036     template<typename Semiring, typename Monoid>
00037     struct Series
00038       : SeriesBase<Series<Semiring, Monoid> >,
00039         private SetSlot<Semiring, semiring_slot_tag>,
00040         private SetSlot<Monoid, monoid_slot_tag>
00041     {
00042       Series(const Semiring& w, const Monoid& m);
00043       Series(const Series& other);
00044 
00045       const Semiring&   semiring() const;
00046 
00047       const Monoid&     monoid() const;
00048 
00049     };
00050 
00051     template<typename W, typename M>
00052     bool operator==(const Series<W, M>&,
00053                     const Series<W, M>&);
00054 
00055 
00056     template <class W, class M, class NewW, class NewM>
00057     struct mute_series_traits<Series<W, M>, NewW, NewM >
00058     {
00059       typedef Series<NewW, NewM> ret;
00060     };
00061 
00062     template <class W, class M, class NewW, class NewM>
00063     typename mute_series_traits<Series<W, M>, NewW, NewM >::ret
00064     mute_series(const Series<W, M>& s, const NewW& w, const NewM& m);
00065 
00066   } // algebra
00067 
00068   /*-----------------------------.
00069   | MetaElement<Series<W, M>, T> |
00070   `-----------------------------*/
00071 
00073   template <class W, class M, class T>
00074   struct MetaElement<algebra::Series<W, M>, T> :
00075     public MetaElement<algebra::SeriesBase<algebra::Series<W, M> >, T>
00076   { };
00077 
00078   /*-----------------------------.
00079   | dynamic_traits<Series<W, M>> |
00080   `-----------------------------*/
00081 
00083   template<typename W, typename M>
00084   struct dynamic_traits<algebra::Series<W, M> >
00085     : dynamic_traits<algebra::SeriesBase<algebra::Series<W, M> > >
00086   {
00087     static const bool ret =
00088       dynamic_traits<W>::ret || dynamic_traits<M>::ret;
00089 
00090   };
00091 
00092   /*----------------------------.
00093   | virtual_types<Series<W, N>> |
00094   `----------------------------*/
00095 
00097   template<typename W, typename M>
00098   struct virtual_types<algebra::Series<W, M> >
00099     : virtual_types<algebra::SeriesBase<algebra::Series<W, M> > >
00100   {
00101     typedef algebra::mul_kind semigroup_kind;
00102 
00103     typedef W semiring_t;
00104     typedef M monoid_t;
00105   };
00106 
00107 } // vcsn
00108 
00109 
00110 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00111 # include <vaucanson/algebra/implementation/series/series.hxx>
00112 #endif // VCSN_USE_INTERFACE_ONLY
00113 
00114 
00115 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_SERIES_HH

Generated on Sun Jul 29 19:35:29 2007 for Vaucanson by  doxygen 1.5.2