17 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_HH
22 # include <vaucanson/algebra/implementation/series/series.hh>
23 # include <vaucanson/algebra/implementation/series/rat/exp.hh>
24 # include <vaucanson/algebra/implementation/series/rat/dump_visitor.hh>
34 template<
typename Tm,
typename Tw>
35 struct series_traits<rat::exp<Tm, Tw> >
37 typedef Tm monoid_elt_value_t;
38 typedef Tw semiring_elt_value_t;
39 typedef std::list<monoid_elt_value_t> support_t;
42 template <
class Tm,
class Tw,
class W,
class M>
43 struct mute_series_impl<rat::exp<Tm, Tw>, W, M>
45 typedef rat::exp<M, W> ret;
53 template<
typename W,
typename M,
typename Tm,
typename Tw>
54 struct MetaElement<algebra::Series<W, M>, rat::exp<Tm, Tw> >
55 :
MetaElement<algebra::SeriesBase<algebra::Series<W, M> >,
58 static const bool dynamic_value =
true;
60 void accept(
const rat::ConstNodeVisitor<Tm, Tw>& v)
const;
67 template<
typename W,
typename M,
typename Tm,
typename Tw>
68 bool op_contains(
const algebra::Series<W, M>& s,
69 const rat::exp<Tm, Tw>& m);
71 template<
typename W,
typename M,
typename Tm,
typename Tw>
72 bool op_is_finite_app(
const algebra::Series<W, M>& s,
73 const rat::exp<Tm, Tw>& m);
75 template <
typename W,
typename M,
typename Tm,
typename Tw>
76 Tm op_choose_from_supp(
const algebra::Series<W, M>& s,
77 const rat::exp<Tm, Tw>& m);
79 template<
typename W,
typename M,
typename Tm,
typename Tw>
80 const rat::exp<Tm, Tw>& identity_value(
SELECTOR2(algebra::Series<W, M>),
83 template<
typename W,
typename M,
typename Tm,
typename Tw>
84 bool show_identity_value(
SELECTOR2(algebra::Series<W, M>),
88 template<
typename W,
typename M,
typename Tm,
typename Tw>
89 const rat::exp<Tm, Tw>& zero_value(
SELECTOR2(algebra::Series<W, M>),
93 template<
typename W,
typename M,
typename Tm,
typename Tw>
94 void op_in_add(
const algebra::Series<W, M>& s,
95 rat::exp<Tm, Tw>& dst,
96 const rat::exp<Tm, Tw>& arg);
98 template<
typename W,
typename M,
typename Tm,
typename Tw>
99 rat::exp<Tm, Tw> op_mul(
const algebra::Series<W, M>& s,
100 const rat::exp<Tm, Tw>& a,
101 const rat::exp<Tm, Tw>& b);
103 template<
typename W,
typename M,
typename Tm,
typename Tw>
104 void op_in_mul(
const algebra::Series<W, M>& s,
105 rat::exp<Tm, Tw>& dst,
106 const rat::exp<Tm, Tw>& arg);
108 template<
typename W,
typename M,
typename Tm,
typename Tw>
109 rat::exp<Tm, Tw> op_mul(
const algebra::Series<W, M>& s,
110 const rat::exp<Tm, Tw>& a,
111 const rat::exp<Tm, Tw>& b);
118 template<
typename Tm,
typename Tw,
typename M,
typename W>
119 rat::exp<Tm, Tw> op_convert(
SELECTOR2(algebra::Series<M, W>),
123 template<
typename Tm,
typename Tw,
typename M,
typename W>
124 rat::exp<Tm, Tw> op_convert(
SELECTOR2(algebra::Series<M, W>),
128 template<
typename Tm,
typename Tw,
typename W,
typename M,
typename oTm>
129 rat::exp<Tm, Tw> op_convert(
SELECTOR2(algebra::Series<W, M>),
134 template<
typename Tm,
typename Tw,
typename W,
typename M,
typename oTw>
135 rat::exp<Tm, Tw> op_convert(
SELECTOR2(algebra::Series<W, M>),
140 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTm>
141 void op_assign(
const algebra::Series<W, M>& s,
143 rat::exp<Tm, Tw>& dst,
146 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTw>
147 void op_assign(
const algebra::Series<W, M>& s,
149 rat::exp<Tm, Tw>& dst,
156 template<
typename W,
typename M,
typename Tm,
typename Tw>
157 bool op_starable(
const algebra::Series<W, M>& s,
158 const rat::exp<Tm, Tw>& dst);
160 template<
typename W,
typename M,
typename Tm,
typename Tw>
161 void op_in_star(
const algebra::Series<W, M>& s,
162 rat::exp<Tm, Tw>& dst);
164 template<
typename W,
typename M,
typename Tm,
typename Tw>
166 op_star(
const algebra::Series<W, M>& s,
167 const rat::exp<Tm, Tw>& src);
175 template<
typename M,
typename W,
typename oTm,
typename Tm,
typename Tw>
176 struct op_add_traits<M, algebra::Series<W, M>, oTm, rat::exp<Tm, Tw> >
178 typedef Element<algebra::Series<W, M>, rat::exp<Tm, Tw> > ret_t;
183 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTm>
184 void op_in_add(
const algebra::Series<W, M>& s,
186 rat::exp<Tm, Tw>& dst,
189 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTm>
190 rat::exp<Tm, Tw> op_add(
const algebra::Series<W, M>& s,
192 const rat::exp<Tm, Tw>& a,
195 template<
typename M,
typename W,
typename oTm,
typename Tm,
typename Tw>
196 rat::exp<Tm, Tw> op_add(
const M& monoid,
197 const algebra::Series<W, M>& s,
199 const rat::exp<Tm, Tw>& b);
207 template<
typename W,
typename M,
typename oTw,
typename Tm,
typename Tw>
208 struct op_add_traits<W, algebra::Series<W, M>, oTw, rat::exp<Tm, Tw> >
210 typedef Element<algebra::Series<W, M>, rat::exp<Tm, Tw> > ret_t;
215 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTw>
216 void op_in_add(
const algebra::Series<W, M>& s,
218 rat::exp<Tm, Tw>& dst,
221 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTw>
222 rat::exp<Tm, Tw> op_add(
const algebra::Series<W, M>& s,
224 const rat::exp<Tm, Tw>& a,
227 template<
typename W,
typename M,
typename oTw,
typename Tm,
typename Tw>
228 rat::exp<Tm, Tw> op_add(
const W& semiring,
229 const algebra::Series<W, M>& s,
231 const rat::exp<Tm, Tw>& b);
239 template<
typename W,
typename M,
typename oTw,
typename Tm,
typename Tw>
240 struct op_mul_traits<W, algebra::Series<W, M>, oTw, rat::exp<Tm, Tw> >
242 typedef Element<algebra::Series<W, M>, rat::exp<Tm, Tw> > ret_t;
247 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTw>
248 void op_in_mul(
const algebra::Series<W, M>& s,
250 rat::exp<Tm, Tw>& ret,
253 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTw>
254 rat::exp<Tm, Tw> op_mul(
const algebra::Series<W, M>& s,
256 const rat::exp<Tm, Tw>& a,
259 template<
typename W,
typename M,
typename oTw,
typename Tm,
typename Tw>
260 rat::exp<Tm, Tw> op_mul(
const W& semiring,
261 const algebra::Series<W, M>& s,
263 const rat::exp<Tm, Tw>& b);
268 template<
typename W,
typename M,
typename Tm,
typename Tw,
typename oTm>
269 Tw op_series_get(
const algebra::Series<W, M>& s,
270 const rat::exp<Tm, Tw>& p,
273 template<
typename W,
typename M,
typename Tm,
274 typename Tw,
typename oTm,
typename oTw>
275 void op_series_set(
const algebra::Series<W, M>& s,
276 const rat::exp<Tm, Tw>& p,
280 template <
class W,
class M,
class Tm,
class Tw>
281 Element<algebra::Series<W,M>, rat::exp<Tm,Tw> >
282 op_choose(
const algebra::Series<W,M>& s,
285 template <
typename W,
typename M,
typename Tm,
typename Tw,
typename St>
287 op_rout(
const algebra::Series<W, M>&,
289 const rat::exp<Tm, Tw>&);
295 template <
typename W,
typename M,
typename Tm,
typename Tw>
296 void op_in_transpose(
const algebra::Series<W, M>& s,
297 rat::exp<Tm, Tw>& dst);
302 template<
typename W,
typename M,
typename Tm,
typename Tw>
303 struct semiring_traits<algebra::Series<W, M>, rat::exp<Tm, Tw> >
305 enum { is_positive = 1 };
311 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
312 # include <vaucanson/algebra/implementation/series/krat.hxx>
313 #endif // VCSN_USE_INTERFACE_ONLY
316 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_HH