21 template <Automaton AutIn, Automaton AutOut>
40 using map_t = std::vector<out_state_t>;
50 auto in_ls =
in_aut_->labelset();
55 for (
auto st :
in_aut_->states())
58 for (
auto st :
in_aut_->all_states())
61 auto letters = in_ls->letters_of_padded(
in_aut_->label_of(tr),
63 auto it = letters.begin();
64 if (it != letters.end())
67 auto dst = std::next(it) != letters.end()
73 for (++it; it != letters.end(); ++it)
75 dst = std::next(it) == letters.end()
78 out_aut_->new_transition(src, dst, *it, out_ws->one());
99 template <Automaton Aut>
103 template <Automaton Aut>
104 std::enable_if_t<!is_letterized_t<labelset_t_of<Aut>>{},
111 return lt.letterize();
115 template <Automaton Aut>
116 std::enable_if_t<is_letterized_t<labelset_t_of<Aut>>{},
132 template <Automaton Aut>
145 template <Automaton Aut>
159 template <Automaton Aut>
160 std::enable_if_t<!is_letterized_t<labelset_t_of<Aut>>{},
bool>
163 auto ls = aut->labelset();
166 auto it = ls->letters_of_padded(aut->label_of(t),
170 if (it.begin() != it.end() && ++(it.begin()) != it.end())
176 template <Automaton Aut>
177 std::enable_if_t<is_letterized_t<labelset_t_of<Aut>>{},
bool>
188 template <Automaton Aut>
200 template <Automaton Aut>
217 template <Automaton Aut>
230 template <Automaton Aut>
246 template <Automaton Aut>
258 template <Automaton Aut>
letterizer(const in_automaton_t &in_aut, const out_labelset_t &ls)
constant< type_t::one, Context > one
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
std::vector< out_state_t > map_t
out_automaton_t letterize()
transition_t_of< in_automaton_t > in_transition_t
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.
std::shared_ptr< detail::mutable_automaton_impl< Context >> mutable_automaton
A traits to compute the letterized context.
bool is_realtime(const automaton &aut)
Bridge.
mutable_automaton< Context > make_mutable_automaton(const Context &ctx)
automaton realtime(const automaton &aut)
Bridge.
From an automaton, the corresponding automaton with a non-word labelset.
labelset_t_of< in_automaton_t > in_labelset_t
automaton letterize(const automaton &aut)
Bridge.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
bool is_realtime(const Aut &aut)
Check if the automaton is realtime, i.e.
size_t states_size(const Aut &aut)
The largest state number, plus one.
auto realtime(const Aut &aut) -> decltype(proper(::vcsn::letterize(aut)))
Split the word transitions in the input automaton into letter ones, and remove the spontaneous transi...
bool is_proper(const Aut &aut)
Test whether an automaton is proper.
context_t_of< out_automaton_t > out_ctx_t
typename in_labelset_t::value_t in_label_t
typename out_labelset_t::value_t out_label_t
labelset_t_of< out_automaton_t > out_labelset_t
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
state_t_of< out_automaton_t > out_state_t
std::enable_if_t<!is_letterized_t< labelset_t_of< Aut > >{}, bool > is_letterized(const Aut &aut)
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
transition_t_of< out_automaton_t > out_transition_t
context_t_of< in_automaton_t > in_ctx_t
state_t_of< in_automaton_t > in_state_t
auto letterize(const Aut &aut) -> decltype(detail::letterize(aut))
Split the word transitions in the input automaton into letter ones.
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
auto & as()
Extract wrapped typed automaton.
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
bool is_letterized(const automaton &aut)
Bridge.
std::enable_if_t<!is_letterized_t< labelset_t_of< Aut > >{}, mutable_automaton< letterized_context< context_t_of< Aut > > > > letterize(const Aut &aut)
Letterize an automaton whose type is not letterized already.
letterized_t< LabelSet > make_letterized(const LabelSet &ls)