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>();
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
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.
Aut universal(const Aut &a)
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
bool is_complete(const Aut &aut)
Whether aut is complete.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
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.
auto complete(const Aut &aut) -> decltype(::vcsn::copy(aut))
A complete copy of aut.
AutOut make_fresh_automaton(const AutIn &model)
Create an empty, mutable, automaton, based on another one.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
auto label_of(const welement< Label, Weight > &m) -> decltype(m.label())
The label of a welement.
std::set< state_set_t > pstate_t
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
automaton_t operator()(const Aut &automaton)
The universal automaton of automaton.
Aut transpose(const transpose_automaton< Aut > &aut)
The transpose of a transpose automaton is the original automaton.
state_t_of< automaton_t > state_t
automaton_t work_(const automaton_t &aut)
Work on aut, which is complete and deterministic.
Container::value_type front(const Container &container)
The first member of this Container.
std::map< state_t, state_set_t > map_t
auto initial_transitions(const Aut &aut) -> decltype(aut->all_out(aut->pre()))
Indexes of transitions to (visible) initial states.
std::set< state_t > state_set_t
auto & as()
Extract wrapped typed automaton.
bool subset(const Container &set1, const Container &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
automaton universal(const automaton &aut)
Bridge.
auto final_transitions(const Aut &aut) -> decltype(aut->all_in(aut->post()))
Indexes of transitions from (visible) final states.
auto strip(const Aut &aut, int) -> decltype(aut->strip())
auto determinize(const Aut &a, Tag={}, bool_constant< Lazy >={})
Provide a variadic mul on top of a binary mul(), and one().