17 #ifndef VCSN_TOOLS_GEN_BOOK_HXX
18 # define VCSN_TOOLS_GEN_BOOK_HXX
20 # include <vaucanson/tools/gen_book.hh>
21 # include <vaucanson/misc/usual_macros.hh>
22 # include <vaucanson/automata/concept/handlers.hh>
27 template <
class Auto_>
28 Auto_ lombardy(
unsigned size)
30 AUTOMATON_TYPES(Auto_);
31 AUTOMATON_FREEMONOID_TYPES(Auto_);
33 alphabets_elt_t alpha;
36 monoid_t monoid (alpha);
38 series_set_t series (semiring, monoid);
39 automaton_t automaton;
41 automaton.series() = series;
42 hstate_t initial = automaton.add_state();
45 for (
unsigned i = 0; i < size; ++i)
47 hstate_t next = automaton.add_state();
48 automaton.add_letter_transition(c, c,
'a');
49 automaton.add_letter_transition(c, next,
'b');
50 automaton.set_initial(c);
53 automaton.set_final(c);
54 automaton.set_initial(c);
55 automaton.add_letter_transition(c, initial,
'a');
63 #endif // ! VCSN_TOOLS_GEN_BOOK_HXX