17 #ifndef VCSN_AUTOMATA_CONCEPT_KINDS_HXX
18 # define VCSN_AUTOMATA_CONCEPT_KINDS_HXX
25 # include <vaucanson/automata/concept/handlers.hh>
29 template<
typename Series,
33 ls_delta_letter_query<Series, MonoidElt, SemiringElt, L>::
34 ls_delta_letter_query(
const Series& s,
const L& l)
36 l_(op_convert(
SELECT(typename MonoidElt::set_t),
37 SELECT(typename MonoidElt::value_t),
41 template<
typename Series,
45 template<
typename Label>
46 bool ls_delta_letter_query<Series, MonoidElt, SemiringElt, L>::
47 operator()(
const Label& label)
const
49 return (op_series_get(s_.get(), label, l_)
50 != zero_value(
SELECT(
typename SemiringElt::set_t),
51 SELECT(
typename SemiringElt::value_t)));
56 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
57 Element<Series, SeriesT>
58 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
59 series_of(htransition_t e)
const
61 return series_set_elt_t(auto_self().series(),
62 auto_self().label_of(e));
65 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
67 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
68 series_value_of(htransition_t e)
const
70 return auto_self().label_of(e);
73 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
75 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
76 is_spontaneous(htransition_t e)
const
78 const series_set_elt_t& s = auto_self().label_of(e);
80 return s == algebra::identity_as<SeriesT>::of(s.set());
83 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
86 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
87 letter_of(
SELECTOR(L), htransition_t e)
const
89 return *op_begin(auto_self().series().monoid(),
90 auto_self().label_of(e).begin()->first);
93 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
94 typename Element<Series, SeriesT>::monoid_elt_t
95 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
96 word_of(htransition_t e)
const
98 const LabelT& l = auto_self().label_of(e);
100 return monoid_elt_t(auto_self().series().monoid(),
104 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
105 const typename Element<Series, SeriesT>::monoid_elt_t::value_t&
106 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
107 word_value_of(htransition_t e)
const
109 return auto_self().label_of(e).begin()->first;
112 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
114 typename Self::htransition_t
115 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
116 add_series_transition(hstate_t from, hstate_t to,
119 return auto_self().add_transition(from, to, e.value());
122 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
123 typename Self::htransition_t
124 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
125 add_spontaneous(hstate_t from, hstate_t to)
127 return auto_self().add_transition(from, to,
128 identity_value(
SELECT(Series),
132 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
134 typename Self::htransition_t
135 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
136 add_letter_transition(hstate_t from, hstate_t to,
139 return auto_self().add_transition(from, to,
140 series_set_elt_t(auto_self().series(),
141 monoid_elt_t(auto_self().series().monoid(),
147 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
149 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
151 {
return static_cast<Self&
>(*this); }
153 template<
typename Self,
typename Series,
typename SeriesT,
typename LabelT>
155 AutoKind<labels_are_series, Self, Series, SeriesT, LabelT>::
157 {
return static_cast<const Self&
>(*this); }
161 #endif // ! VCSN_AUTOMATA_CONCEPT_KINDS_HXX