21 template <
typename Aut>
29 for (
const auto& o: prod->origins())
30 if (std::get<0>(o.second) != std::get<1>(o.second)
39 template <
typename Aut>
51 template <
typename Aut>
64 template <
typename Aut>
69 "automaton is unambiguous");
70 const auto& ls = *aut->labelset();
73 auto s = std::get<0>(witness);
74 for (
auto t:
path_bfs(aut, aut->pre(), s))
76 auto l = aut->label_of(t);
77 if (!ls.is_special(l))
80 for (
auto t:
path_bfs(aut, s, aut->post()))
82 auto l = aut->label_of(t);
83 if (!ls.is_special(l))
95 template <
typename Aut>
99 const auto& a = aut->as<Aut>();
113 template <
typename Aut>
119 if (getenv(
"VCSN_DEBUG"))
121 std::cerr <<
"number states of automaton: " <<
122 aut->num_states() << std::endl;
123 std::cerr <<
"number components: " <<
124 coms.size() << std::endl;
128 if (coms.size() == 1)
130 for (
const auto &c : coms)
141 template <
typename Aut>
147 const auto& origins = prod->origins();
152 for (
const auto& c : coms)
158 auto p = origins.at(s);
159 if (std::get<0>(p) == std::get<1>(p))
175 template <
typename Aut>
179 const auto& a = aut->as<Aut>();
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
std::shared_ptr< const detail::label_base > label
std::vector< transition_t_of< Aut > > path_bfs(const Aut &aut, state_t_of< Aut > start, state_t_of< Aut > end)
A shortest path between two states.
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
const detail::components_t< Aut > strong_components(const Aut &aut, scc_algo_t algo=scc_algo_t::tarjan_iterative)
Find all strongly connected components of aut.
filter_automaton< Aut > coaccessible(const Aut &a)
Coaccessible part of an automaton.
ValueSet::value_t tuple(const ValueSet &vs, const typename ValueSets::value_t &...v)
typename labelset_t_of< base_t< ValueSet >>::word_t word_t_of
bool is_ambiguous(const Aut &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.
std::shared_ptr< detail::automaton_base > automaton
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
auto conjunction(const Auts &...as) -> tuple_automaton< decltype(meet_automata(as...)), Auts...>
Build the (accessible part of the) conjunction.
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_scc(const Aut &aut)
Whether aut is cycle-ambiguous.
bool is_cycle_ambiguous(const automaton &aut)
Bridge.
bool is_cycle_ambiguous(const Aut &aut)
Whether aut is cycle-ambiguous.
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.
bool is_ambiguous(const automaton &aut)
Bridge.
label ambiguous_word(const automaton &aut)
Bridge.
label make_label(const LabelSet &ls, const typename LabelSet::value_t &l)