20 template <
typename ExpSet>
22 :
public ExpSet::const_visitor
29 using weight_t =
typename weightset_t::value_t;
34 using super_t =
typename ExpSet::const_visitor;
36 constexpr
static const char*
me() {
return "expand"; }
77 res_ = std::move(res);
83 for (
auto c:
v.tail())
86 for (
const auto& l: res)
93 res_ = std::move(res);
103 virtual
void visit(const tuple_t&,
std::true_type)
override
105 raise(
me(),
": tuple is not supported");
113 res_ = std::move(res);
119 v.sub()->accept(*
this);
125 v.sub()->accept(*
this);
131 v.sub()->accept(*
this);
148 template <
typename ExpSet>
150 typename ExpSet::value_t
151 expand(
const ExpSet&
rs,
const typename ExpSet::value_t& e)
162 template <
typename ExpSet>
167 const auto& e = exp->as<ExpSet>();
value_t mul(const Ts &...ts) const
A variadic multiplication.
VCSN_RAT_VISIT(rweight, v)
typename expressionset_t::value_t expression_t
auto label_of(const welement< Label, Weight > &m) -> decltype(m.label())
VCSN_RAT_VISIT(lweight, v)
expand_visitor(const expressionset_t &rs)
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
typename super_t::tuple_t tuple_t
polynomial_t res_
The result.
ExpSet::value_t expand(const ExpSet &rs, const typename ExpSet::value_t &e)
Expand a typed expression.
expression expand(const expression &exp)
Bridge.
VCSN_RAT_VISIT(conjunction, v)
Provide a variadic mul on top of a binary mul(), and one().
expression_polynomialset_t< ExpSet > make_expression_polynomialset(const ExpSet &rs)
From a ExpSet to its polynomialset.
typename polynomialset_t::value_t polynomial_t
auto weight_of(const welement< Label, Weight > &m) -> decltype(m.weight())
polynomialset_t ps_
Polynomialset of expressions.
typename weightset_t::value_t weight_t
typename ExpSet::const_visitor super_t
virtual void visit(const tuple_t &, std::true_type) override
expression make_expression(const ExpSet &rs, const typename ExpSet::value_t &r)
static constexpr const char * me()
An inner node implementing a weight.
std::shared_ptr< detail::expression_base > expression
context_t_of< expressionset_t > context_t
expression_t operator()(const expression_t &v)
weightset_t ws_
Shorthand to the weightset.
polynomial_t expand(const expression_t &e)
Syntactic sugar: recursive call to this visitor.
weightset_t_of< expressionset_t > weightset_t
An inner node with multiple children.
#define VCSN_RAT_UNSUPPORTED(Type)