14 template <
typename ExpSet>
16 :
public ExpSet::const_visitor
20 using super_t =
typename expressionset_t::const_visitor;
23 using weight_t =
typename context_t::weightset_t::value_t;
25 using node_t =
typename super_t::node_t;
29 using inner_t =
typename super_t::inner_t;
30 template <type_t Type>
32 template <type_t Type>
34 using leaf_t =
typename super_t::leaf_t;
37 constexpr
static const char*
me() {
return "size"; }
66 using tuple_t =
typename super_t::tuple_t;
67 template <
bool = context_t::is_lat,
68 typename Dummy =
void>
75 using rs_t =
typename expressionset_t::template project_t<I>;
76 return size<rs_t>(std::get<I>(v.sub()));
80 template <
size_t... I>
84 using swallow =
int[];
100 template <
typename Dummy>
115 template <rat::exp::type_t Type>
119 v.sub()->accept(*
this);
123 template <rat::exp::type_t Type>
127 size_ += v.size() - 1;
128 for (
const auto& child : v)
129 child->accept(*
this);
135 template <
typename ExpSet>
136 size_t size(
const typename ExpSet::value_t&
r)
typename node_t::value_t expression_t
A shared_ptr to node_t.
Functor to compute the size of a rational expression.
VCSN_RAT_VISIT(infiltrate, v)
#define BUILTIN_UNREACHABLE()
typename context_t::weightset_t::value_t weight_t
VCSN_RAT_VISIT(conjunction, v)
typename super_t::template variadic_t< Type > variadic_t
size_t operator()(const tuple_t &)
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
size_t operator()(const expression_t &v)
Entry point: return the size of v.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
typename super_t::template unary_t< Type > unary_t
VCSN_RAT_VISIT(ldivide, v)
VCSN_RAT_VISIT(shuffle, v)
An inner node implementing a weight.
typename super_t::leaf_t leaf_t
typename super_t::inner_t inner_t
VCSN_RAT_VISIT(lweight, v)
typename super_t::tuple_t tuple_t
size_t size_(const tuple_t &v, detail::index_sequence< I... >)
Sum of sizes for all tapes.
static constexpr const char * me()
Name of this algorithm, for error messages.
size_t size_(const tuple_t &v)
Size for one tape.
void visit_(const unary_t< Type > &v)
Traverse unary node.
void visit_(const variadic_t< Type > &v)
Traverse variadic node.
VCSN_RAT_VISIT(rweight, v)
VCSN_RAT_VISIT(compose, v)
VCSN_RAT_VISIT(transposition, v)
context_t_of< expressionset_t > context_t
size_t operator()(const tuple_t &v)
Entry point.
typename super_t::node_t node_t
Actual node, without indirection.
typename expressionset_t::const_visitor super_t
An inner node with multiple children.
void visit(const tuple_t &v, std::true_type) override
Provide a variadic mul on top of a binary mul(), and one().
VCSN_RAT_VISIT(complement, v)