Vcsn  2.5
Be Rational
fwd.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
5 #include <vcsn/weightset/fwd.hh>
6 
7 namespace vcsn
8 {
9  namespace rat
10  {
11  // identities.hh
12  class identities;
13 
14  /*---------------.
15  | expressions. |
16  `---------------*/
17 
19  class exp;
20  using exp_t = std::shared_ptr<const exp>;
21 
22  // info.hh
23  template <typename ExpSet>
24  class info;
25 
26  template <typename ExpSet>
28  make_info(const typename ExpSet::value_t& r);
29 
30  // printer.hh.
31  template <typename ExpSet>
32  class printer;
33 
34  template <typename ExpSet>
36  make_printer(const ExpSet& rs, std::ostream& out);
37 
43  enum class type_t
44  {
45  zero,
46  one,
47  atom,
48  add,
49  mul,
50  ldivide,
52  shuffle,
53  infiltrate,
54  star,
56  lweight,
57  rweight,
58  complement,
59  tuple,
60  compose,
61  };
62 
64  inline constexpr bool is_constant(type_t t)
65  {
66  return (t == type_t::one
67  || t == type_t::zero);
68  }
69 
71  inline constexpr bool is_unary(type_t t)
72  {
73  return (t == type_t::complement
74  || t == type_t::star
75  || t == type_t::transposition);
76  }
77 
79  inline constexpr bool is_variadic(type_t t)
80  {
81  return (t == type_t::compose
82  || t == type_t::conjunction
83  || t == type_t::infiltrate
84  || t == type_t::ldivide
85  || t == type_t::mul
86  || t == type_t::shuffle
87  || t == type_t::add);
88  }
89 
91  std::ostream& operator<<(std::ostream& o, type_t t);
92 
93 #define DEFINE(Node) \
94  template <typename Context> \
95  class Node
96 
97  DEFINE(atom);
98  DEFINE(inner);
99  DEFINE(leaf);
100  DEFINE(node);
101 
103 
104 #undef DEFINE
105 
106  /*-----------.
107  | constant. |
108  `-----------*/
109 
110  template <type_t Type, typename Context>
111  class constant;
112 
113  template <typename Context>
115 
116  template <typename Context>
118 
119  /*--------.
120  | unary. |
121  `--------*/
122 
123  template <type_t Type, typename Context>
124  class unary;
125 
126  template <typename Context>
128 
129  template <typename Context>
131 
132  template <typename Context>
134 
135  /*-----------.
136  | variadic. |
137  `-----------*/
138 
139  template <type_t Type, typename Context>
140  class variadic;
141 
142  template <typename Context>
144 
145  template <typename Context>
147 
148  template <typename Context>
150 
151  template <typename Context>
153 
154  template <typename Context>
156 
157  template <typename Context>
159 
160  template <typename Context>
162 
163 
164 
165  /*---------.
166  | tuple. |
167  `---------*/
168 
170  template <typename Context,
171  bool Enable = Context::is_lat>
172  class tuple;
173 
174 
175  /*--------------.
176  | weight_node. |
177  `--------------*/
178 
179  template <type_t Type, typename Context>
180  class weight_node;
181 
182  template <typename Context>
184 
185  template <typename Context>
187 
188 
189 
190  template <typename Context>
191  using expression = std::shared_ptr<const node<Context>>;
192 
193 
194  // expansionset.hh.
195  template <typename ExpSet>
196  struct expansionset;
197 
198  // expressionset.hh.
199  template <typename Context>
200  class expressionset_impl;
201 
202  // size.hh.
203  template <typename ExpSet>
204  size_t size(const ExpSet& rs, const typename ExpSet::value_t& r);
205 
206  } // namespace rat
207 
208  template <typename Context>
210 
211  template <typename ExpSet>
213 
214 } // namespace vcsn
constexpr bool is_unary(type_t t)
Whether star, complement.
Definition: fwd.hh:71
::vcsn::rat::identities identities
Sets of identities on expressions.
Definition: fwd.hh:17
Pretty-printer for rational expressions.
Definition: fwd.hh:32
Implementation of nodes of tuple of rational expressions.
Definition: expression.hh:173
printer< ExpSet > make_printer(const ExpSet &rs, std::ostream &out)
Definition: printer.hh:373
Definition: a-star.hh:8
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
Definition: fwd.hh:79
std::shared_ptr< const exp > exp_t
Definition: fwd.hh:20
A typed expression set.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Definition: automaton.hh:86
info< ExpSet > make_info(const typename ExpSet::value_t &r)
Definition: info.hh:195
std::ostream & operator<<(std::ostream &o, type_t t)
Print a expression type.
Definition: printer.hxx:13
constexpr bool is_constant(type_t t)
Whether is a constant (\\z or \\e).
Definition: fwd.hh:64
#define DEFINE(Node)
Definition: fwd.hh:93
std::shared_ptr< const node< Context > > expression
Definition: fwd.hh:191
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:46
Gather information of the number of the different node types.
Definition: fwd.hh:24
An inner node with multiple children.
Definition: expression.hh:118
An inner node implementing a weight.
Definition: expression.hh:255
type_t
The possible types of expressions.
Definition: fwd.hh:43
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)