18 template <Automaton Aut>
22 "has_bounded_lag: automaton labelset must be a tupleset");
26 "has_bounded_lag: transducer labelset must have at least 2 tapes");
28 using automaton_t = Aut;
31 using label_t =
typename labelset_t::value_t;
43 using visited_t = std::vector<visit_state>;
46 using parent_state_t = std::vector<transition_t>;
49 template <std::size_t... I>
55 using delay_t = std::array<int, number_of_tapes - 1>;
61 : aut_(aut), v_(
detail::back(aut_->all_states()) + 1, NOT_VISITED)
66 template <std::
size_t I>
67 int get_size_tape(label_t l)
69 using tape_labelset_t =
typename labelset_t::template valueset_t<I>;
74 template <std::size_t... I>
75 void add_delay(delay_t& d, transition_t tr, seq<I...>)
77 label_t l = aut_->label_of(tr);
78 int i0 = get_size_tape<0>(l);
79 d = {(d[I] + i0 - get_size_tape<I + 1>(l))...};
82 void add_delay(delay_t& d, transition_t tr)
84 add_delay(d, tr, delay_index_t{});
91 for (
auto tr :
all_out(aut_, src))
93 state_t dst = aut_->dst_of(tr);
94 auto visited = v_[dst];
95 if (visited == NOT_VISITED)
101 else if (visited == VISITING)
108 transition_t t = p_[src];
111 while (aut_->src_of(t) != dst)
114 t = p_[aut_->src_of(t)];
147 template <Automaton Aut>
151 return blc.has_bounded_lag();
159 template <Automaton Aut>
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
bool has_bounded_lag(const automaton &aut)
Bridge.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
bool has_bounded_lag(const Aut &aut)
Whether a transducer has a bounded lag.
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
Container::value_type back(const Container &container)
The last member of this Container.
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
std::shared_ptr< detail::automaton_base > automaton