32 template <Automaton Aut>
34 = std::integral_constant<bool,
35 ((context_t_of<Aut>::is_lal
36 || context_t_of<Aut>::is_lan)
39 template <Automaton Aut>
42 -> std::enable_if_t<has_fado_t<Aut>{},
void>
47 template <Automaton Aut>
51 -> std::enable_if_t<!has_fado_t<Aut>{},
void>
53 raise(
"print: FAdo requires letter or nullable labels,"
54 " and Boolean weights");
57 template <Automaton Aut>
60 -> std::enable_if_t<has_fado_t<Aut>{},
void>
65 template <Automaton Aut>
69 -> std::enable_if_t<!has_fado_t<Aut>{},
void>
71 raise(
"print: Grail requires letter or nullable labels,"
72 " and Boolean weights");
76 template <Automaton Aut>
78 print(
const Aut& aut, std::ostream&
out,
const std::string& fmt)
83 "automaton output format",
85 {
"dot", [](
const Aut& a, std::ostream& o){
dot(a, o); }},
87 {
"dot,latex", [](
const Aut& a, std::ostream& o)
89 {
"dot,utf8", [](
const Aut& a, std::ostream& o)
91 {
"efsm", [](
const Aut& a, std::ostream& o){
efsm(a, o); }},
92 {
"fado", detail::fado_impl_<Aut>},
93 {
"grail", detail::grail_impl_<Aut>},
94 {
"info", [](
const Aut& a, std::ostream& o){
info(a, o); }},
95 {
"info,detailed",[](
const Aut& a, std::ostream& o){
info(a, o,
true); }},
96 {
"null", [](
const Aut&, std::ostream&){}},
97 {
"tikz", [](
const Aut& a, std::ostream& o){
tikz(a, o); }},
109 template <Automaton Aut,
typename Ostream,
typename String>
111 const std::string& fmt)
113 const auto& a = aut->
as<Aut>();
114 return print(a, o, fmt);
128 template <
typename Context,
typename Ostream,
typename String>
130 const std::string& fmt)
132 const auto& c = ctx->as<Context>();
133 return c.print_set(o,
format(fmt));
146 template <
typename ValueSet>
148 print(
const ValueSet& vs,
const typename ValueSet::value_t&
v,
149 std::ostream& o,
format fmt)
151 return vs.print(v, o,
format(fmt));
159 template <
typename ExpansionSet,
typename Ostream,
typename String>
162 const std::string& fmt)
164 const auto& e = expansion->as<ExpansionSet>();
175 template <
typename Context>
179 std::ostream& o,
format fmt)
181 return rs.print(r, o,
format(fmt));
185 template <
typename Context>
189 std::ostream& o,
const std::string& fmt)
205 template <
typename ExpSet,
typename Ostream,
typename String>
207 const std::string& fmt)
209 const auto& e = exp->as<ExpSet>();
210 return vcsn::print(e.expressionset(), e.expression(), o, fmt);
224 template <
typename LabelSet,
typename Ostream,
typename String>
226 const std::string& fmt)
228 const auto& l = label->as<LabelSet>();
238 template <
typename PolynomialSet>
240 list(
const PolynomialSet& ps,
const typename PolynomialSet::value_t& p,
244 for (
const auto& m: p)
259 template <
typename PolynomialSet,
typename Ostream>
263 const auto& p = polynomial->as<PolynomialSet>();
264 return vcsn::list(p.polynomialset(), p.polynomial(), o);
278 template <
typename PolynomialSet,
typename Ostream,
typename String>
280 std::ostream& o,
const std::string& fmt)
282 const auto& p = polynomial->as<PolynomialSet>();
294 template <
typename WeightSet>
300 return ws.print(w, o);
309 template <
typename WeightSet,
typename Ostream,
typename String>
311 const std::string& fmt)
Provide a variadic mul on top of a binary mul(), and one().
A mapping from strings to Values.
std::shared_ptr< const detail::polynomial_base > polynomial
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & info(const Aut &aut, std::ostream &out, bool detailed=false)
std::ostream & print(const Aut &aut, std::ostream &out, const std::string &fmt)
std::ostream & dot(const Aut &aut, std::ostream &out, format fmt={})
Print an automaton in Graphviz's Dot format.
std::ostream & efsm(const Aut &aut, std::ostream &out)
Format automaton to EFSM format, based on FSM format.
std::ostream & list(const PolynomialSet &ps, const typename PolynomialSet::value_t &p, std::ostream &o)
auto fado_impl_(const Aut &aut, std::ostream &out) -> std::enable_if_t< has_fado_t< Aut >
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::context_base > context
A dyn::context.
std::ostream & grail(const Aut &aut, std::ostream &out)
std::ostream & print_context(const context &ctx, std::ostream &o, const std::string &fmt)
Bridge (print).
dot_printer< ExpSet > make_dot_printer(const ExpSet &rs, std::ostream &out)
std::shared_ptr< const detail::weight_base > weight
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge (list).
std::ostream & print_expression(const expression &exp, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & tikz(const AutPtr &aut, std::ostream &out)
Print automaton to TikZ format.
std::ostream & fado(const Aut &aut, std::ostream &out)
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &fmt)
Bridge (print).
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
std::shared_ptr< const detail::label_base > label
std::shared_ptr< const detail::expansion_base > expansion
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).
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
static dyn::context ctx(const driver &d)
Get the context of the driver.
auto grail_impl_(const Aut &aut, std::ostream &out) -> std::enable_if_t< has_fado_t< Aut >
auto & as()
Extract wrapped typed automaton.
std::ostream & print(const automaton &aut, std::ostream &o, const std::string &fmt)
Bridge.
std::shared_ptr< detail::expression_base > expression
An input/output format for valuesets.