31 template <
typename Aut>
33 = std::integral_constant<bool,
34 ((context_t_of<Aut>::is_lal
35 || context_t_of<Aut>::is_lan)
38 template <
typename Aut>
46 template <
typename Aut>
52 raise(
"print: FAdo requires letter or nullable labels,"
53 " and Boolean weights");
56 template <
typename Aut>
64 template <
typename Aut>
70 raise(
"print: Grail requires letter or nullable labels,"
71 " and Boolean weights");
75 template <
typename Aut>
77 print(
const Aut& aut, std::ostream& out,
const std::string&
format)
80 = std::map<std::string, std::function<void(const Aut&, std::ostream&)>>
82 {
"dot", [](
const Aut& a, std::ostream& o){
dot(a, o); }},
83 {
"default", [](
const Aut& a, std::ostream& o){
dot(a, o); }},
84 {
"dot2tex", [](
const Aut& a, std::ostream& o){
dot(a, o,
true); }},
85 {
"efsm", [](
const Aut& a, std::ostream& o){
efsm(a, o); }},
86 {
"fado", detail::fado_impl_<Aut>},
87 {
"grail", detail::grail_impl_<Aut>},
88 {
"info", [](
const Aut& a, std::ostream& o){
info(a, o); }},
89 {
"info,detailed",[](
const Aut& a, std::ostream& o){
info(a, o,
true); }},
90 {
"null", [](
const Aut&, std::ostream&){}},
91 {
"tikz", [](
const Aut& a, std::ostream& o){
tikz(a, o); }},
93 auto fun =
getargs(
"automaton output format", map, format);
103 template <
typename Aut,
typename Ostream,
typename String>
105 const std::string& fmt)
107 const auto& a = aut->as<Aut>();
108 return print(a, o, fmt);
122 template <
typename Context,
typename Ostream,
typename String>
124 const std::string& fmt)
126 const auto& c = ctx->as<Context>();
127 return c.print_set(o,
format(fmt));
138 template <
typename ValueSet>
141 print(
const ValueSet& vs,
const typename ValueSet::value_t&
v,
142 std::ostream& o,
format fmt)
144 return vs.print(v, o,
format(fmt));
152 template <
typename ExpansionSet,
typename Ostream,
typename String>
154 const std::string& fmt)
156 const auto& e = expansion->as<ExpansionSet>();
171 template <
typename LabelSet,
typename Ostream,
typename String>
173 const std::string& fmt)
175 const auto& l = label->as<LabelSet>();
185 template <
typename PolynomialSet>
188 list(
const PolynomialSet& ps,
const typename PolynomialSet::value_t& p,
192 for (
const auto& m: p)
207 template <
typename PolynomialSet,
typename Ostream>
211 const auto& p = polynomial->as<PolynomialSet>();
212 return vcsn::list(p.polynomialset(), p.polynomial(), o);
226 template <
typename PolynomialSet,
typename Ostream,
typename String>
228 std::ostream& o,
const std::string& fmt)
230 const auto& p = polynomial->as<PolynomialSet>();
242 template <
typename ExpSet>
246 print(
const ExpSet&
rs,
const typename ExpSet::value_t& e,
247 std::ostream& o, format fmt)
249 return rs.print(e, o, format(fmt));
258 template <
typename ExpSet,
typename Ostream,
typename String>
260 const std::string& fmt)
262 const auto& e = exp->as<ExpSet>();
273 template <
typename WeightSet>
280 return ws.print(w, o);
289 template <
typename WeightSet,
typename Ostream,
typename String>
291 const std::string& fmt)
std::ostream & print_polynomial(const polynomial &polynomial, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & grail(const Aut &aut, std::ostream &out)
std::shared_ptr< const detail::label_base > label
std::shared_ptr< const detail::context_base > context
A dyn::context.
std::ostream & print(const automaton &aut, std::ostream &o, const std::string &fmt)
Bridge.
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.
C::mapped_type getargs(const std::string &kind, const C &map, const std::string &key)
Find a correspondance in a map.
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
typename std::enable_if< Cond, T >::type enable_if_t
std::ostream & fado(const Aut &aut, std::ostream &out)
static dyn::context ctx(const driver &d)
Get the context of the driver.
std::shared_ptr< const detail::weight_base > weight
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::ostream & print(const Aut &aut, std::ostream &out, const std::string &format)
Provide a variadic mul on top of a binary mul(), and one().
std::ostream & list(const PolynomialSet &ps, const typename PolynomialSet::value_t &p, std::ostream &o)
std::shared_ptr< detail::automaton_base > automaton
std::shared_ptr< const detail::expansion_base > expansion
auto fado_impl_(const Aut &aut, std::ostream &out) -> enable_if_t< has_fado_t< Aut >
std::shared_ptr< const detail::polynomial_base > polynomial
std::ostream & print_label(const label &label, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & print_context(const context &ctx, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & efsm(const Aut &aut, std::ostream &out)
Format automaton to EFSM format, based on FSM format.
std::ostream & list_polynomial(const polynomial &polynomial, std::ostream &o)
Bridge (list).
std::ostream & dot(const Aut &aut, std::ostream &out, bool dot2tex=false)
std::shared_ptr< detail::expression_base > expression
auto grail_impl_(const Aut &aut, std::ostream &out) -> enable_if_t< has_fado_t< Aut >
std::ostream & print_expansion(const expansion &expansion, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & print_weight(const weight &weight, std::ostream &o, const std::string &fmt)
Bridge (print).
std::ostream & info(const Aut &aut, std::ostream &out, bool detailed=false)