5 #include <boost/range/algorithm/sort.hpp> 17 template <
typename LabelSet>
20 static constexpr
size_t value = 1;
23 template <
typename... LabelSet>
36 template <Automaton Aut>
68 return ls_.is_one(l) ?
"@epsilon" :
to_string(ls_, l);
75 aut_->print_state(aut_->src_of(t), os_);
76 os_ <<
' ' << label_(aut_->label_of(t)) <<
' ';
77 aut_->print_state(aut_->dst_of(t), os_);
83 std::vector<transition_t> ts;
84 for (
auto t :
out(aut_, s))
98 for (
auto s: aut_->states())
108 aut_->print_state(s, os_);
117 res.emplace_back(aut_->dst_of(t));
127 res.emplace_back(aut_->src_of(t));
145 std::integral_constant<bool,
auto initial_transitions(const Aut &aut) -> decltype(aut->all_out(aut->pre()))
Indexes of transitions to (visible) initial states.
typename detail::weightset_t_of_impl< base_t< ValueSet > >::type weightset_t_of
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
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
std::integral_constant< bool, 2<=rank< labelset_t_of< automaton_t > >::value > is_transducer_t
Whether is a transducer (two-tape automaton) as opposed to an acceptor.
static constexpr size_t value
states_t finals_()
The list of final states, sorted.
context_t_of< automaton_t > context_t
weightset_t_of< automaton_t > weightset_t
auto final_transitions(const Aut &aut) -> decltype(aut->all_in(aut->post()))
Indexes of transitions from (visible) final states.
auto sort(const Aut &a) -> permutation_automaton< Aut >
typename detail::context_t_of_impl< base_t< ValueSet > >::type context_t_of
Provide a variadic mul on top of a binary mul(), and one().
printer(const automaton_t &aut, std::ostream &out)
Factor common bits in automaton formatting.
void print_transitions_()
Output transitions, sorted lexicographically.
typename detail::labelset_t_of_impl< base_t< ValueSet > >::type labelset_t_of
void list_states_(const states_t &ss)
List names of states in ss, preceded by ' '.
std::ostream & os_
Output stream.
std::vector< state_t > states_t
A list of states.
virtual void print_transition_(transition_t t) const
Output the transition t.
typename detail::label_t_of_impl< base_t< ValueSet > >::type label_t_of
transition_t_of< automaton_t > transition_t
virtual std::string label_(const label_t &l) const
Convert a label to its representation.
Compare transitions of an automaton.
states_t initials_()
The list of initial states, sorted.
typename detail::weight_t_of_impl< base_t< ValueSet > >::type weight_t_of
automaton_t aut_
The automaton we have to output.
std::string to_string(direction d)
Conversion to string.
state_t_of< automaton_t > state_t
weight_t_of< automaton_t > weight_t
void print_state_(const state_t s)
Output transitions, sorted lexicographically on (Label, Dest).
typename polynomialset_t::value_t polynomial_t
label_t_of< automaton_t > label_t
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.