1 #ifndef VCSN_CTX_INSTANTIATE_HH
2 # define VCSN_CTX_INSTANTIATE_HH
83 # define VCSN_CTX_INSTANTIATE_PRINT(Format, Aut) \
84 MAYBE_EXTERN template \
86 std::ostream& Format<Aut>(const Aut& aut, std::ostream& out)
92 # define VCSN_CTX_INSTANTIATE_1(Ctx) \
93 MAYBE_EXTERN template \
94 class LIBVCSN_API mutable_automaton<Ctx>; \
97 MAYBE_EXTERN template \
99 to_expression<mutable_automaton<Ctx>> \
100 (const mutable_automaton<Ctx>& aut, \
101 const state_chooser_t<mutable_automaton<Ctx>>& next_state); \
104 VCSN_CTX_INSTANTIATE_PRINT(dot, mutable_automaton<Ctx>); \
107 VCSN_CTX_INSTANTIATE_PRINT(efsm, mutable_automaton<Ctx>); \
110 MAYBE_EXTERN template \
111 detail::lifted_automaton_t<mutable_automaton<Ctx>> \
112 lift<mutable_automaton<Ctx>>(const mutable_automaton<Ctx>& aut); \
115 MAYBE_EXTERN template \
117 print<ratexpset<Ctx>>(const ratexpset<Ctx>& rs, \
118 const Ctx::ratexp_t& e, std::ostream& o, \
122 MAYBE_EXTERN template \
123 class rat::standard_visitor<mutable_automaton<Ctx>, Ctx>; \
126 VCSN_CTX_INSTANTIATE_PRINT(tikz, mutable_automaton<Ctx>); \
129 MAYBE_EXTERN template \
130 class LIBVCSN_API detail::transpose_automaton<mutable_automaton<Ctx>>; \
131 MAYBE_EXTERN template \
132 class LIBVCSN_API detail::transposer<ratexpset<Ctx>>
139 #define REGISTER(Algo, ...) \
140 Algo ## _register(ssignature<__VA_ARGS__>(), Algo<__VA_ARGS__>)
146 template <
typename Ctx>
153 template <
typename Ctx>
171 using namespace dyn::detail;
204 template <
typename Ctx>
211 template <
typename Ctx>
218 using namespace dyn::detail;
225 template <
typename Ctx>
231 using namespace dyn::detail;
242 template <
typename Ctx>
250 template <
typename Ctx>
258 template <
typename Ctx>
265 template <
typename Ctx>
283 using namespace dyn::detail;
361 register_functions_is_free<ctx_t>(std::integral_constant<bool, ctx_t::labelset_t::is_free()>());
363 return register_kind_functions<ctx_t>(
typename ctx_t::kind_t());
370 # if VCSN_INSTANTIATION
371 # define VCSN_CTX_INSTANTIATE_2(Ctx) \
376 static bool registered = register_functions<Ctx>(); \
380 # define VCSN_CTX_INSTANTIATE_2(Ctx)
383 # define VCSN_CTX_INSTANTIATE(Ctx) \
385 VCSN_CTX_INSTANTIATE_2(Ctx)
387 # ifndef MAYBE_EXTERN
388 # define MAYBE_EXTERN extern
393 #endif // !VCSN_CTX_INSTANTIATE_HH
std::enable_if< std::is_same< weightset_t_of< Aut >, b >::value &&labelset_t_of< Aut >::is_free(), partition_automaton< Aut > >::type minimize(const Aut &a, const std::string &algo)
filter_automaton< Aut > coaccessible(const Aut &a)
labelset_t_of< Aut >::word_t synchronizing_word(const Aut &aut, const std::string &algo="greedy")
Linear combination of labels: map labels to weights.
context make_word_context(const context &ctx)
RatExpSet::value_t to_expression(const Aut &a, const state_chooser_t< Aut > &next_state)
Aut eliminate_state(const Aut &aut, state_t_of< Aut > s)
A copy of automaton res without the state s.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
bool is_ambiguous(const Aut &aut)
auto power(const Aut &aut, unsigned n) -> typename Aut::element_type::automaton_nocv_t
auto product(const Auts &...as) -> product_automaton< decltype(meet_automata(as...)), Auts...>
Build the (accessible part of the) product.
ratexpset< Context > make_ratexpset(const Context &ctx, rat::identities identities)
Shorthand to ratexpset constructor.
mutable_automaton< Ctx > random(const Ctx &ctx, unsigned num_states, float density=0.1, unsigned num_initial=1, unsigned num_final=1)
detail::enumerater< Automaton >::polynomial_t shortest(const Automaton &aut, unsigned num)
Aut thompson(const context_t_of< Aut > &ctx, const RatExpSet &rs, const typename RatExpSet::value_t &r)
Build a Thompson automaton from a ratexp.
std::ostream & info(const A &aut, std::ostream &out, bool detailed=false)
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge.
auto concatenate(const A &lhs, const B &rhs) -> decltype(join_automata(lhs, rhs))
Concatenate two standard automata.
bool is_trim(const Aut &a)
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &format)
Bridge.
bool is_useless(const Aut &a)
std::ostream & print_ctx(const context &ctx, std::ostream &o, const std::string &format)
Bridge.
bool is_standard(const Aut &a)
Whether a is standard.
auto proper(const Aut &aut, direction dir=direction::backward, bool prune=true) -> mutable_automaton< decltype(proper_context(copy(aut) ->context()))>
Eliminate spontaneous transitions.
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &format)
Bridge.
detail::enumerater< Automaton >::polynomial_t enumerate(const Automaton &aut, unsigned max)
std::ostream & efsm(const Aut &aut, std::ostream &out)
Format automaton to EFSM format, based on FSM format.
RatExpSet::value_t star_normal_form(const RatExpSet &rs, const typename RatExpSet::value_t &e)
Star_Normal_Forming a typed ratexp shared_ptr.
weight multiply_weight(const weight &lhs, const weight &rhs)
Bridge.
pair_automaton< Aut > pair(const Aut &aut, bool keep_initials=false)
ratexp transpose_ratexp(const ratexp &exp)
Bridge.
bool are_isomorphic(const Aut1 &a1, const Aut2 &a2)
rat::expansionset< RatExpSet >::value_t to_expansion(const RatExpSet &rs, const typename RatExpSet::value_t &e)
First order expansion.
std::shared_ptr< detail::mutable_automaton_impl< Context >> mutable_automaton
ratexp complement_ratexp(const ratexp &exp)
Bridge.
RatExpSet::value_t expand(const RatExpSet &rs, const typename RatExpSet::value_t &e)
Expanding a typed ratexp shared_ptr.
bool register_kind_functions(labels_are_letters)
bool is_complete(const Aut &aut)
Whether aut is complete.
automaton standard_ratexp(const ratexp &exp)
Bridge.
bool is_valid(const Aut &aut)
std::ostream & print_expansion(const expansion &expansion, std::ostream &o, const std::string &format)
Bridge.
std::ostream & tikz(const AutPtr &aut, std::ostream &out)
Print automaton to TikZ format.
context context_of(const automaton &aut)
Bridge.
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
weight sum_weight(const weight &lhs, const weight &rhs)
Bridge.
auto read_weight(const Context &ctx, std::istream &is) -> weight_t_of< Context >
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...
AutOut copy(const AutIn &input, Pred keep_state)
A copy of input keeping only its states that are accepted by keep_state.
ratexp lift_ratexp(const ratexp &exp)
Bridge.
context context_of_ratexp(const ratexp &exp)
Bridge.
auto sort(const Aut &a) -> permutation_automaton< Aut >
std::ostream & info_ratexp(const ratexp &exp, std::ostream &o)
Bridge.
automaton lift_automaton(const automaton &aut)
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
mutable_automaton< Context > double_ring(const Context &ctx, unsigned n, const std::vector< unsigned > &finals)
filter_automaton< Aut > trim(const Aut &a)
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
auto standard(const Aut &aut) -> decltype(copy(aut))
unsigned star_height(const typename RatExpSet::value_t &e)
Star height of a ratexp.
auto complete(const Aut &aut) -> decltype(::vcsn::copy(aut))
ATTRIBUTE_CONST bool is_eps_acyclic(const Aut &aut)
bool is_valid_ratexp(const ratexp &exp)
Bridge.
Aut::element_type::automaton_nocv_t right_mult(const Aut &aut, const weight_t_of< Aut > &w)
std::ostream & print_ratexp(const ratexp &exp, std::ostream &o, const std::string &format)
Bridge.
auto push_weights(const Aut &aut) -> decltype(::vcsn::copy(aut))
The algorithm weight pushing.
bool is_empty(const Aut &a) ATTRIBUTE_PURE
mutable_automaton< Ctx > random_deterministic(const Ctx &ctx, unsigned num_states)
ratexp transposition_ratexp(const ratexp &exp)
Bridge.
std::ostream & print_label(const label &label, std::ostream &o, const std::string &format)
Bridge.
auto union_a(const A &lhs, const B &rhs) -> decltype(join_automata(lhs, rhs))
Union of two automata.
std::enable_if< RatExpSet::context_t::labelset_t::is_free(), automaton >::type derived_term(const ratexp &exp, const std::string &algo)
Bridge.
Provide a variadic mul on top of a binary mul(), and one().
auto read_polynomial(const Context &ctx, std::istream &is) -> typename polynomialset< Context >::value_t
mutable_automaton< Context > de_bruijn(const Context &ctx, unsigned n)
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...
weight_t_of< RatExpSet > constant_term(const RatExpSet &rs, const typename RatExpSet::value_t &e)
Aut transpose(const transpose_automaton< Aut > &aut)
#define REGISTER(Algo,...)
mutable_automaton< Context > u(const Context &ctx, unsigned n)
The Brzozowski universal witness.
rat::ratexp_polynomial_t< RatExpSet > derivation(const RatExpSet &rs, const typename RatExpSet::value_t &e, label_t_of< RatExpSet > a, bool breaking=false)
Derive a ratexp wrt to a letter.
ratexp conjunction_ratexp(const ratexp &lhs, const ratexp &rhs)
Bridge.
bool is_synchronized_by(const Aut &aut, const typename labelset_t_of< Aut >::word_t &w)
mutable_automaton< Context > ladybird(const Context &ctx, unsigned n)
rat::ratexp_polynomial_t< RatExpSet > split(const RatExpSet &rs, const typename RatExpSet::value_t &e)
Split a ratexp.
auto infiltration(const Auts &...as) -> product_automaton< decltype(join_automata(as...)), Auts...>
The (accessible part of the) infiltration product.
ratexp concatenate_ratexp(const ratexp &lhs, const ratexp &rhs)
Bridge.
identities
A ratexpset can implement several different sets of identities on expressions.
automaton_editor * make_automaton_editor(const context &ctx)
Bridge.
ratexp chain_ratexp(const ratexp &re, int min, int max)
Bridge.
bool register_functions_is_free(std::true_type)
filter_automaton< Aut > accessible(const Aut &a)
bool is_synchronizing(const Aut &aut)
Aut chain(const Aut &aut, int min, int max)
auto read_label(std::istream &is, const Context &ctx) -> label_t_of< Context >
std::ostream & dot(const Aut &aut, std::ostream &out, bool dot2tex=false)
auto eval(const Aut &a, const typename labelset_t_of< Aut >::word_t &w) -> weight_t_of< Aut >
ratexp right_mult_ratexp(const ratexp &exp, const weight &weight)
Bridge.
bool register_functions()
Ctx make_context(const std::string &name)
AutOut left_mult(const weight_t_of< AutOut > &w, const AutIn &aut)
polynomial concatenate_polynomial(const polynomial &lhs, const polynomial &rhs)
Bridge.
ratexp difference_ratexp(const ratexp &lhs, const ratexp &rhs)
Bridge.
ratexp left_mult_ratexp(const weight &weight, const ratexp &exp)
Bridge.
bool is_out_sorted(const Aut &a)
Whether for each state, the outgoing transitions are sorted by increasing label.
bool is_normalized(const Aut &a)
Whether a is standard and co-standard.
ratexp sum_ratexp(const ratexp &lhs, const ratexp &rhs)
Bridge.