Vcsn  2.3
Be Rational
instantiate.hh
Go to the documentation of this file.
1 #pragma once
2 
4 #include <vcsn/algos/add.hh>
5 #include <vcsn/algos/are-equivalent.hh> // difference
7 #include <vcsn/algos/cerny.hh>
8 #include <vcsn/algos/complete.hh>
11 #include <vcsn/algos/constant.hh>
12 #include <vcsn/algos/copy.hh>
13 #include <vcsn/algos/de-bruijn.hh>
14 #include <vcsn/algos/derivation.hh>
17 #include <vcsn/algos/divide.hh>
18 #include <vcsn/algos/divkbaseb.hh>
21 #include <vcsn/algos/eval.hh>
22 #include <vcsn/algos/expand.hh>
24 #include <vcsn/algos/inductive.hh>
25 #include <vcsn/algos/info.hh>
26 #include <vcsn/algos/is-acyclic.hh>
30 #include <vcsn/algos/is-proper.hh>
32 #include <vcsn/algos/is-valid.hh>
33 #include <vcsn/algos/ladybird.hh>
34 #include <vcsn/algos/less-than.hh>
36 #include <vcsn/algos/minimize.hh>
37 #include <vcsn/algos/multiply.hh>
38 #include <vcsn/algos/normalize.hh>
39 #include <vcsn/algos/print.hh>
40 #include <vcsn/algos/proper.hh>
42 #include <vcsn/algos/read.hh>
43 #include <vcsn/algos/shortest.hh>
44 #include <vcsn/algos/sort.hh>
45 #include <vcsn/algos/split.hh>
46 #include <vcsn/algos/standard.hh>
48 #include <vcsn/algos/star.hh>
50 #include <vcsn/algos/thompson.hh>
53 #include <vcsn/algos/transpose.hh>
54 #include <vcsn/algos/u.hh>
55 #include <vcsn/algos/weight.hh>
56 
58 
59 #include <vcsn/dyn/registries.hh>
60 
61 #include <vcsn/weightset/b.hh>
63 
64 #include <vcsn/misc/attributes.hh>
65 #include <vcsn/dyn/name.hh>
66 
67 /* The purpose of this file is manyfold:
68 
69  - *prevent* the instantiation of the algorithms that we will
70  provided by the context library. This is what the INSTANTIATE
71  macros do. In this case MAYBE_EXTERN is "extern".
72 
73  - instantiate them when building the context libraries. In this
74  context, MAYBE_EXTERN is "".
75 
76  - register the dyn functions. This is what the register function
77  templates do.
78 
79 */
80 
81 namespace vcsn
82 {
83 #define VCSN_CTX_INSTANTIATE_PRINT(Format, Aut) \
84  MAYBE_EXTERN template \
85  LIBVCSN_API \
86  std::ostream& Format<Aut>(const Aut& aut, std::ostream& out)
87 
88  /*-------------------------------------------------------.
89  | Instantiate the function that work for every context. |
90  `-------------------------------------------------------*/
91 
92 #define VCSN_CTX_INSTANTIATE_1(Ctx) \
93  MAYBE_EXTERN template \
94  class LIBVCSN_API mutable_automaton<Ctx>; \
95  \
96  /* to_expression. */ \
97  MAYBE_EXTERN template \
98  Ctx::expression_t \
99  to_expression<mutable_automaton<Ctx>> \
100  (const mutable_automaton<Ctx>& aut, \
101  const state_chooser_t<mutable_automaton<Ctx>>& next_state); \
102  \
103  /* dot. */ \
104  VCSN_CTX_INSTANTIATE_PRINT(dot, mutable_automaton<Ctx>); \
105  \
106  /* efsm. */ \
107  VCSN_CTX_INSTANTIATE_PRINT(efsm, mutable_automaton<Ctx>); \
108  \
109  /* print. */ \
110  MAYBE_EXTERN template \
111  std::ostream& \
112  print<expressionset<Ctx>>(const expressionset<Ctx>& rs, \
113  const Ctx::expression_t& e, std::ostream& o, \
114  format fmt); \
115  \
116  /* standard. */ \
117  MAYBE_EXTERN template \
118  class rat::standard_visitor<mutable_automaton<Ctx>, Ctx>; \
119  \
120  /* tikz. */ \
121  VCSN_CTX_INSTANTIATE_PRINT(tikz, mutable_automaton<Ctx>); \
122  \
123  /* transpose. */ \
124  MAYBE_EXTERN template \
125  class LIBVCSN_API detail::transpose_automaton<mutable_automaton<Ctx>>; \
126  MAYBE_EXTERN template \
127  class LIBVCSN_API detail::transposer<expressionset<Ctx>>
128 
129 
130  /*----------------------------------.
131  | Register the abstract functions. |
132  `----------------------------------*/
133 
134 #define REGISTER(Algo, ...) \
135  dyn::detail::Algo ## _register(ssignature<__VA_ARGS__>(), \
136  dyn::detail::Algo<__VA_ARGS__>)
137 
138  namespace ctx
139  {
140  namespace detail
141  {
142 
144  template <Automaton Aut>
145  bool
147  {
148  using aut_t = Aut;
149  REGISTER(copy, aut_t);
150  REGISTER(print, aut_t, std::ostream, const std::string);
151  REGISTER(info, aut_t, std::ostream, bool);
152  REGISTER(proper, aut_t, direction, bool, const std::string);
153  return true;
154  }
155 
157  template <typename ExpressionSet>
158  bool
160  {
161  using rs_t = ExpressionSet;
162  using ctx_t = context_t_of<rs_t>;
163  using ws_t = weightset_t_of<ctx_t>;
164 
165  REGISTER(add_expression, rs_t, rs_t);
167  REGISTER(concatenate_expression, rs_t, rs_t);
168  REGISTER(conjunction_expression, rs_t, rs_t);
169  REGISTER(constant_term, rs_t);
171  REGISTER(derived_term, rs_t, const std::string);
172  REGISTER(expand, rs_t);
175  REGISTER(identities_of, rs_t);
176  REGISTER(inductive, rs_t, const std::string);
177  REGISTER(infiltrate_expression, rs_t, rs_t);
178  REGISTER(info_expression, rs_t, std::ostream);
179  REGISTER(ldivide_expression, rs_t, rs_t);
180  REGISTER(less_than_expression, rs_t, rs_t);
181  REGISTER(lweight_expression, ws_t, rs_t);
182  REGISTER(multiply_expression, rs_t, rs_t);
183  REGISTER(multiply_expression_repeated, rs_t, int, int);
184  REGISTER(print_expression, rs_t, std::ostream, const std::string);
185  REGISTER(rdivide_expression, rs_t, rs_t);
186  REGISTER(rweight_expression, rs_t, ws_t);
187  REGISTER(shuffle_expression, rs_t, rs_t);
188  REGISTER(split, rs_t);
190  REGISTER(star_height, rs_t);
191  REGISTER(thompson, rs_t);
192  REGISTER(to_expansion, rs_t);
195 
196  return true;
197  }
198 
199  template <typename Ctx>
200  bool
202  {
203  return true;
204  }
205 
206  template <typename Ctx>
207  bool
209  {
210  using ctx_t = Ctx;
211  using aut_t = mutable_automaton<ctx_t>;
212  using rs_t = expressionset<ctx_t>;
213 
214  // Wordset.
216 
217  // Word polynomialset.
219 
220  // Same labelset, but over Booleans.
221  using b_ctx_t = context<labelset_t_of<Ctx>, b>;
222  using b_rs_t = expressionset<b_ctx_t>;
223 
224  REGISTER(cerny, ctx_t, unsigned);
225  REGISTER(complete, aut_t);
226  REGISTER(conjunction, std::tuple<aut_t, aut_t>, bool);
227  REGISTER(conjunction_repeated, aut_t, unsigned);
228  REGISTER(de_bruijn, ctx_t, unsigned);
229  REGISTER(derivation, rs_t, wls_t, bool);
230  REGISTER(determinize, aut_t, const std::string);
231  REGISTER(difference_expression, rs_t, b_rs_t);
232  REGISTER(divkbaseb, ctx_t, unsigned, unsigned);
233  REGISTER(double_ring, ctx_t, unsigned, const std::vector<unsigned>);
234  REGISTER(eval, aut_t, wls_t);
235  REGISTER(infiltrate, std::tuple<aut_t, aut_t>);
236  REGISTER(is_ambiguous, aut_t);
237  REGISTER(is_complete, aut_t);
238  REGISTER(is_deterministic, aut_t);
239  REGISTER(is_synchronized_by, aut_t, wls_t);
240  REGISTER(is_synchronizing, aut_t);
241  REGISTER(ladybird, ctx_t, unsigned);
242  REGISTER(list_polynomial, wps_t, std::ostream);
243  REGISTER(multiply_polynomial, wps_t, wps_t);
244  REGISTER(pair, aut_t, bool);
245  REGISTER(print_polynomial, wps_t, std::ostream, const std::string);
246  REGISTER(shortest, aut_t, boost::optional<unsigned>, boost::optional<unsigned>);
247  REGISTER(shuffle, std::tuple<aut_t, aut_t>);
248  REGISTER(synchronizing_word, aut_t, const std::string);
249  REGISTER(u, ctx_t, unsigned);
250 
251  return true;
252  }
253 
254  template <typename Ctx>
255  bool
256  register_functions_is_free(std::false_type)
257  {
258  return true;
259  }
260 
261  template <typename Ctx>
262  bool
264  {
265  using ctx_t = Ctx;
266  using aut_t = mutable_automaton<ctx_t>;
267 
268  REGISTER(eliminate_state, aut_t, int);
269 
270  return true;
271  }
272 
273  template <typename Ctx>
274  bool
276  {
277  using ctx_t = Ctx;
278 
279  REGISTER(de_bruijn, ctx_t, unsigned);
280  REGISTER(divkbaseb, ctx_t, unsigned, unsigned);
281  REGISTER(double_ring, ctx_t, unsigned, const std::vector<unsigned>);
282  REGISTER(ladybird, ctx_t, unsigned);
283  REGISTER(u, ctx_t, unsigned);
284 
285  return true;
286  }
287 
288  template <typename Ctx>
289  ATTRIBUTE_CONST
290  bool
292  {
293  return true;
294  }
295 
296  template <typename Ctx>
297  ATTRIBUTE_CONST
298  bool
300  {
301  return true;
302  }
303 
304  template <typename Ctx>
305  bool
307  {
308  return true;
309  }
310 
311  template <typename Ctx>
312  bool
314  {
315  using ctx_t = Ctx;
316  using aut_t = mutable_automaton<ctx_t>;
317  using rs_t = expressionset<ctx_t>;
318  using ls_t = labelset_t_of<ctx_t>;
319  using ws_t = weightset_t_of<ctx_t>;
320 
321  // label polynomialset.
322  using lps_t = polynomialset<ctx_t>;
323  // expression polynomialset.
325  // expansionset.
326  using es_t = rat::expansionset<rs_t>;
327 
328 
329  register_automaton_functions<aut_t>();
330  register_expression_functions<rs_t>();
331 
332  REGISTER(accessible, aut_t);
333  REGISTER(add, aut_t, aut_t, const std::string);
334  REGISTER(add_weight, ws_t, ws_t);
335  REGISTER(are_isomorphic, aut_t, aut_t);
336  REGISTER(coaccessible, aut_t);
337  REGISTER(context_of, aut_t);
338  REGISTER(is_empty, aut_t);
339  REGISTER(is_eps_acyclic, aut_t);
340  REGISTER(is_normalized, aut_t);
341  REGISTER(is_out_sorted, aut_t);
342  REGISTER(is_proper, aut_t);
343  REGISTER(is_standard, aut_t);
344  REGISTER(is_trim, aut_t);
345  REGISTER(is_useless, aut_t);
346  REGISTER(is_valid, aut_t);
348  REGISTER(lweight, ws_t, aut_t, const std::string);
349  REGISTER(list_polynomial, rps_t, std::ostream);
351  REGISTER(make_context, ctx_t);
352  REGISTER(make_word_context, ctx_t);
353  REGISTER(minimize, aut_t, const std::string);
354  REGISTER(multiply, aut_t, aut_t, const std::string);
355  REGISTER(multiply_repeated, aut_t, int, int, const std::string);
356  REGISTER(multiply_weight, ws_t, ws_t);
357  REGISTER(num_tapes, ctx_t);
358  REGISTER(print_context, ctx_t, std::ostream, const std::string);
359  REGISTER(print_expansion, es_t, std::ostream, const std::string);
360  REGISTER(print_label, ls_t, std::ostream, const std::string);
361  REGISTER(print_polynomial, lps_t, std::ostream, const std::string);
362  REGISTER(print_polynomial, rps_t, std::ostream, const std::string);
363  REGISTER(print_weight, ws_t, std::ostream, const std::string);
364  REGISTER(push_weights, aut_t);
365  REGISTER(read_label, ctx_t, std::istream, bool);
366  REGISTER(read_polynomial, ctx_t, std::istream);
367  REGISTER(read_weight, ctx_t, std::istream);
368  REGISTER(rweight, aut_t, ws_t, const std::string);
369  REGISTER(sort, aut_t);
370  REGISTER(standard, aut_t);
371  REGISTER(star, aut_t, const std::string);
372  REGISTER(to_expression, aut_t, rat::identities, const std::string);
375  REGISTER(transpose, aut_t);
376  REGISTER(trim, aut_t);
377 
379  register_functions_is_free<ctx_t>(is_free_t());
380 
381  return register_kind_functions<ctx_t>(typename ctx_t::kind_t());
382  }
383  }
384  }
385 
386 #undef REGISTER
387 
388 #if VCSN_INSTANTIATION
389 # define VCSN_CTX_INSTANTIATE_2(Ctx) \
390  namespace ctx \
391  { \
392  namespace detail \
393  { \
394  static bool registered ATTRIBUTE_USED \
395  = register_functions<Ctx>(); \
396  } \
397  }
398 #else
399 # define VCSN_CTX_INSTANTIATE_2(Ctx)
400 #endif
401 
402 #define VCSN_CTX_INSTANTIATE(Ctx) \
403  /* VCSN_CTX_INSTANTIATE_1(Ctx);*/ \
404  VCSN_CTX_INSTANTIATE_2(Ctx)
405 
406 #ifndef MAYBE_EXTERN
407 # define MAYBE_EXTERN extern
408 #endif
409 
410 }
filter_automaton< Aut > trim(const Aut &a)
Useful part of an automaton.
Definition: accessible.hh:150
auto read_weight(const Context &ctx, std::istream &is) -> weight_t_of< Context >
Definition: read.hh:77
auto push_weights(const Aut &aut) -> decltype(::vcsn::copy(aut))
The algorithm weight pushing.
Definition: push-weights.hh:44
auto complete(const Aut &aut) -> decltype(::vcsn::copy(aut))
Definition: complete.hh:61
bool is_complete(const Aut &aut)
Whether aut is complete.
Definition: is-complete.hh:13
Ctx make_context(const std::string &name)
Build a context from its name.
Definition: make-context.hh:22
expression concatenate_expression(const expression &lhs, const expression &rhs)
Bridge (concatenate).
Definition: multiply.hh:312
Aut transpose(const transpose_automaton< Aut > &aut)
Definition: transpose.hh:238
bool register_kind_functions(labels_are_letters)
Definition: instantiate.hh:201
mutable_automaton< Context > divkbaseb(const Context &ctx, unsigned divisor, unsigned base)
Build the Boolean automaton which accepts a word n representing a number in base "base" if and only i...
Definition: divkbaseb.hh:16
detail::enumerater< Aut >::polynomial_t shortest(const Aut &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Definition: shortest.hh:252
bool is_synchronizing(const Aut &aut)
Whether this automaton is synchronizing, i.e., has synchronizing words.
word_t_of< Aut > synchronizing_word(const Aut &aut, const std::string &algo="greedy")
Return a synchronizing word for aut using algo algo.
#define REGISTER(Algo,...)
Definition: instantiate.hh:134
auto multiply(const Aut1 &lhs, const Aut2 &rhs, Tag tag={}) -> decltype(lhs->null_state(), rhs->null_state(), detail::make_join_automaton(tag, lhs, rhs))
Concatenate two automata, general case.
Definition: multiply.hh:151
auto proper(const Aut &aut, direction dir=direction::backward, bool prune=true, const std::string &algo="auto") -> fresh_automaton_t_of< Aut, detail::proper_context< context_t_of< Aut >>>
Eliminate spontaneous transitions.
Definition: proper.hh:243
std::ostream & print_label(const label &label, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:218
std::shared_ptr< detail::mutable_automaton_impl< Context >> mutable_automaton
Definition: fwd.hh:25
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
Definition: accessible.hh:192
mutable_automaton< Context > u(const Context &ctx, unsigned n)
The Brzozowski universal witness.
Definition: u.hh:15
context context_of(const automaton &aut)
Bridge.
Definition: make-context.hh:63
ExpSet::value_t expand(const ExpSet &rs, const typename ExpSet::value_t &r)
Expand a typed expression, i.e., distribute multiplications over sums.
Definition: expand.hh:13
bool is_useless(const Aut &a)
Whether all no state is useful.
Definition: accessible.hh:168
bool register_expression_functions()
Instantiate the core functions for expressions of type ExpSet.
Definition: instantiate.hh:159
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
Definition: traits.hh:63
expression ldivide_expression(const expression &lhs, const expression &rhs)
Bridge (ldivide).
Definition: divide.hh:30
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
Definition: traits.hh:61
auto minimize(const Aut &a, brzozowski_tag) -> std::enable_if_t< is_free_boolean< Aut >(), determinized_automaton< codeterminized_automaton< Aut >, wet_kind_t::bitset >>
Brzozowski-based minimization.
Aut inductive(const ExpSet &rs, const typename ExpSet::value_t &r, Tag={})
Build a inductive automaton from an expression.
Definition: inductive.hh:304
filter_automaton< Aut > accessible(const Aut &a)
Accessible part of an automaton.
Definition: accessible.hh:134
automaton_editor * make_automaton_editor(const context &ctx)
Bridge.
auto read_polynomial(const Context &ctx, std::istream &is) -> typename polynomialset< Context >::value_t
Definition: read.hh:47
bool is_ambiguous(const Aut &aut)
Definition: is-ambiguous.hh:41
expression difference_expression(const expression &lhs, const expression &rhs)
Bridge (difference).
bool register_functions_is_free(std::true_type)
Definition: instantiate.hh:208
expression expression_one(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:15
weight add_weight(const weight &lhs, const weight &rhs)
Bridge (add).
Definition: add.hh:230
std::ostream & print_expression(const expression &exp, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:199
expression transpose_expression(const expression &exp)
Bridge (transpose).
Definition: transpose.hh:276
weight multiply_weight(const weight &lhs, const weight &rhs)
Bridge (multiply).
Definition: multiply.hh:484
mutable_automaton< Context > ladybird(const Context &ctx, unsigned n)
Build the ladybird automaton of n states.
Definition: ladybird.hh:14
direction
Orientation.
Definition: direction.hh:11
Aut thompson(const context_t_of< Aut > &ctx, const ExpSet &rs, const typename ExpSet::value_t &r)
Build a Thompson automaton from an expression.
Definition: thompson.hh:185
auto eliminate_state(const Aut &aut, state_t_of< Aut > s=Aut::element_type::null_state()) -> fresh_automaton_t_of< Aut >
A copy of automaton res without the state s.
expression expression_zero(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:24
rat::expansionset< ExpSet >::value_t to_expansion(const ExpSet &rs, const typename ExpSet::value_t &e)
First order expansion.
bool is_standard(const Aut &a)
Whether a is standard.
Definition: standard.hh:28
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
expression to_expression_class(const context &ctx, identities ids, const letter_class_t &letters, bool accept)
Bridge (to_expression).
expression rdivide_expression(const expression &lhs, const expression &rhs)
Bridge (rdivide).
Definition: divide.hh:104
std::ostream & print(const Aut &aut, std::ostream &out=std::cout, const std::string &fmt="default")
Definition: print.hh:74
expression multiply_expression_repeated(const expression &re, int min, int max)
Bridge (multiply).
Definition: multiply.hh:408
context make_word_context(const context &ctx)
Bridge.
auto copy(const AutIn &input, KeepState keep_state, KeepTrans keep_trans) -> decltype(keep_state(input->null_state()), keep_trans(input->null_transition()), make_fresh_automaton< AutIn, AutOut >(input))
A copy of input keeping only its states that are accepted by keep_state, and transitions accepted by ...
Definition: copy.hh:322
rat::expression_polynomial_t< ExpSet > derivation(const ExpSet &rs, const typename ExpSet::value_t &e, label_t_of< ExpSet > a, bool breaking=false)
Derive an expression wrt to a letter.
Definition: derivation.hh:277
expression lweight_expression(const weight &weight, const expression &exp)
Bridge (lweight).
Definition: weight.hh:269
auto standard(const Aut &aut)
Definition: standard.hh:116
bool register_automaton_functions()
Instantiate the core functions for automata of type Aut.
Definition: instantiate.hh:146
std::ostream & print_expansion(const expansion &expansion, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:157
bool is_synchronized_by(const Aut &aut, const word_t_of< Aut > &w)
Whether w synchronizes automaton aut.
Definition: a-star.hh:8
ATTRIBUTE_CONST std::enable_if_t< context_t_of< Aut >::has_one(), bool > is_eps_acyclic(const Aut &aut)
Detect epsilon-circuits.
Definition: is-acyclic.hh:116
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge (list).
Definition: print.hh:253
bool are_isomorphic(const Aut1 &a1, const Aut2 &a2)
identities identities_of(const expression &exp)
Bridge.
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
Definition: labelset.hh:253
mutable_automaton< Ctx > cerny(const Ctx &ctx, unsigned num_states)
Cerny automata are automata whose synchronizing word length is always (n - 1)^2, the upper bound of t...
Definition: cerny.hh:25
expression transposition_expression(const expression &exp)
Bridge (transposition).
Definition: transpose.hh:294
mutable_automaton< Context > double_ring(const Context &ctx, unsigned n, const std::vector< unsigned > &finals)
Definition: double-ring.hh:16
expression shuffle_expression(const expression &lhs, const expression &rhs)
Bridge (shuffle).
Definition: conjunction.hh:838
auto eval(const Aut &a, const word_t_of< Aut > &w) -> std::enable_if_t<!context_t_of< Aut >::is_lao, weight_t_of< Aut >>
General case of evaluation.
Definition: eval.hh:100
expression add_expression(const expression &lhs, const expression &rhs)
Bridge (add).
Definition: add.hh:186
pair_automaton< Aut > pair(const Aut &aut, bool keep_initials=false)
Definition: pair.hh:252
auto determinize(const Aut &a, Tag={}, bool_constant< Lazy >={})
Definition: determinize.hh:247
An expressionset can implement several different sets of identities on expressions.
Definition: identities.hh:21
unsigned star_height(const ExpSet &es, const typename ExpSet::value_t &e)
Star height of an expression.
Definition: star-height.hh:145
expression conjunction_expression(const expression &lhs, const expression &rhs)
Bridge (conjunction).
auto read_label(const Context &ctx, std::istream &is, bool quoted=false) -> label_t_of< Context >
Definition: read.hh:17
bool less_than_expression(const expression &lhs, const expression &rhs)
Bridge (less_than).
Definition: less-than.hh:31
bool is_valid(const Aut &aut)
Definition: is-valid.hh:139
context context_of_expression(const expression &exp)
Bridge (context_of).
Definition: make-context.hh:72
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:292
std::enable_if_t< labelset_t_of< ExpSet >::is_free(), expression_automaton< mutable_automaton< typename ExpSet::context_t > > > derived_term(const ExpSet &rs, const typename ExpSet::value_t &r, const std::string &algo="auto")
The derived-term automaton, for free labelsets.
bool is_out_sorted(const Aut &a)
Whether for each state, the outgoing transitions are sorted by increasing label.
Definition: sort.hh:59
rat::expression_polynomial_t< ExpSet > split(const ExpSet &rs, const typename ExpSet::value_t &e)
Split an expression.
Definition: split.hh:262
expression to_expression_label(const context &ctx, identities ids, const label &lbl)
Bridge (to_expression).
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
Definition: is-proper.hh:47
bool register_functions()
Definition: instantiate.hh:313
expression rweight_expression(const expression &exp, const weight &weight)
Bridge (rweight).
Definition: weight.hh:430
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
Definition: normalize.hh:12
std::set< std::pair< std::string, std::string >> letter_class_t
A set of letter ranges.
Definition: fwd.hh:111
automaton conjunction_repeated(const automaton &aut, unsigned n)
Bridge (conjunction).
automaton multiply_repeated(const automaton &a, int min, int max, const std::string &algo)
Bridge (multiply).
Definition: multiply.hh:258
std::ostream & info_expression(const expression &exp, std::ostream &o)
Bridge (info).
Definition: info.hh:190
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
Definition: traits.hh:67
automaton standard_expression(const expression &exp)
Bridge (standard).
Definition: standard.hh:400
expression complement_expression(const expression &exp)
Bridge (complement).
Definition: complement.hh:102
auto sort(const Aut &a) -> permutation_automaton< Aut >
Definition: sort.hh:161
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an automaton.
Definition: accessible.hh:142
polynomial multiply_polynomial(const polynomial &lhs, const polynomial &rhs)
Bridge (multiply).
Definition: multiply.hh:463
std::integral_constant< bool, B > bool_constant
Definition: type_traits.hh:12
std::ostream & info(const Aut &aut, std::ostream &out=std::cout, bool detailed=false)
Print info about an automaton.
Definition: info.hh:73
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:46
weight_t_of< ExpSet > constant_term(const ExpSet &rs, const typename ExpSet::value_t &e)
The constant term of e.
bool is_valid_expression(const expression &exp)
Bridge (is_valid).
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:272
expression infiltrate_expression(const expression &lhs, const expression &rhs)
Bridge (infiltrate).
Definition: conjunction.hh:923
expression multiply_expression(const expression &lhs, const expression &rhs)
Bridge (multiply).
Definition: multiply.hh:294
bool is_trim(const Aut &a)
Whether all its states are useful.
Definition: accessible.hh:161
constexpr auto num_tapes(const Ctx &) -> std::enable_if_t< Ctx::is_lat, size_t >
mutable_automaton< Context > de_bruijn(const Context &ctx, unsigned n)
Definition: de-bruijn.hh:17
ExpSet::value_t to_expression(Aut &a, Profiler &profiler)
std::ostream & print_context(const context &ctx, std::ostream &o, const std::string &fmt)
Bridge (print).
Definition: print.hh:127