1 #ifndef VCSN_ALGOS_IS_FUNCTIONAL_HH
2 # define VCSN_ALGOS_IS_FUNCTIONAL_HH
25 template <
typename Aut>
33 using word_t =
typename wordset_t::value_t;
36 auto ls1 = ls.template set<0>();
39 std::unordered_map<state_t, word_t> rs;
42 std::queue<state_t> todo;
43 auto pre = aut->pre();
45 rs.emplace(pre, ls.one());
49 rs.emplace(aut->post(), ls.one());
53 auto s = todo.front();
55 for (
auto t : aut->all_out(s))
57 auto l = aut->label_of(t);
58 auto dst = aut->dst_of(t);
59 if (
has(coaccessibles, dst))
64 ls.lnormalize_here(p);
70 else if (!ls.equals(p, rs[dst]))
80 template <
typename Aut>
84 auto l = blind<0>(aut);
108 #endif // !VCSN_ALGOS_IS_FUNCTIONAL_HH
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
Build the (accessible part of the) composition.
bool is_functional(const automaton &aut)
Bridge.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
auto insplit(const Aut &aut) -> decltype(detail::insplit(aut))
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
bool is_functional(const Aut &aut)
Whether aut is functional.
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
auto compose(Lhs &lhs, Rhs &rhs) -> typename detail::composer< blind_automaton< 1, Lhs >, blind_automaton< 0, Rhs >>::automaton_t
Build the (accessible part of the) composition.
automaton_t compose()
The (accessible part of the) product of lhs_ and rhs_.
Provide a variadic mul on top of a binary mul(), and one().
states_t< Aut > coaccessible_states(const Aut &a)
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
bool is_identity(const Aut &aut)
Whether transducer aut is equivalent to the identity function on all successful path.
bool has(const std::map< Key, Value, Compare, Alloc > &s, const Key &e)