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>();
expression expand(const expression &exp)
Bridge.
context_t_of< expressionset_t > context_t
#define VCSN_RAT_UNSUPPORTED(Type)
typename polynomialset_t::value_t polynomial_t
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
static constexpr const char * me()
Provide a variadic mul on top of a binary mul(), and one().
An inner node with multiple children.
auto weight_of(const welement< Label, Weight > &m) -> decltype(m.weight())
The weight of a welement.
ExpSet::value_t expand(const ExpSet &rs, const typename ExpSet::value_t &e)
Expand a typed expression.
weightset_t ws_
Shorthand to the weightset.
expand_visitor(const expressionset_t &rs)
typename super_t::tuple_t tuple_t
typename expressionset_t::value_t expression_t
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
polynomial_t expand(const expression_t &e)
Syntactic sugar: recursive call to this visitor.
auto label_of(const welement< Label, Weight > &m) -> decltype(m.label())
The label of a welement.
An inner node implementing a weight.
expression_t operator()(const expression_t &v)
virtual void visit(const tuple_t &, std::true_type) override
weightset_t_of< expressionset_t > weightset_t
VCSN_RAT_VISIT(conjunction, v)
std::shared_ptr< detail::expression_base > expression
VCSN_RAT_VISIT(lweight, v)
polynomial_t res_
The result.
expression_polynomialset_t< ExpSet > make_expression_polynomialset(const ExpSet &rs)
From a ExpSet to its polynomialset.
typename weightset_t::value_t weight_t
VCSN_RAT_VISIT(rweight, v)
polynomialset_t ps_
Polynomialset of expressions.
value_t mul(const Ts &...ts) const
A variadic multiplication.
typename ExpSet::const_visitor super_t
expression make_expression(const ExpSet &rs, const typename ExpSet::value_t &r)