17 #define CASE(T) case type_t::T: o << #T; break
38 template <
typename ExpSet>
47 template <typename ExpSet> \
54 static bool print = !! getenv(
"VCSN_PRINT");
58 out_ << (rs_.identities().is_distributive()
59 ?
"{\\color{red}{" :
"{\\color{blue}{");
76 langle_ =
" \\left\\langle ";
77 rangle_ =
" \\right\\rangle ";
84 transposition_ =
"^{T}";
89 sum_ = (rs_.identities().is_distributive() ?
" \\oplus "
92 one_ =
"\\varepsilon";
95 ldiv_ =
" \\backslash ";
96 tuple_left =
" \\left. ";
97 tuple_middle =
" \\middle| ";
98 tuple_right =
" \\right. ";
99 exponent_threshold_= 2;
113 transposition_ =
"{T}";
127 exponent_threshold_= 4;
139 transposition_ =
"ᵗ";
153 exponent_threshold_= 2;
156 raise(
"expression: invalid format: ", fmt_);
168 case exp::type_t::Type: \
169 return precedence_t::Type
190 #define VISIT(Type) \
191 DEFINE::visit(const Type ## _t& v) \
198 out_ << rangle_ << lmul_;
199 print_child_(*
v.sub(),
v);
204 print_child_(*
v.sub(),
v);
205 out_ << rmul_ << langle_;
224 rs_.labelset()->print(
v.value(), out_, fmt_.for_labels());
229 for (
auto it = begin(
v); it != end(
v); )
237 std::find_if(it, end(
v),
238 [&](
const auto& e) {
return !rs_.equal(e, i); });
239 auto count = std::distance(it, next);
241 && (!expressionset_t::context_t::is_lal
243 || exponent_threshold_ < count))
251 std::function<void(int)>
print = [
this, &
print](
int n)
262 out_ << lexponent_ << count << rexponent_;
277 static bool force = !! getenv(
"VCSN_PARENS");
278 bool parent_has_precedence = precedence_(child) <= parent;
281 || (parent_has_precedence
283 && ! is_braced_(child)));
298 print_child(child, precedence_(parent));
301 template <
typename ExpSet>
302 template <type_t Type>
307 print_child_(*
v.sub(),
v);
311 template <
typename ExpSet>
312 template <type_t Type>
318 for (
const auto& i: n)
constant< type_t::one, Context > one
An inner node implementing a weight.
Print as plain (ASCII) text, escaped.
std::ostream & operator<<(std::ostream &o, type_t t)
std::ostream & print(const Aut &aut, std::ostream &out, const std::string &fmt)
typename super_t::template variadic_t< Type > variadic_t
automaton shuffle_(const std::vector< automaton > &as, vcsn::detail::index_sequence< I... >)
Variadic bridge helper.
automaton infiltration_(const std::vector< automaton > &as, vcsn::detail::index_sequence< I... >)
Variadic bridge helper.
std::ostream & incendl(std::ostream &o)
Increment the indentation, print an end of line, and set the indentation.
typename super_t::template unary_t< Type > unary_t
int address(const void *t)
Name pointers, to make them easier to read.
weight_node< type_t::lweight, Context > lweight
precedence_t
The possible node precedence levels, increasing.
std::ostream & decendl(std::ostream &o)
Decrement the indentation, print an end of line, and set the indentation.
Implementation of nodes of tuple of rational expressions.
Indentation relative functions.
static constexpr const char *const superscripts[]
Exponents in UTF-8.
variadic< type_t::prod, Context > prod
std::ostream & print_(const node_t &v)
Print v.
void print_(std::ostream &o, const T &arg, long)
Serialize arg into o.
type_t
The possible types of expressions.
An inner node with multiple children.
typename super_t::node_t node_t
Actual node, without indirection.
auto out(const Aut &aut, state_t_of< Aut > s)
Indexes of visible transitions leaving state s.
printer(const expressionset_t &rs, std::ostream &out)
A printer.
Print as rich UTF-8 text, escaped.
weight_node< type_t::rweight, Context > rweight
automaton conjunction_(const std::vector< automaton > &as, bool lazy, vcsn::detail::index_sequence< I... >)
Bridge helper.
An input/output format for valuesets.
constant< type_t::zero, Context > zero