1 #ifndef VCSN_ALGOS_STAR_NORMAL_FORM_HH
2 # define VCSN_ALGOS_STAR_NORMAL_FORM_HH
26 template <
typename RatExpSet>
28 :
public RatExpSet::const_visitor
32 using ratexp_t =
typename ratexpset_t::value_t;
35 using weight_t =
typename weightset_t::value_t;
37 using super_t =
typename RatExpSet::const_visitor;
39 constexpr
static const char*
me() {
return "star_normal_form"; }
53 return std::move(
res_);
74 v.head()->accept(*
this);
76 for (
auto c: v.tail())
81 res_ = std::move(res);
101 if (std::any_of(std::begin(v), std::end(v),
115 v.head()->accept(*
this);
117 for (
auto c: v.tail())
122 res_ = std::move(res);
129 v.head()->accept(*
this);
131 for (
auto c: v.tail())
136 res_ = std::move(res);
144 v.sub()->accept(*
this);
151 v.sub()->accept(*
this);
157 v.sub()->accept(*
this);
163 v.sub()->accept(*
this);
180 template <
typename RatExpSet>
181 typename RatExpSet::value_t
193 template <
typename RatExpSet>
197 const auto& e = exp->as<RatExpSet>();
208 #endif // !VCSN_ALGOS_STAR_NORMAL_FORM_HH
ratexp make_ratexp(const RatExpSet &rs, const typename RatExpSet::value_t &ratexp)
An inner node with multiple children.
#define VCSN_RAT_UNSUPPORTED(Type)
weightset_t ws_
Shorthand to the weightset.
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
typename RatExpSet::const_visitor super_t
static constexpr const char * me()
RatExpSet::value_t star_normal_form(const RatExpSet &rs, const typename RatExpSet::value_t &e)
Star_Normal_Forming a typed ratexp shared_ptr.
std::shared_ptr< detail::ratexp_base > ratexp
VCSN_RAT_VISIT(rweight, v)
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
void box_of(const prod_t &v)
Handling of a product by the box operator.
VCSN_RAT_VISIT(lweight, v)
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
context_t_of< ratexpset_t > context_t
ratexp star_normal_form(const ratexp &exp)
Bridge.
operation_t operation_
The current operation.
star_normal_form_visitor(const ratexpset_t &rs)
An inner node implementing a weight.
weight_t_of< RatExpSet > constant_term(const RatExpSet &rs, const typename RatExpSet::value_t &e)
typename weightset_t::value_t weight_t
operation_t
The type of the operator.
typename ratexpset_t::value_t ratexp_t
weightset_t_of< context_t > weightset_t
void dot_of(const prod_t &v)
Handling of a product by the dot operator.
ratexp_t operator()(const ratexp_t &v)