13 template <
typename 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);
46 state_t i = aut->dst_of(aut->initial_transitions().front());
52 map_t origin = codet->origins();
53 origin.erase(codet->pre());
67 std::set<state_t> automaton_finals;
68 for (
auto t: aut->final_transitions())
69 automaton_finals.insert(aut->src_of(t));
75 for (
const auto s: univers_states)
78 state_t new_s = res->new_state();
79 subset_label[new_s] = s;
82 res->set_initial(new_s);
84 if (
subset(s, automaton_finals))
85 res->set_final(new_s);
89 for (
const auto x: res->states())
90 for (
const auto y: res->states())
91 for (
const auto a: *res->labelset())
95 for (
auto s: subset_label[x])
98 for (
auto t: aut->out(s, a))
101 delta_ret.insert(aut->dst_of(t));
113 if (
subset(delta_ret, subset_label[y]))
114 res->new_transition(x, y, a);
121 template <
typename Aut>
135 template <
typename Aut>
139 const auto& a = aut->as<Aut>();
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.
automaton universal(const automaton &aut)
Bridge.
bool subset(const Container &set1, const Container &set2) ATTRIBUTE_PURE
Whether set1 ⊆ set2.
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
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_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 strip(const Aut &aut, int) -> decltype(aut->strip())
Aut transpose(const transpose_automaton< Aut > &aut)
Aut universal(const Aut &a)
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
automaton_t work_(const automaton_t &aut)
Work on aut, which is complete and deterministic.
bool is_complete(const Aut &aut)
Whether aut is complete.
Provide a variadic mul on top of a binary mul(), and one().
std::shared_ptr< detail::automaton_base > automaton
std::map< state_t, state_set_t > map_t
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
automaton_t operator()(const Aut &automaton)
The universal automaton of automaton.
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.
state_t_of< automaton_t > state_t
auto determinize(const Aut &a) -> determinized_automaton< Aut >
std::set< state_t > state_set_t
std::set< state_set_t > pstate_t
auto complete(const Aut &aut) -> decltype(::vcsn::copy(aut))