18 template <Automaton Aut>
19 using states_t = std::unordered_set<state_t_of<Aut>>;
25 template <Automaton Aut>
29 using automaton_t = Aut;
36 using worklist_t = std::queue<state_t>;
37 auto todo = worklist_t{};
38 todo.emplace(aut->pre());
42 const state_t src = todo.front();
45 if (strict || !aut->is_lazy(src))
46 for (
auto tr :
all_out(aut, src))
48 state_t dst = aut->dst_of(tr);
50 if (res.emplace(dst).second)
62 template <Automaton Aut>
73 template <Automaton Aut>
88 template <Automaton Aut>
93 size_t res =
set.size();
103 template <Automaton Aut>
111 template <Automaton Aut>
116 size_t res =
set.size();
132 template <Automaton Aut>
133 filter_automaton<Aut>
140 template <Automaton Aut>
141 filter_automaton<Aut>
148 template <Automaton Aut>
149 filter_automaton<Aut>
160 template <Automaton Aut>
167 template <Automaton Aut>
174 template <Automaton Aut>
181 template <Automaton Aut>
187 template <Automaton Aut>
188 bool is_empty(
const Aut& a) ATTRIBUTE_PURE;
191 template <Automaton Aut>
196 return a->num_states() == 0;
204 template <Automaton Aut>
208 const auto& a = aut->as<Aut>();
213 template <Automaton Aut>
217 const auto& a = aut->as<Aut>();
222 template <Automaton Aut>
226 const auto& a = aut->as<Aut>();
231 template <Automaton Aut>
235 const auto& a = aut->as<Aut>();
240 template <Automaton Aut>
244 const auto& a = aut->as<Aut>();
249 template <Automaton Aut>
253 const auto& a = aut->as<Aut>();
258 template <Automaton Aut>
262 const auto& a = aut->as<Aut>();
267 template <Automaton Aut>
271 const auto& a = aut->as<Aut>();
std::unordered_set< state_t_of< Aut >> states_t
bool is_trim(const automaton &aut)
Bridge.
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
filter_automaton< Aut > trim(const Aut &a)
Useful part of an automaton.
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
Request the set implementation (bool weights).
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an automaton.
bool is_coaccessible(const automaton &aut)
Bridge.
bool is_trim(const Aut &a)
Whether all its states are useful.
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
filter_automaton< Aut > accessible(const Aut &a)
Accessible part of an automaton.
Aut transpose(const transpose_automaton< Aut > &aut)
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
automaton accessible(const automaton &aut)
Bridge.
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
filter_automaton< Aut > filter(const Aut &aut, const std::unordered_set< state_t_of< Aut >> &ss)
Get an automaton who is a part state set ss of aut.
bool is_accessible(const automaton &aut)
Bridge.
bool is_coaccessible(const Aut &a)
Whether all its states are coaccessible.
std::shared_ptr< detail::automaton_base > automaton
automaton trim(const automaton &aut)
Bridge.
Container set_intersection(const Container &s1, const Container &s2)
The intersection of two sets.
states_t< Aut > accessible_states(const Aut &aut, bool strict=true)
The set of accessible states, including pre(), and possibly post().
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
bool is_useless(const automaton &aut)
Bridge.
bool is_useless(const Aut &a)
Whether all no state is useful.
states_t< Aut > useful_states(const Aut &a, bool strict=true)
The set of useful states, including possibly pre() and post().
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
automaton coaccessible(const automaton &aut)
Bridge.
bool is_empty(const automaton &aut)
Bridge.
bool is_accessible(const Aut &a)
Whether all its states are accessible.