7 #include <vcsn/dyn/fwd.hh>
22 template <Automaton Aut>
30 for (
const auto& o: prod->origins())
31 if (std::get<0>(o.second) != std::get<1>(o.second)
40 template <Automaton Aut>
52 template <Automaton Aut>
65 template <Automaton Aut>
70 "automaton is unambiguous");
71 const auto& ls = *aut->labelset();
73 auto s = std::get<0>(witness);
79 require(pre_to_s,
"ambiguous_word: did not find monomial");
80 require(s_to_post,
"ambiguous_word: did not find monomial");
82 return ls.mul(pre_to_s->first, s_to_post->first);
91 template <Automaton Aut>
95 const auto& a = aut->
as<Aut>();
109 template <Automaton Aut>
116 if (coms.size() == 1)
118 for (
const auto &c : coms)
130 template <Automaton Aut>
136 const auto& origins = prod->origins();
141 for (
const auto& c : coms)
147 auto p = origins.at(s);
148 if (std::get<0>(p) == std::get<1>(p))
164 template <Automaton Aut>
168 const auto& a = aut->
as<Aut>();
bool is_cycle_ambiguous(const automaton &aut)
Bridge.
typename labelset_t_of< base_t< ValueSet >>::word_t word_t_of
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
automaton conjunction(const automaton &lhs, const automaton &rhs, bool lazy=false)
The conjunction (aka synchronized product) of automata.
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
bool is_ambiguous(const Aut &aut)
auto tuple(const Auts &...as)
Build the (accessible part of the) tuple.
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
fresh_automaton_t_of< Aut > aut_of_component(const detail::component_t< Aut > &com, const Aut &aut)
Generate a subautomaton corresponding to an SCC.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
value_impl< detail::label_tag > label
bool is_cycle_ambiguous_scc(const Aut &aut)
Whether aut is cycle-ambiguous.
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
bool is_ambiguous(const automaton &aut)
Bridge.
const detail::components_t< Aut > strong_components(const Aut &aut, Tag={})
Find all strongly connected components of aut.
bool is_cycle_ambiguous(const automaton &aut)
Whether the automaton is cycle-ambiguous.
label ambiguous_word(const automaton &aut)
Bridge.
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 conjunction(const Aut &aut, to exp) -> fresh_automaton_t_of< Aut >
Repeated conjunction of a automaton.
auto & as()
Extract wrapped typed automaton.
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an 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)
word_t_of< Aut > ambiguous_word(const Aut &aut)