7 #include <vcsn/dyn/fwd.hh> 20 template <Automaton Aut>
24 "is_ambiguous: requires free labelset");
28 std::declval<automaton_t>()));
47 for (
const auto& o:
conj_->origins())
48 if (std::get<0>(o.second) != std::get<1>(o.second)
62 "ambiguous_word: automaton is unambiguous, " 63 "or has not been tested, for ambiguity");
69 assert(!p1.empty() || !p2.empty()
70 || !
"ambiguous_word: did not find an ambiguous word");
71 return ls.mul(p1.empty() ? ls.one() : p1.begin()->first,
72 p2.empty() ? ls.one() : p2.begin()->first);
87 template <Automaton Aut>
99 template <Automaton Aut>
112 template <Automaton Aut>
125 template <Automaton Aut>
129 const auto& a = aut->
as<Aut>();
143 template <Automaton Aut>
147 "is_cycle_ambiguous: requires free labelset");
152 if (coms.size() == 1)
154 for (
const auto &c : coms)
166 template <Automaton Aut>
172 const auto& origins = conj->origins();
177 for (
const auto& c : coms)
183 auto p = origins.at(s);
184 if (std::get<0>(p) == std::get<1>(p))
200 template <Automaton Aut>
204 const auto& a = aut->
as<Aut>();
state_t_of< conjunction_t > witness_
State index in the conjunction of a state that is not on the diagonal.
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
typename detail::state_t_of_impl< base_t< ValueSet > >::type state_t_of
decltype(conjunction(std::declval< automaton_t >(), std::declval< automaton_t >())) conjunction_t
const detail::components_t< Aut > strong_components(const Aut &aut, Tag={})
Find all strongly connected components of aut.
fresh_automaton_t_of< Aut > aut_of_component(const detail::component_t< Aut > &com, const Aut &aut)
Generate a subautomaton corresponding to an SCC.
word_t_of< automaton_t > word_t
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
word_t ambiguous_word() const
A witness of ambiguity.
bool is_ambiguous(const Aut &aut)
Whether an automaton is ambiguous.
auto conjunction(const Aut &a, const Auts &... as)
Build the (accessible part of the) conjunction.
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an automaton.
detail::enumerater< Aut >::polynomial_t shortest(const Aut &aut, boost::optional< unsigned > num={}, boost::optional< unsigned > len={})
The approximated behavior of an automaton.
Whether an automaton is ambiguous.
auto & as()
Extract wrapped typed automaton.
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
bool operator()()
Whether an automaton is ambiguous.
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
bool is_cycle_ambiguous_scc(const Aut &aut)
Whether aut is cycle-ambiguous.
typename labelset_t_of< base_t< ValueSet > >::word_t word_t_of
value_impl< detail::label_tag > label
is_ambiguous_impl(const automaton_t &aut)
Constructor.
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
conjunction_t conj_
The self-conjunction of the input automaton.
word_t_of< Aut > ambiguous_word(const Aut &aut)
void require(Bool b, Args &&... args)
If b is not verified, raise an error with args as message.
bool is_cycle_ambiguous(const automaton &aut)
Bridge.