Vaucanson  1.4.1
composition_cover.hxx
Go to the documentation of this file.
1 // composition_cover.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2006 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_ALGORITHMS_COMPOSITION_COVER_HXX
18 # define VCSN_ALGORITHMS_COMPOSITION_COVER_HXX
19 
33 # include <vaucanson/algebra/concept/freemonoid_product.hh>
34 # include <vaucanson/automata/concept/automata.hh>
35 
36 
37 namespace vcsn {
38 
39  template <typename S, typename M1, typename M2, typename Auto_t>
40  void
41  do_composition_cover (const AutomataBase<S>&,
42  const algebra::FreeMonoidProduct<M1, M2>&,
43  const Auto_t& fmp,
44  Auto_t& ret)
45  {
46  BENCH_TASK_SCOPED("composition_cover");
47  AUTOMATON_TYPES(Auto_t);
48  ret = splitting::outsplitting (fmp);
49  }
50 
51 
52  template <typename S, typename M1, typename M2, typename Auto_t>
53  void
54  do_composition_co_cover (const AutomataBase<S>&,
55  const algebra::FreeMonoidProduct<M1, M2>&,
56  const Auto_t& fmp,
57  Auto_t& ret)
58  {
59  BENCH_TASK_SCOPED("composition_co_cover");
60  AUTOMATON_TYPES(Auto_t);
61  ret = splitting::insplitting (fmp);
62  }
63 
64 
65 
67 
68  template <typename S, typename T>
69  Element<S, T>
71  {
72  typedef Element<S, T> auto_t;
73  AUTOMATON_TYPES(auto_t);
74 
75  auto_t ret (fmp.structure());
76 
77  do_composition_cover (fmp.structure(),
78  fmp.structure().series().monoid(),
79  fmp,
80  ret);
81  return ret;
82  }
83 
84 
85  template <typename S, typename T>
86  void
87  composition_cover (const Element<S, T>& fmp,
88  Element<S, T>& ret)
89  {
90  typedef Element<S, T> auto_t;
91  AUTOMATON_TYPES(auto_t);
92 
93  for_all_states (s, ret)
94  ret.del_states (*s);
95  do_composition_cover (fmp.structure(),
96  fmp.structure().series().monoid(),
97  fmp,
98  ret);
99  }
100 
101 
103 
104  template <typename S, typename T>
105  Element<S, T>
106  composition_co_cover (const Element<S, T>& fmp)
107  {
108  typedef Element<S, T> auto_t;
109  AUTOMATON_TYPES(auto_t);
110 
111  automaton_t ret(fmp.structure());
112 
113  do_composition_co_cover (fmp.structure(),
114  fmp.structure().series().monoid(),
115  fmp,
116  ret);
117  return ret;
118  }
119 
120 
121  template <typename S, typename T>
122  void
123  composition_co_cover (const Element<S, T>& fmp,
124  Element<S, T>& ret)
125  {
126  typedef Element<S, T> auto_t;
127  AUTOMATON_TYPES(auto_t);
128 
129  for_all_states (s, ret)
130  ret.del_states (*s);
131  do_composition_cover (fmp.structure(),
132  fmp.structure().series().monoid(),
133  fmp,
134  ret);
135  }
136 
137 }
138 
139 #endif // ! VCSN_ALGORITHMS_COMPOSITION_COVER_HXX