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>
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_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().
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 automaton &aut)
Bridge.
std::shared_ptr< detail::automaton_base > automaton
typename law_traits< LabelSet >::type law_t
The smallest wordset that includes LabelSet.
law_t< LabelSet > make_wordset(const LabelSet &ls)
The wordset of a labelset.
ATTRIBUTE_PURE bool has(const boost::container::flat_set< Key, Compare, Allocator > &s, const Key &e)
Whether e is member of s.
value_t mul(const Ts &...ts) const
A variadic multiplication.