20 template <
typename 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();
50 for (
auto t : aut->all_out(s))
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 <
typename Aut>
value_t mul(const Ts &...ts) const
A variadic multiplication.
states_t< Aut > coaccessible_states(const Aut &a, bool strict=true)
The set of coaccessible states, including post(), and possibly pre().
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
bool is_partial_identity(const Aut &aut)
Whether transducer aut is equivalent to a partial identity function on all successful paths...
Provide a variadic mul on top of a binary mul(), and one().
bool is_partial_identity(const automaton &aut)
Bridge.
std::shared_ptr< detail::automaton_base > automaton
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
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.