21 #ifndef AWALI_ALGOS_ACCESSIBLE_HH
22 #define AWALI_ALGOS_ACCESSIBLE_HH
27 #include <unordered_set>
45 template <
typename Set,
typename Aut>
54 using worklist_t = std::queue<state_t>;
56 todo.emplace(a.pre());
60 const state_t src = todo.front();
63 for (
auto tr : a.all_out(src))
67 if(dst != a.post() || include_pre_post)
68 if (res.emplace(dst).second)
84 template <
typename Aut>
89 std::set<state_t> res;
94 template <
typename Set,
typename Aut>
111 template <
typename Aut>
129 template <
typename Aut>
151 template <
typename Aut>
155 std::unordered_set<state_t> set;
168 template <
typename Aut>
172 std::unordered_set<state_t> set;
185 template <
typename Aut>
210 template <
typename Aut>
211 typename Aut::element_type::automaton_nocv_t
224 template <
typename Aut>
243 template <
typename Aut>
244 typename Aut::element_type::automaton_nocv_t
257 template <
typename Aut>
276 template <
typename Aut>
277 typename Aut::element_type::automaton_nocv_t
278 trim(
const Aut& aut,
bool keep_history=
true)
290 template <
typename Aut>
307 template <
typename Aut>
320 template <
typename Aut>
333 template <
typename Aut>
346 template <
typename Aut>
352 template <
typename Aut>
353 bool is_empty(
const Aut& aut) ATTRIBUTE_PURE;
364 template <
typename Aut>
367 return aut->num_states() == 0;
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.
bool is_empty(const Aut &aut) ATTRIBUTE_PURE
Test whether the automaton has no state.
Definition: accessible.hh:365
size_t num_useful_states(const Aut &aut)
Number of useful states.
Definition: accessible.hh:187
bool is_accessible(const Aut &aut)
Test whether every state of the automaton is accessible.
Definition: accessible.hh:334
void coaccessible_here(Aut &aut)
In-place coaccessible subautomaton.
Definition: accessible.hh:259
void trim_here(Aut &aut)
In-place trim subautomaton.
Definition: accessible.hh:292
void fill_with_accessible_states(Set &res, const Aut &aut, bool include_pre_post=false)
Definition: accessible.hh:47
void accessible_here(Aut &aut)
In-place accessible subautomaton.
Definition: accessible.hh:226
void sub_automaton(Aut &aut, Pred keep_state)
Definition: sub_automaton.hh:32
size_t num_coaccessible_states(const Aut &aut)
Number of coaccessible states.
Definition: accessible.hh:170
bool is_useless(const Aut &aut)
Test whether the automaton has useful states.
Definition: accessible.hh:321
Aut::element_type::automaton_nocv_t trim(const Aut &aut, bool keep_history=true)
Trim subautomaton.
Definition: accessible.hh:278
std::set< state_t > useful_states(const Aut &aut, bool include_pre_post=false)
List of useful states.
Definition: accessible.hh:131
std::set< state_t > coaccessible_states(const Aut &aut, bool include_pre_post=false)
List of coaccessible states.
Definition: accessible.hh:113
Aut::element_type::automaton_nocv_t accessible(const Aut &aut, bool keep_history=true)
Accessible subautomaton.
Definition: accessible.hh:212
AutOut copy(const AutIn &input, Pred keep_state, bool keep_history=true, bool transpose=false)
A copy of input keeping only its states that are accepted by keep_state.
Definition: copy.hh:189
bool is_coaccessible(const Aut &aut)
Test whether every state of the automaton is coaccessible.
Definition: accessible.hh:347
bool is_trim(const Aut &aut)
Test whether the automaton is trim.
Definition: accessible.hh:308
Aut::element_type::automaton_nocv_t coaccessible(const Aut &aut, bool keep_history=true)
Coaccessible subautomaton.
Definition: accessible.hh:245
std::set< state_t > accessible_states(const Aut &aut, bool include_pre_post=false)
List of accessible states.
Definition: accessible.hh:86
std::shared_ptr< internal::transpose_view_impl< Aut > > transpose_view(std::shared_ptr< Aut > aut)
Definition: transpose_view.hh:265
size_t num_accessible_states(const Aut &aut)
Number of accessible states.
Definition: accessible.hh:153
void fill_with_coaccessible_states(Set &res, const Aut &aut, bool include_pre_post=false)
Definition: accessible.hh:96
Main namespace of Awali.
Definition: ato.hh:22
unsigned state_t
Definition: types.hh:21