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