1 #ifndef VCSN_ALGOS_COMPLEMENT_HH
2 # define VCSN_ALGOS_COMPLEMENT_HH
19 template <
typename Aut>
24 "complement: requires free labelset");
26 "complement: requires Boolean weights");
28 using automaton_t = Aut;
31 "complement: requires a deterministic automaton");
33 "complement: requires a complete automaton");
38 std::set<state_t> finals;
39 for (
auto t: aut->final_transitions())
40 finals.insert(aut->src_of(t));
43 for (
auto s: aut->states())
50 template <
typename Aut>
53 -> decltype(
copy(aut))
65 template <
typename Aut>
69 const auto& a = aut->as<Aut>();
87 template <
typename RatExpSet>
91 const auto& e = exp->as<RatExpSet>();
94 e.ratexpset().complement(e.ratexp()));
104 #endif // !VCSN_ALGOS_COMPLEMENT_HH
automaton complement(const automaton &aut)
Bridge.
ratexp make_ratexp(const RatExpSet &rs, const typename RatExpSet::value_t &ratexp)
bool is_deterministic(const Aut &aut, state_t_of< Aut > s)
Whether state s is deterministic in aut.
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
automaton make_automaton(const Aut &aut)
Build a dyn::automaton.
ratexp complement_ratexp(const ratexp &exp)
Bridge.
std::shared_ptr< detail::ratexp_base > ratexp
bool is_complete(const Aut &aut)
Whether aut is complete.
AutOut copy(const AutIn &input, Pred keep_state)
A copy of input keeping only its states that are accepted by keep_state.
void complement_here(Aut &aut)
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
auto complement(const Aut &aut) -> decltype(copy(aut))
Provide a variadic mul on top of a binary mul(), and one().
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
bool has(const std::map< Key, Value, Compare, Alloc > &s, const Key &e)
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.