13 template <Automaton Aut>
18 "universal: requires free labelset");
20 "universal: requires Boolean weights");
26 using map_t = std::map<state_t, state_set_t>;
36 return work_(automaton);
55 for (
const auto& p: codet->origins())
56 if (p.first != codet->pre()
57 && p.first != codet->post())
59 auto from = std::set<state_t>{};
60 for (
auto sw: p.second)
62 res.emplace(p.first, std::move(from));
79 auto automaton_finals = std::set<state_t>{};
81 automaton_finals.insert(aut->src_of(t));
87 for (
const auto s: univers_states)
90 state_t new_s = res->new_state();
91 subset_label[new_s] = s;
94 res->set_initial(new_s);
96 if (
subset(s, automaton_finals))
97 res->set_final(new_s);
101 for (
const auto x: res->states())
102 for (
const auto y: res->states())
103 for (
const auto a: *res->labelset())
107 for (
auto s: subset_label[x])
110 for (
auto t:
out(aut, s, a))
113 delta_ret.insert(aut->dst_of(t));
125 if (
subset(delta_ret, subset_label[y]))
126 res->new_transition(x, y, a);
133 template <Automaton Aut>
146 template <Automaton Aut>
150 const auto& a = aut->
as<Aut>();
automaton_t operator()(const Aut &automaton)
The universal automaton of automaton.
automaton_t work_(const automaton_t &aut)
Work on aut, which is complete and deterministic.
auto complete(const Aut &aut) -> decltype(::vcsn::copy(aut))
bool is_complete(const Aut &aut)
Whether aut is complete.
Aut transpose(const transpose_automaton< Aut > &aut)
bool subset(const Container &set1, const Container &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
std::set< typename std::map< Key, Value, Comp, Alloc >::mapped_type > image(const std::map< Key, Value, Comp, Alloc > &m)
The set of values of a map.
auto label_of(const welement< Label, Weight > &m) -> decltype(m.label())
The label of a welement.
automaton universal(const automaton &aut)
Bridge.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
std::map< state_t, state_set_t > map_t
std::set< std::set< T, Compare, Alloc > > intersection_closure(std::set< std::set< T, Compare, Alloc >> pset)
The set of all the intersections of the sets in pset.
Aut universal(const Aut &a)
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
AutOut make_fresh_automaton(const AutIn &model)
Create an empty, mutable, automaton, based on another one.
auto determinize(const Aut &a, Tag={}, bool_constant< Lazy >={})
auto strip(const Aut &aut, int) -> decltype(aut->strip())
state_t_of< automaton_t > state_t
auto initial_transitions(const Aut &aut) -> decltype(aut->all_out(aut->pre()))
Indexes of transitions to (visible) initial states.
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
auto & as()
Extract wrapped typed automaton.
std::set< state_set_t > pstate_t
Provide a variadic mul on top of a binary mul(), and one().
std::set< state_t > state_set_t
Container::value_type front(const Container &container)
The first member of this Container.
auto final_transitions(const Aut &aut) -> decltype(aut->all_in(aut->post()))
Indexes of transitions from (visible) final states.