17 #ifndef AWALI_ALGOS_STAR_HEIGHT_HH
18 # define AWALI_ALGOS_STAR_HEIGHT_HH
22 namespace awali {
namespace sttc {
26 template <
typename RatExpSet>
28 :
public RatExpSet::const_visitor
33 using node_t =
typename super_type::node_t;
34 template <rat::type_t Type>
55 # define DEFINE(Type) \
56 using Type ## _t = typename super_type::Type ## _t; \
57 virtual void visit(const Type ## _t& v) override
60 DEFINE(complement) { v.sub()->accept(*
this); }
61 DEFINE(conjunction) { visit_variadic(v); }
62 DEFINE(ldiv) { visit_variadic(v); }
63 DEFINE(lweight) { v.sub()->accept(*
this); }
65 DEFINE(prod) { visit_variadic(v); }
66 DEFINE(rweight) { v.sub()->accept(*
this); }
67 DEFINE(shuffle) { visit_variadic(v); }
68 DEFINE(star) { ++height_; v.sub()->accept(*
this); }
69 DEFINE(sum) { visit_variadic(v); }
70 DEFINE(transposition){ v.sub()->accept(*
this); }
76 template <rat::type_t Type>
78 visit_variadic(
const variadic_t<Type>& n)
82 auto initial = height_;
99 template <
typename RatExpSet>
Definition: star_height.hh:29
typename ratexpset_t::const_visitor super_type
Definition: star_height.hh:32
typename super_type::node_t node_t
Definition: star_height.hh:33
unsigned operator()(const node_t &v)
Entry point: return the size of v.
Definition: star_height.hh:39
unsigned operator()(const std::shared_ptr< const node_t > &v)
Entry point: return the size of v.
Definition: star_height.hh:48
typename super_type::template variadic_t< Type > variadic_t
Definition: star_height.hh:35
RatExpSet ratexpset_t
Definition: star_height.hh:31
unsigned star_height(const typename RatExpSet::ratexp_t &e)
Star height of a ratexp.
Definition: star_height.hh:102
ATTRIBUTE_CONST int max(int a, int b)
Definition: arith.hh:54
Main namespace of Awali.
Definition: ato.hh:22
#define DEFINE(Type)
Definition: star_height.hh:55