1 #ifndef VCSN_ALGOS_INSPLIT_HH
2 # define VCSN_ALGOS_INSPLIT_HH
4 # include <unordered_map>
8 # include <vcsn/algos/fwd.hh>
16 template <
typename Aut>
24 using pair_t =
typename std::pair<state_t, bool>;
44 for (
auto st : aut->states())
46 bool epsilon_in =
false;
47 bool letter_in =
false;
49 for (
auto tr : aut->all_in(st))
55 if (epsilon_in && letter_in)
64 for (
auto st : aut->all_states())
65 for (
bool epsilon : {
false,
true })
67 for (
auto t : aut->all_out(st))
73 return std::move(
res_);
83 typename std::enable_if<labelset_t_of<A>::has_one(),
87 return aut->labelset()->is_one(aut->label_of(tr));
91 typename std::enable_if<!labelset_t_of<A>::has_one(),
95 raise(
"lal should not reach this point!");
101 template<
typename Aut>
102 typename std::enable_if<labelset_t_of<Aut>::has_one(), Aut>::type
109 template<
typename Aut>
110 typename std::enable_if<!labelset_t_of<Aut>::has_one(), Aut>::type
117 template <
typename Aut>
131 template <
typename Aut>
135 const auto& a = aut->as<Aut>();
146 #endif // !VCSN_ALGOS_INSPLIT_HH
insplitter(const Aut &aut)
std::enable_if<!labelset_t_of< A >::has_one(), bool >::type is_one(const A &, transition_t)
bool exists(state_t st, bool epsilon)
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
automaton insplit(const automaton &aut)
Bridge.
automaton_t operator()(const Aut &aut)
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
state_t_of< automaton_t > state_t
auto insplit(const Aut &aut) -> decltype(detail::insplit(aut))
std::enable_if< labelset_t_of< A >::has_one(), bool >::type is_one(const A &aut, transition_t tr)
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
std::unordered_map< pair_t, state_t > states_assoc
std::enable_if< labelset_t_of< Aut >::has_one(), Aut >::type insplit(Aut &aut)
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
label_t_of< automaton_t > label_t
auto real_context(const Aut &aut) -> decltype(real_context_impl< Aut >::context(aut))
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
SharedPtr make_shared_ptr(Args &&...args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
typename std::pair< state_t, bool > pair_t
transition_t_of< automaton_t > transition_t