Vcsn  2.8
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 
63  name,
64  };
65 
67  inline constexpr bool is_constant(type_t t)
68  {
69  return (t == type_t::one
70  || t == type_t::zero);
71  }
72 
74  inline constexpr bool is_unary(type_t t)
75  {
76  return (t == type_t::complement
77  || t == type_t::star
78  || t == type_t::transposition);
79  }
80 
82  inline constexpr bool is_variadic(type_t t)
83  {
84  return (t == type_t::compose
85  || t == type_t::conjunction
86  || t == type_t::infiltrate
87  || t == type_t::ldivide
88  || t == type_t::mul
89  || t == type_t::shuffle
90  || t == type_t::add);
91  }
92 
94  std::ostream& operator<<(std::ostream& o, type_t t);
95 
96 #define DEFINE(Node) \
97  template <typename Context> \
98  class Node
99 
100  DEFINE(atom);
101  DEFINE(inner);
102  DEFINE(leaf);
103  DEFINE(name);
104  DEFINE(node);
105 
107 
108 #undef DEFINE
109 
110  /*-----------.
111  | constant. |
112  `-----------*/
113 
114  template <type_t Type, typename Context>
115  class constant;
116 
117  template <typename Context>
119 
120  template <typename Context>
122 
123  /*--------.
124  | unary. |
125  `--------*/
126 
127  template <type_t Type, typename Context>
128  class unary;
129 
130  template <typename Context>
132 
133  template <typename Context>
135 
136  template <typename Context>
138 
139  /*-----------.
140  | variadic. |
141  `-----------*/
142 
143  template <type_t Type, typename Context>
144  class variadic;
145 
146  template <typename Context>
148 
149  template <typename Context>
151 
152  template <typename Context>
154 
155  template <typename Context>
157 
158  template <typename Context>
160 
161  template <typename Context>
163 
164  template <typename Context>
166 
167 
168 
169  /*---------.
170  | tuple. |
171  `---------*/
172 
174  template <typename Context,
175  bool Enable = Context::is_lat>
176  class tuple;
177 
178 
179  /*--------------.
180  | weight_node. |
181  `--------------*/
182 
183  template <type_t Type, typename Context>
184  class weight_node;
185 
186  template <typename Context>
188 
189  template <typename Context>
191 
192 
193 
194  template <typename Context>
195  using expression = std::shared_ptr<const node<Context>>;
196 
197 
198  // expansionset.hh.
199  template <typename ExpSet>
200  struct expansionset;
201 
202  // expressionset.hh.
203  template <typename Context>
204  class expressionset_impl;
205 
206  // size.hh.
207  template <typename ExpSet>
208  size_t size(const ExpSet& rs, const typename ExpSet::value_t& r);
209 
210  } // namespace rat
211 
212  template <typename Context>
214 
215  template <typename ExpSet>
217 
218 } // namespace vcsn
std::shared_ptr< const node< Context > > expression
Definition: fwd.hh:195
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
constexpr bool is_constant(type_t t)
Whether is a constant (\\z or \\e).
Definition: fwd.hh:67
An inner node with multiple children.
Definition: expression.hh:119
Gather information of the number of the different node types.
Definition: fwd.hh:24
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:46
constexpr bool is_unary(type_t t)
Whether star, complement.
Definition: fwd.hh:74
printer< ExpSet > make_printer(const ExpSet &rs, std::ostream &out)
Definition: printer.hh:379
type_t
The possible types of expressions.
Definition: fwd.hh:43
Definition: a-star.hh:8
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
Definition: fwd.hh:82
Implementation of nodes of tuple of rational expressions.
Definition: expression.hh:174
Naming an expression.
An inner node implementing a weight.
Definition: expression.hh:256
Pretty-printer for rational expressions.
Definition: fwd.hh:32
#define DEFINE(Node)
Definition: fwd.hh:96
A typed expression set.
::vcsn::rat::identities identities
Sets of identities on expressions.
Definition: fwd.hh:17
std::ostream & operator<<(std::ostream &o, type_t t)
Print a expression type.
Definition: printer.hxx:13
info< ExpSet > make_info(const typename ExpSet::value_t &r)
Definition: info.hh:198
std::shared_ptr< const exp > exp_t
Definition: fwd.hh:20
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
Definition: automaton.hh:86