17 #ifndef AWALI_ALGOS_DAUT_HH
18 # define AWALI_ALGOS_DAUT_HH
27 namespace awali {
namespace sttc {
38 template <
typename Aut>
54 using super_type::super_type;
66 const std::string& kind,
const weight_t& w)
73 if (ws_.show_one() || !ws_.is_one(w))
75 os_ <<
", " << kind <<
" text={";
76 ws_.print(w, os_) <<
'}';
86 os_ <<
" [label = \"";
87 aut_->print_state_name(s, os_,
"text");
93 "context = \"" << aut_->context().vname() <<
"\"\n";
94 if (!aut_->states().empty()) {
96 for (
auto s : aut_->states())
104 for (
auto src : aut_->all_states()) {
106 std::set<state_t> ds;
107 for (
auto t: aut_->all_out(src))
108 ds.insert(aut_->dst_of(t));
110 if (src == aut_->pre())
111 os_ <<
'$' <<
" -> " << (dst-2);
112 else if (dst == aut_->post())
113 os_ << (src-2) <<
" -> " <<
'$';
115 os_ << (src-2) <<
" -> " << (dst-2);
116 std::string s = format_entry_(src, dst,
"text");
133 template <
typename Aut>
135 daut(
const Aut& aut, std::ostream& out)
Format an automaton into daut vcsn format.
Definition: daut.hh:40
dautter(const automaton_t &aut, std::ostream &out)
Definition: daut.hh:57
std::ostream & operator()()
Definition: daut.hh:91
bool format(const std::string &sep, const std::string &kind, const weight_t &w)
Format a TikZ attribute.
Definition: daut.hh:65
void print_state_(state_t s)
Definition: daut.hh:83
Factor common bits in automaton formatting.
Definition: grail.hh:43
std::string format_entry_(state_t src, state_t dst, const std::string &fmt="text")
The labels and weights of transitions from src to dst.
Definition: grail.hh:88
const automaton_t & aut_
The automaton we have to output.
Definition: grail.hh:154
states_t finals_()
The list of final states, sorted.
Definition: grail.hh:144
weight_t_of< automaton_t > weight_t
Definition: grail.hh:62
Aut automaton_t
Definition: grail.hh:45
const weightset_t & ws_
Short-hand to the weightset.
Definition: grail.hh:160
std::ostream & os_
Output stream.
Definition: grail.hh:156
states_t initials_()
The list of initial states, sorted.
Definition: grail.hh:134
weightset_t_of< automaton_t > weightset_t
Definition: grail.hh:61
std::ostream & daut(const Aut &aut, std::ostream &out)
Output in 'daut' format.
Definition: daut.hh:135
std::ostream & str_escape(std::ostream &os, const int c)
Definition: escape.hh:30
Main namespace of Awali.
Definition: ato.hh:22
unsigned state_t
Definition: types.hh:21