4 #include <unordered_map>
6 #include <boost/range/algorithm/min_element.hpp>
7 #include <boost/range/algorithm/sort.hpp>
20 template <Automaton Aut>
27 template <
typename Ctx = context_t_of<Aut>>
34 using set_t = std::vector<state_t>;
68 return lhs[0] < rhs[0];
79 state_to_class[s] = c;
89 = s == aut->pre() ?
res->pre()
90 : s == aut->post() ?
res->post()
92 origins[class_to_res_state[c]].insert(begin(set), end(set));
99 state_t src = class_to_res_state[c];
103 state_t dst = class_to_res_state[state_to_class[d]];
104 res->add_transition(src, dst,
105 aut->label_of(t), aut->weight_of(t));
118 template <Automaton Aut>
121 template <Automaton Aut>
std::vector< state_t > class_to_state_t
auto make_partition_automaton(const fresh_automaton_t_of< Aut > &res, const Aut &input, const typename detail::partition_automaton_impl< Aut >::origins_t origins) -> partition_automaton_t< Aut >
Build a partition_automaton.
Apply a quotient onto an automaton: fuse equivalent states.
auto quotient(const Aut &a, typename detail::quotienter< Aut >::class_to_set_t &cs) -> quotient_t< Aut >
std::unordered_map< state_t, class_t > state_to_class_t
typename Aut::element_type::template fresh_automaton_t< Context > fresh_automaton_t_of
Given an automaton type, the type of its copies.
std::vector< set_t > class_to_set_t
typename origins_t_of_impl< Aut >::type origins_t_of
The type of the origins map for a partition automaton, or a transposed one.
quotient_t operator()(const automaton_t &aut)
Build the resulting automaton.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
typename detail::partition_automaton_t_impl< Aut >::type partition_automaton_t
The return type when calling quotient on Aut.
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
quotienter(class_to_set_t &class_to_set)
AutOut make_fresh_automaton(const AutIn &model)
Create an empty, mutable, automaton, based on another one.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
std::vector< state_t > set_t
partition_automaton_t< automaton_t > quotient_t
partition_automaton_t< Aut > quotient_t
The return type when calling quotient on Aut.
origins_t_of< quotient_t > origins_t
state_t_of< automaton_t > state_t
class_to_set_t & class_to_set_
auto sort(const Aut &a) -> permutation_automaton< Aut >
fresh_automaton_t_of< automaton_t, Ctx > fresh_automaton_t
void sort_classes_()
Sort the classes.
Request the set implementation (bool weights).