Vaucanson  1.4.1
alphabet_set.hh
1 // alphabet_set.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 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_ALGEBRA_IMPLEMENTATION_ALPHABETS_ALPHABET_SET_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_ALPHABETS_ALPHABET_SET_HH
19 
20 # include <vaucanson/algebra/implementation/alphabets/alphabets.hh>
21 # include <vaucanson/misc/usual_macros.hh>
22 
23 namespace vcsn {
24 
25  namespace algebra {
26 
30  /*--------------------------------------------.
31  | alphabet_traits<AlphabetSet<L>,std::set<L>> |
32  `--------------------------------------------*/
33 
35  template <typename L>
36  struct alphabet_traits<AlphabetSet<L>, std::set<L> >
37  {
39  typedef Element<AlphabetSet<L>, std::set<L> > alphabet_t;
40 
42  typedef L letter_t;
43 
45  typedef typename letter_traits<letter_t>::first_projection_t
47 
49  typedef typename letter_traits<letter_t>::second_projection_t
51 
54  std::set<first_projection_letter_t> > first_projection_t;
55 
58  std::set<second_projection_letter_t> > second_projection_t;
59 
61  static first_projection_t first_projection(const alphabet_t&);
62 
64  static second_projection_t second_projection(const alphabet_t&);
65  };
66 
70  } // algebra
71 
75  /*-----------------------------------------.
76  | MetaElement<AlphabetSet<L>, std::set<L>> |
77  `-----------------------------------------*/
78 
84  template<typename L>
85  struct MetaElement<algebra::AlphabetSet<L>, std::set<L> >
86  : MetaElement<algebra::AlphabetSetBase<algebra::AlphabetSet<L> >, std::set<L> >
87  {
89  static const bool dynamic_value = true;
90  };
91 
95  namespace algebra {
96 
97  template <typename L>
98  std::pair<bool, L> op_parse(const AlphabetSet<L>&,
99  const std::set<L>&,
100  const std::string&,
101  size_t&);
102 
103  template <typename L>
104  size_t op_max_size(const algebra::AlphabetSet<L>&, const std::set<L>&);
105 
106  template <typename L>
107  bool op_contains(const algebra::AlphabetSet<L>& s, const std::set<L>& a);
108 
109  template <typename L>
110  bool op_is_finite(const algebra::AlphabetSet<L>& s, const std::set<L>& a);
111 
112  template <typename L>
113  bool op_contains_e(const algebra::AlphabetSet<L>& s, const std::set<L>& a,
114  const L& v);
115  }
116 
117 } // vcsn
118 
119 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
120 # include <vaucanson/algebra/implementation/alphabets/alphabet_set.hxx>
121 # endif // VCSN_USE_INTERFACE_ONLY
122 
123 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_ALPHABETS_ALPHABET_SET_HH