5 #include <boost/range/algorithm/sort.hpp>
22 template <Automaton Aut>
36 const auto& llab =
aut_->label_of(l);
37 const auto& rlab =
aut_->label_of(r);
38 if (
aut_->labelset()->less(llab, rlab))
40 else if (
aut_->labelset()->less(rlab, llab))
43 return aut_->dst_of(l) <
aut_->dst_of(r);
57 template <Automaton Aut>
63 for (
auto s: a->states())
74 template <Automaton Aut>
78 const auto& a = aut->as<Aut>();
91 template <Automaton Aut>
114 return std::move(
res_);
120 while (!
res_->todo_.empty())
122 auto p =
res_->todo_.front();
130 std::vector<input_transition_t> ts;
141 res_->new_transition_copy(res_s,
res_->state(
res_->input_->dst_of(t)),
149 for (
auto s:
res_->input_->all_states())
160 template <Automaton Aut>
176 template <Automaton Aut>
180 const auto& a = aut->as<Aut>();
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
ATTRIBUTE_PURE bool operator()(const transition_t l, const transition_t r) const
transition_t_of< automaton_t > transition_t
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
automaton sort(const automaton &aut)
Bridge.
bool is_sorted_forward(const Container &container, Compare comp)
Same as std::is_sorted, but works with an input iterator, not just a forward iterator.
transition_less(const automaton_t &a)
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_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...
const weightset_t_of< input_automaton_t > & ws_
Provide a variadic mul on top of a binary mul(), and one().
void visit_successors_of_(input_state_t s, state_t res_s)
permutation_automaton< input_automaton_t > automaton_t
Result automaton type.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
state_t_of< input_automaton_t > input_state_t
bool is_out_sorted(const Aut &a)
Whether for each state, the outgoing transitions are sorted by increasing label.
std::shared_ptr< detail::permutation_automaton_impl< Aut >> permutation_automaton
A permutation automaton as a shared pointer.
state_t_of< automaton_t > state_t
std::shared_ptr< detail::automaton_base > automaton
void visit_and_update_res_()
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
transition_t_of< input_automaton_t > input_transition_t
Compare transitions of an automaton.
bool is_out_sorted(const automaton &aut)
Bridge.
auto sort(const Aut &a) -> permutation_automaton< Aut >
sorter(const input_automaton_t &a)
automaton_t res_
Sorted automaton.
const labelset_t_of< input_automaton_t > & ls_
A function to sort an automaton.
void push_inaccessible_states_()
Aut input_automaton_t
Input automaton type.
Functor to compare Values of ValueSets.