3 #include <unordered_map>
7 #include <vcsn/algos/fwd.hh>
14 template <
typename Aut>
23 using pair_t = std::pair<state_t, bool>;
38 states_assoc[
pair_t(aut->pre(),
false)] =
res_->pre();
39 states_assoc[
pair_t(aut->post(),
false)] =
res_->post();
41 for (
auto st : aut->states())
43 bool epsilon_in =
false;
44 bool letter_in =
false;
46 for (
auto tr : aut->all_in(st))
52 if (epsilon_in && letter_in)
56 states_assoc[
pair_t(st,
true)] =
res_->new_state();
58 states_assoc[
pair_t(st,
false)] =
res_->new_state();
61 for (
auto st : aut->all_states())
62 for (
bool epsilon : {
false,
true })
64 for (
auto t : aut->all_out(st))
65 res_->add_transition_copy(states_assoc[
pair_t(st, epsilon)],
66 states_assoc[
pair_t(aut->dst_of(t),
70 return std::move(
res_);
76 return states_assoc.find(
pair_t(st, epsilon)) != states_assoc.end();
82 return aut->labelset()->is_one(aut->label_of(tr));
88 template<
typename Aut>
96 template<
typename Aut>
104 template <
typename Aut>
118 template <
typename Aut>
122 const auto& a = aut->as<Aut>();
bool exists(state_t st, bool epsilon)
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
insplitter(const Aut &aut)
bool is_spontaneous(const Aut &aut, transition_t tr)
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
typename std::enable_if< Cond, T >::type enable_if_t
auto real_context(const Aut &aut) -> decltype(real_context_impl< Aut >::context(aut))
For a focus automaton, its genuine context (not the visible one), and for all the other automata...
std::pair< state_t, bool > pair_t
SharedPtr make_shared_ptr(Args &&...args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
state_t_of< automaton_t > state_t
vcsn::enable_if_t< labelset_t_of< Aut >::has_one(), Aut > insplit(Aut &aut)
transition_t_of< automaton_t > transition_t
std::shared_ptr< detail::automaton_base > automaton
auto insplit(const Aut &aut) -> decltype(detail::insplit(aut))
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
label_t_of< automaton_t > label_t
std::unordered_map< pair_t, state_t > states_assoc
automaton insplit(const automaton &aut)
Bridge.
automaton_t operator()(const Aut &aut)