00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_AUTOMATA_CONCEPT_AUTOMATA_HH
00018 # define VCSN_AUTOMATA_CONCEPT_AUTOMATA_HH
00019
00020 # include <vaucanson/automata/concept/automata_base.hh>
00021 # include <vaucanson/design_pattern/slots.hh>
00022
00023 namespace vcsn
00024 {
00025
00026 template <typename Series, typename Kind>
00027
00028 struct Automata;
00029
00031 template <typename Series, typename Kind>
00032 struct dynamic_traits<Automata<Series, Kind> >
00033 : dynamic_traits<AutomataBase<Automata<Series, Kind> > >
00034 {
00035 static const bool ret = dynamic_traits<Series>::ret;
00036 };
00037
00039 template <typename Series, typename Kind, typename T>
00040 struct MetaElement<Automata<Series, Kind>, T>
00041 : MetaElement<AutomataBase<Automata<Series, Kind> >, T>
00042 {};
00043
00045 template <typename Series, typename Kind>
00046 struct virtual_types<Automata<Series, Kind> >
00047 : virtual_types<AutomataBase<Automata<Series, Kind> > >
00048 {
00049 typedef Series series_set_t;
00050 typedef Kind kind_t;
00051 };
00052
00053
00055 template <typename Series, typename Kind>
00056 class Automata
00057 : public AutomataBase<Automata<Series, Kind> >,
00058 private SetSlot<Series>
00059 {
00060 public:
00061 typedef Automata<Series, Kind> self_t;
00062 typedef Series series_set_t;
00063 typedef Kind kind_t;
00064
00065 Automata(const series_set_t&);
00066
00067 const series_set_t& series() const;
00068 };
00069
00070 template <typename S, typename K, typename T>
00071 struct projection_traits<Automata<S, K>, T>
00072 {
00073 typedef Automata<S, K> structure_t;
00074 typedef T impl_t;
00075
00076 typedef Element<structure_t, impl_t> automaton_t;
00077
00078 typedef typename automaton_t::series_set_elt_t series_set_elt_t;
00079
00080 typedef typename structure_t::series_set_t series_set_t;
00081
00082 typedef typename structure_t::series_set_t::semiring_t semiring_t;
00083
00084 typedef typename structure_t::series_set_t::monoid_t monoid_t;
00085
00086 typedef typename impl_t::monoid_elt_value_t monoid_elt_value_t;
00087
00088 typedef typename monoid_t::alphabet_t alphabet_t;
00089
00090 typedef typename algebra::alphabet_traits<typename alphabet_t::set_t,
00091 typename alphabet_t::value_t>
00092 alphabet_traits_t;
00093
00094 typedef typename algebra::word_traits<monoid_t, monoid_elt_value_t>
00095 word_traits_t;
00096
00097 typedef typename word_traits_t::first_monoid_t first_monoid_t;
00098
00099 typedef typename word_traits_t::second_monoid_t second_monoid_t;
00100
00101 typedef typename algebra::mute_series_traits<series_set_t,
00102 semiring_t,
00103 first_monoid_t>::ret
00104 first_series_t;
00105
00106 typedef typename algebra::mute_series_traits<series_set_t,
00107 semiring_t,
00108 second_monoid_t>::ret
00109 second_series_t;
00110
00111 typedef typename mute_graph_impl_traits<impl_t, word_traits_t>::
00112 first_projection_t first_impl_t;
00113
00114 typedef typename mute_graph_impl_traits<impl_t, word_traits_t>::
00115 second_projection_t second_impl_t;
00116
00117 typedef Element<Automata<first_series_t, K>, first_impl_t>
00118 first_projection_t;
00119
00120 typedef Element<Automata<second_series_t, K>, second_impl_t>
00121 second_projection_t;
00122
00123
00124
00125 static first_projection_t first_projection(const automaton_t&);
00126 static second_projection_t second_projection(const automaton_t&);
00127
00128 typedef automaton_traits<first_impl_t> first_series_traits_t;
00129
00130 typedef automaton_traits<second_impl_t> second_series_traits_t;
00131
00132 typedef Element<first_series_t,
00133 typename first_series_traits_t::series_set_elt_value_t>
00134 series_first_projection_t;
00135
00136 typedef Element<second_series_t,
00137 typename second_series_traits_t::series_set_elt_value_t>
00138 series_second_projection_t;
00139
00140
00141
00142 static series_first_projection_t
00143 series_first_projection(const first_series_t&,
00144 const series_set_elt_t&);
00145 static series_second_projection_t
00146 series_second_projection(const second_series_t&,
00147 const series_set_elt_t&);
00148 };
00149
00150
00151 # define AUTOMATON_PROJECTION_TYPES() \
00152 typedef algebra::alphabet_traits<alphabet_t::set_t, \
00153 alphabet_t::value_t> alphabet_traits_t; \
00154 typedef alphabet_traits_t::first_projection_t \
00155 first_projection_alphabet_t; \
00156 typedef alphabet_traits_t::second_projection_t \
00157 second_projection_alphabet_t; \
00158 \
00159 typedef algebra::word_traits<monoid_elt_t::set_t, \
00160 monoid_elt_t::value_t> word_traits_t; \
00161 typedef word_traits_t::first_monoid_t first_monoid_t; \
00162 typedef word_traits_t::second_monoid_t second_monoid_t; \
00163 typedef word_traits_t::first_projection_t first_projection_word_t; \
00164 typedef word_traits_t::second_projection_t second_projection_word_t; \
00165 \
00166 typedef projection_traits<automata_set_t, automaton_impl_t> \
00167 projection_traits_t; \
00168 typedef projection_traits_t::first_projection_t \
00169 first_projection_automaton_t; \
00170 typedef projection_traits_t::second_projection_t \
00171 second_projection_automaton_t
00172
00173 template <typename Series, typename Kind>
00174 bool
00175 operator==(const Automata<Series, Kind>&, const Automata<Series, Kind>&);
00176
00177 }
00178
00179
00180 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00181 # include <vaucanson/automata/concept/automata.hxx>
00182 # endif // VCSN_USE_INTERFACE_ONLY
00183
00184
00185 #endif // ! VCSN_AUTOMATA_CONCEPT_AUTOMATA_HH