8 template <Automaton Aut>
12 require(aut->labelset()->has_one(),
13 __func__,
": labelset must be nullable");
15 const auto& ls = *aut->labelset();
16 const auto& ws = *aut->weightset();
18 auto res = make_shared_ptr<Aut>(aut->context());
24 for (
const auto s: aut->states())
29 return (aut->src_of(t) != aut->pre()
30 && aut->dst_of(t) != aut->post()); });
34 return (aut->src_of(t) != aut->pre())
35 && (aut->dst_of(t) != aut->post()); });
37 res->set_initial(copy_pref.state_map().at(s));
38 res->set_final(copy_suff.state_map().at(s));
44 res->new_transition(copy_pref.state_map().at(aut->src_of(ft)),
45 copy_suff.state_map().at(aut->dst_of(it)),
57 template <Automaton Aut>
61 const auto& aut = a->
as<Aut>();
auto final_transitions(const Aut &aut) -> decltype(aut->all_in(aut->post()))
Indexes of transitions from (visible) final states.
automaton conjugate(const automaton &a)
Bridge.
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
detail::copier< AutIn, AutOut > make_copier(const AutIn &in, AutOut &out, bool safe=true)
Build an automaton copier.
auto initial_transitions(const Aut &aut) -> decltype(aut->all_out(aut->pre()))
Indexes of transitions to (visible) initial states.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
Aut conjugate(const Aut &aut)
auto & as()
Extract wrapped typed automaton.