7 #include <vcsn/dyn/fwd.hh>
20 template <Automaton Aut,
typename Algo = auto_tag>
21 fresh_automaton_t_of<Aut>
24 require(is_tropical<weightset_t_of<Aut>>(),
25 "lightest-automaton: require tropical weightset");
33 for (
auto path : paths)
35 if (t != aut->null_transition())
41 for (
auto t = pred[aut->post()];
42 t != aut->null_transition();
43 t = pred[aut->src_of(t)])
54 template <Automaton Aut,
typename Num,
typename String>
58 const auto& a = aut->
as<Aut>();
std::vector< std::vector< transition_t_of< Aut > > > k_lightest_path(const Aut &aut, state_t_of< Aut > source, state_t_of< Aut > dest, unsigned k)
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
auto copy(const AutIn &input, KeepState keep_state, KeepTrans keep_trans) -> decltype(keep_state(input->null_state()), keep_trans(input->null_transition()), make_fresh_automaton< AutIn, AutOut >(input))
A copy of input keeping only its states that are accepted by keep_state, and transitions accepted by ...
AutOut make_fresh_automaton(const AutIn &model)
Create an empty, mutable, automaton, based on another one.
detail::copier< AutIn, AutOut > make_copier(const AutIn &in, AutOut &out, bool safe=true)
Build an automaton copier.
auto & as()
Extract wrapped typed automaton.
fresh_automaton_t_of< Aut > lightest_automaton(const Aut &aut, unsigned k, Algo algo={})
Lightest Automaton.
automaton lightest_automaton(const automaton &aut, unsigned k, const std::string &algo)
Bridge.
std::vector< transition_t_of< Aut > > lightest_path(const Aut &aut, state_t_of< Aut > source, state_t_of< Aut > dest, a_star_tag)