18 template <
typename Aut>
19 using states_t = std::unordered_set<state_t_of<Aut>>;
25 template <
typename 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->state_is_strict(src))
46 for (
auto tr : aut->all_out(src))
48 state_t dst = aut->dst_of(tr);
50 if (res.emplace(dst).second)
62 template <
typename Aut>
73 template <
typename Aut>
88 template <
typename Aut>
93 size_t res =
set.size();
103 template <
typename Aut>
111 template <
typename Aut>
116 size_t res =
set.size();
132 template <
typename Aut>
133 filter_automaton<Aut>
140 template <
typename Aut>
141 filter_automaton<Aut>
148 template <
typename Aut>
149 filter_automaton<Aut>
160 template <
typename Aut>
167 template <
typename Aut>
174 template <
typename Aut>
181 template <
typename Aut>
187 template <
typename Aut>
188 bool is_empty(
const Aut& a) ATTRIBUTE_PURE;
191 template <
typename Aut>
196 return a->num_states() == 0;
204 template <
typename Aut>
208 const auto& a = aut->as<Aut>();
213 template <
typename Aut>
217 const auto& a = aut->as<Aut>();
222 template <
typename Aut>
226 const auto& a = aut->as<Aut>();
231 template <
typename Aut>
235 const auto& a = aut->as<Aut>();
240 template <
typename Aut>
244 const auto& a = aut->as<Aut>();
249 template <
typename Aut>
253 const auto& a = aut->as<Aut>();
258 template <
typename Aut>
262 const auto& a = aut->as<Aut>();
267 template <
typename Aut>
271 const auto& a = aut->as<Aut>();
bool is_useless(const automaton &aut)
Bridge.
size_t num_useful_states(const Aut &a)
Number of accessible states, not counting pre() and post().
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
filter_automaton< Aut > trim(const Aut &a)
Useful part of an automaton.
bool is_accessible(const Aut &a)
Whether all its states are accessible.
filter_automaton< Aut > accessible(const Aut &a)
Accessible part of an automaton.
automaton trim(const automaton &aut)
Bridge.
states_t< Aut > accessible_states(const Aut &aut, bool strict=true)
The set of accessible states, including pre(), and possibly post().
bool is_accessible(const automaton &aut)
Bridge.
bool is_coaccessible(const automaton &aut)
Bridge.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
bool is_trim(const automaton &aut)
Bridge.
automaton accessible(const automaton &aut)
Bridge.
bool is_useless(const Aut &a)
Whether all no state is useful.
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an automaton.
bool is_empty(const automaton &aut)
Bridge.
Aut transpose(const transpose_automaton< Aut > &aut)
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.
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
std::shared_ptr< detail::automaton_base > automaton
size_t num_coaccessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().
std::unordered_set< state_t_of< Aut >> states_t
bool is_empty(const Aut &a) ATTRIBUTE_PURE
Whether has no states.
bool is_trim(const Aut &a)
Whether all its states are useful.
bool is_coaccessible(const Aut &a)
Whether all its states are coaccessible.
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.
states_t< Aut > useful_states(const Aut &a, bool strict=true)
The set of useful states, including possibly pre() and post().
std::set< T, Compare, Alloc > intersection(const std::set< T, Compare, Alloc > &set1, const std::set< T, Compare, Alloc > &set2)
The intersection of two sets.
automaton coaccessible(const automaton &aut)
Bridge.
size_t num_accessible_states(const Aut &a)
Number of accessible states, not counting pre() and post().