31 template <Automaton Aut>
33 = std::integral_constant<bool,
34 ((context_t_of<Aut>::is_lal
35 || context_t_of<Aut>::is_lan)
38 template <Automaton Aut>
41 -> std::enable_if_t<has_fado_t<Aut>{},
void>
46 template <Automaton Aut>
50 -> std::enable_if_t<!has_fado_t<Aut>{},
void>
52 raise(
"print: FAdo requires letter or nullable labels,"
53 " and Boolean weights");
56 template <Automaton Aut>
59 -> std::enable_if_t<has_fado_t<Aut>{},
void>
64 template <Automaton Aut>
68 -> std::enable_if_t<!has_fado_t<Aut>{},
void>
70 raise(
"print: Grail requires letter or nullable labels,"
71 " and Boolean weights");
75 template <Automaton Aut>
77 print(
const Aut& aut, std::ostream&
out,
const std::string& fmt)
82 "automaton output format",
84 {
"dot", [](
const Aut& a, std::ostream& o){
dot(a, o); }},
86 {
"dot,latex", [](
const Aut& a, std::ostream& o)
88 {
"dot,utf8", [](
const Aut& a, std::ostream& o)
90 {
"efsm", [](
const Aut& a, std::ostream& o){
efsm(a, o); }},
91 {
"fado", detail::fado_impl_<Aut>},
92 {
"grail", detail::grail_impl_<Aut>},
93 {
"info", [](
const Aut& a, std::ostream& o){
info(a, o); }},
94 {
"info,detailed",[](
const Aut& a, std::ostream& o){
info(a, o,
true); }},
95 {
"null", [](
const Aut&, std::ostream&){}},
96 {
"tikz", [](
const Aut& a, std::ostream& o){
tikz(a, o); }},
108 template <Automaton Aut,
typename Ostream,
typename String>
110 const std::string& fmt)
112 const auto& a = aut->as<Aut>();
113 return print(a, o, fmt);
127 template <
typename Context,
typename Ostream,
typename String>
129 const std::string& fmt)
131 const auto& c = ctx->as<Context>();
132 return c.print_set(o,
format(fmt));
143 template <
typename ValueSet>
146 print(
const ValueSet& vs,
const typename ValueSet::value_t&
v,
147 std::ostream& o,
format fmt)
149 return vs.print(v, o,
format(fmt));
157 template <
typename ExpansionSet,
typename Ostream,
typename String>
159 const std::string& fmt)
161 const auto& e = expansion->as<ExpansionSet>();
176 template <
typename LabelSet,
typename Ostream,
typename String>
178 const std::string& fmt)
180 const auto& l = label->as<LabelSet>();
190 template <
typename PolynomialSet>
193 list(
const PolynomialSet& ps,
const typename PolynomialSet::value_t& p,
197 for (
const auto& m: p)
212 template <
typename PolynomialSet,
typename Ostream>
216 const auto& p = polynomial->as<PolynomialSet>();
217 return vcsn::list(p.polynomialset(), p.polynomial(), o);
231 template <
typename PolynomialSet,
typename Ostream,
typename String>
233 std::ostream& o,
const std::string& fmt)
235 const auto& p = polynomial->as<PolynomialSet>();
247 template <
typename ExpSet>
251 print(
const ExpSet&
rs,
const typename ExpSet::value_t& e,
252 std::ostream& o, format fmt)
254 return rs.print(e, o, format(fmt));
263 template <
typename ExpSet,
typename Ostream,
typename String>
265 const std::string& fmt)
267 const auto& e = exp->as<ExpSet>();
278 template <
typename WeightSet>
285 return ws.print(w, o);
294 template <
typename WeightSet,
typename Ostream,
typename String>
296 const std::string& fmt)
std::ostream & print(const automaton &aut, std::ostream &o, const std::string &fmt)
Bridge.
std::ostream & tikz(const AutPtr &aut, std::ostream &out)
Print automaton to TikZ format.
std::ostream & grail(const Aut &aut, std::ostream &out)
std::ostream & print_expression(const expression &exp, std::ostream &o, const std::string &fmt)
Bridge (print).
std::shared_ptr< const detail::polynomial_base > polynomial
std::shared_ptr< const detail::weight_base > weight
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
std::integral_constant< bool,((context_t_of< Aut >::is_lal||context_t_of< Aut >::is_lan)&&std::is_same< weightset_t_of< Aut >, b >::value)> has_fado_t
std::shared_ptr< const detail::expansion_base > expansion
std::ostream & fado(const Aut &aut, std::ostream &out)
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &fmt)
Bridge (print).
An input/output format for valuesets.
Provide a variadic mul on top of a binary mul(), and one().
std::shared_ptr< const detail::label_base > label
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
A mapping from strings to Values.
auto grail_impl_(const Aut &aut, std::ostream &out) -> std::enable_if_t< has_fado_t< Aut >
std::shared_ptr< const detail::context_base > context
A dyn::context.
std::shared_ptr< detail::automaton_base > automaton
auto fado_impl_(const Aut &aut, std::ostream &out) -> std::enable_if_t< has_fado_t< Aut >
std::ostream & print(const Aut &aut, std::ostream &out, const std::string &fmt)
std::ostream & efsm(const Aut &aut, std::ostream &out)
Format automaton to EFSM format, based on FSM format.
static dyn::context ctx(const driver &d)
Get the context of the driver.
std::ostream & print_context(const context &ctx, std::ostream &o, const std::string &fmt)
Bridge (print).
std::shared_ptr< detail::expression_base > expression
std::ostream & print_label(const label &label, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & print_expansion(const expansion &expansion, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & info(const Aut &aut, std::ostream &out, bool detailed=false)
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & dot(const Aut &aut, std::ostream &out, format fmt={})
Print an automaton in Graphviz's Dot format.
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge (list).
std::ostream & list(const PolynomialSet &ps, const typename PolynomialSet::value_t &p, std::ostream &o)