21 #ifndef AWALI_ALGOS_RESTRICTION_HH
22 #define AWALI_ALGOS_RESTRICTION_HH
35 template<
typename SET>
36 static LS
make(
const SET& letters) {
43 template<
typename SET>
63 template<
typename Aut>
65 std::set<typename labelset_t_of<Aut>::letter_t> new_alphabet;
66 for(
auto l: aut->labelset()->genset())
67 new_alphabet.insert(l);
69 new_alphabet.erase(l);
72 if(del_unvalid_transitions) {
73 auto labelset = aut->labelset();
74 std::list<transition_t> to_erase;
75 for(
auto tr: aut->transitions())
76 if(!labelset->is_valid(aut->label_of(tr)))
77 to_erase.emplace_back(tr);
78 for(
auto tr: to_erase)
79 aut->del_transition(tr);
96 template<
typename Aut>
100 if(del_unvalid_transitions) {
101 auto labelset = aut->labelset();
102 std::list<transition_t> to_erase;
103 for(
auto tr: aut->transitions())
104 if(!labelset->is_valid(aut->label_of(tr)))
105 to_erase.emplace_back(tr);
106 for(
auto tr: to_erase)
107 aut->del_transition(tr);
Implementation of labels are nullables (letter or empty).
Definition: nullableset.hh:189
typename internal::context_t_of_impl< internal::base_t< ValueSet > >::type context_t_of
Helper to retrieve the type of the context of a value set.
Definition: traits.hh:66
typename internal::labelset_t_of_impl< internal::base_t< ValueSet > >::type labelset_t_of
Helper to retrieve the type of the labelset of a value set.
Definition: traits.hh:76
void change_alphabet(Aut &aut, const std::set< typename labelset_t_of< Aut >::letter_t > &letters, bool del_unvalid_transitions=true)
Change letters in the alphabet of the automaton.
Definition: restriction.hh:97
void remove_letters(Aut &aut, const std::set< typename labelset_t_of< Aut >::letter_t > &letters, bool del_unvalid_transitions=true)
Remove letters from the alphabet of the automaton.
Definition: restriction.hh:64
Main namespace of Awali.
Definition: ato.hh:22
static nullableset< LS > make(const SET &letters)
Definition: restriction.hh:44
Definition: restriction.hh:34
static LS make(const SET &letters)
Definition: restriction.hh:36