5 #include <boost/range/algorithm/sort.hpp>
22 template <
typename 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 <
typename Aut>
63 for (
auto s: a->states())
74 template <
typename Aut>
78 const auto& a = aut->as<Aut>();
91 template <
typename Aut>
114 return std::move(
res_);
120 while (!
res_->todo_.empty())
122 auto p =
res_->todo_.front();
130 std::vector<input_transition_t> ts;
135 for (
auto t:
res_->input_->all_out(s))
141 res_->new_transition_copy(res_s,
res_->state(
res_->input_->dst_of(t)),
149 for (
auto s:
res_->input_->all_states())
160 template <
typename Aut>
176 template <
typename Aut>
180 const auto& a = aut->as<Aut>();
state_t_of< input_automaton_t > input_state_t
sorter(const input_automaton_t &a)
transition_t_of< input_automaton_t > input_transition_t
state_t_of< automaton_t > state_t
Functor to compare Values of ValueSets.
automaton sort(const automaton &aut)
Bridge.
const weightset_t_of< input_automaton_t > & ws_
const labelset_t_of< input_automaton_t > & ls_
permutation_automaton< input_automaton_t > automaton_t
Result automaton type.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
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)
A function to sort an automaton.
Aut input_automaton_t
Input automaton type.
transition_t_of< automaton_t > transition_t
bool is_out_sorted(const automaton &aut)
Bridge.
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.
std::shared_ptr< detail::permutation_automaton_impl< Aut >> permutation_automaton
A permutation automaton as a shared pointer.
Provide a variadic mul on top of a binary mul(), and one().
void visit_and_update_res_()
std::shared_ptr< detail::automaton_base > automaton
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
void visit_successors_of_(input_state_t s, state_t res_s)
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
automaton_t res_
Sorted automaton.
bool is_out_sorted(const Aut &a)
Whether for each state, the outgoing transitions are sorted by increasing label.
ATTRIBUTE_PURE bool operator()(const transition_t l, const transition_t r) const
auto sort(const Aut &a) -> permutation_automaton< Aut >
void push_inaccessible_states_()
Compare transitions of an automaton.