17 #ifndef VCSN_ALGORITHMS_KRAT_EXP_CONSTANT_TERM_HXX
18 # define VCSN_ALGORITHMS_KRAT_EXP_CONSTANT_TERM_HXX
21 # include <vaucanson/algebra/implementation/series/krat_exp_pattern.hh>
33 template <
class Series,
class T,
class Dispatch>
35 ConstantTermEval<Series, T, Dispatch>,
37 typename Element<Series, T>::semiring_elt_t,
45 typedef typename semiring_elt_t::value_t semiring_elt_value_t;
46 INHERIT_CONSTRUCTORS(
self_t, T, semiring_elt_t, Dispatch);
53 MATCH__(Product, lhs, rhs)
59 MATCH__(Sum, lhs, rhs)
67 semiring_elt_t ret = this->
match(node);
75 MATCH__(LeftWeight, w, node)
77 return w * this->
match(node);
81 MATCH__(RightWeight, node, w)
83 return this->
match(node) * w;
101 return exp_.
structure().semiring().identity(
SELECT(semiring_elt_value_t));
111 template <
class Series,
class T>
112 std::pair<typename Element<Series, T>::semiring_elt_t,
bool>
117 semiring_elt_t v = matcher.
match(exp.
value());
118 if (matcher.undefined)
119 return std::make_pair(v,
false);
120 return std::make_pair(v,
true);
125 #endif // ! VCSN_ALGORITHMS_KRAT_EXP_CONSTANT_TERM_HXX