8 #include <vcsn/dyn/fwd.hh>
20 template <Automaton Aut>
28 using word_t =
typename wordset_t::value_t;
31 auto ls1 = ls.template set<0>();
34 std::unordered_map<state_t, word_t>
rs;
37 std::queue<state_t> todo;
38 auto pre = aut->pre();
40 rs.emplace(pre, ls.one());
44 rs.emplace(aut->post(), ls.one());
48 auto s = todo.front();
52 auto dst = aut->dst_of(t);
53 if (
has(coaccessibles, dst))
56 auto r = ls.
mul(rs[s], aut->label_of(t));
58 ls.lnormalize_here(
r);
64 else if (!ls.equal(
r, rs[dst]))
79 template <Automaton Aut>
bool is_partial_identity(const Aut &aut)
Whether transducer aut is equivalent to a partial identity function on all successful paths...
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
value_t mul(const Ts &...ts) const
A variadic multiplication.
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
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
bool is_partial_identity(const automaton &aut)
Bridge.
auto & as()
Extract wrapped typed automaton.
Provide a variadic mul on top of a binary mul(), and one().
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.