7 #include <vcsn/dyn/fwd.hh>
14 template <Automaton Aut>
17 -> std::enable_if_t<!is_tropical<weightset_t_of<Aut>>::value,
25 catch (
const std::runtime_error& e)
27 raise(e,
" while computing weight series");
31 template <Automaton Aut>
34 -> std::enable_if_t<is_tropical<weightset_t_of<Aut>>::value,
40 return res ?
res->second : a->weightset()->zero();
42 catch (
const std::runtime_error& e)
44 raise(e,
" while computing weight series");
53 template <Automaton Aut>
57 const auto& a = aut->
as<Aut>();
59 const auto&
ctx = a->context();
60 return {*
ctx.weightset(), res};
value_impl< detail::weight_tag > weight
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
auto proper(const Aut &aut, direction dir=direction::backward, bool prune=true, const std::string &algo="auto") -> fresh_automaton_t_of< Aut, detail::proper_context< context_t_of< Aut >>>
Eliminate spontaneous transitions.
auto to_spontaneous(const Aut &aut) -> std::enable_if_t<!context_t_of< Aut >::is_lao, decltype(make_mutable_automaton(make_context(oneset(), *aut->weightset())))>
Convert to spontaneous automaton: change every transition's label to the empty word.
weight weight_series(const automaton &aut)
Bridge.
auto weight_series(const Aut &a) -> std::enable_if_t<!is_tropical< weightset_t_of< Aut >>::value, weight_t_of< Aut >>
auto eval(const Aut &a, const word_t_of< Aut > &w) -> std::enable_if_t<!context_t_of< Aut >::is_lao, weight_t_of< Aut >>
General case of evaluation.
auto path_monomial(const Aut &aut, const std::vector< transition_t_of< Aut >> &path, state_t_of< Aut > src=Aut::element_type::pre(), state_t_of< Aut > dst=Aut::element_type::post()) -> boost::optional< typename detail::word_polynomialset_t< context_t_of< Aut >>::monomial_t >
Given a path (typically computed by lightest_path), the corresponding monomial (label, weight).
auto & as()
Extract wrapped typed automaton.
std::vector< transition_t_of< Aut > > lightest_path(const Aut &aut, state_t_of< Aut > source, state_t_of< Aut > dest, a_star_tag)