17 #ifndef AWALI_CORE_RAT_EQUAL_VISIT_HH
18 # define AWALI_CORE_RAT_EQUAL_VISIT_HH
25 namespace awali {
namespace sttc
31 template <
class RatExpSet>
33 :
public RatExpSet::const_visitor
43 using node_t =
typename super_type::node_t;
44 using inner_t =
typename super_type::inner_t;
45 template <rat::exp::type_t Type>
47 template <rat::exp::type_t Type>
49 template <rat::exp::type_t Type>
57 size_t lhss = sizer(lhs);
58 size_t rhss = sizer(rhs);
62 else if (lhs->type() != rhs->type())
77 using Type ## _t = typename super_type::Type ## _t; \
79 visit(const Type ## _t& lhs) override \
81 res_ = equal_visit_(lhs, *down_pointer_cast<const Type ## _t>(rhs_)); \
118 template <rat::exp::type_t Type>
121 auto ls = lhs.size();
122 auto rs = rhs.size();
125 for (
size_t i = 0; i < ls; ++i)
131 template <rat::exp::type_t Type>
137 template <rat::exp::type_t Type>
151 template <
class RatExpSet>
152 typename RatExpSet::ratexp_t
153 equals(
const RatExpSet& rs,
const typename RatExpSet::ratexp_t& v)
Definition: ratexp.hh:280
Definition: ratexp.hh:262
Definition: equal_visit.hh:34
weightset_t_of< context_t > weightset_t
Definition: equal_visit.hh:39
typename super_type::zero_t zero_t
Definition: equal_visit.hh:96
bool equal_visit_(const zero_t &, const zero_t &)
Definition: equal_visit.hh:103
bool equal_visit_(const weight_node_t< Type > &lhs, const weight_node_t< Type > &rhs)
Definition: equal_visit.hh:138
context_t_of< ratexpset_t > context_t
Definition: equal_visit.hh:37
RatExpSet ratexpset_t
Definition: equal_visit.hh:36
typename ratexpset_t::const_visitor super_type
Definition: equal_visit.hh:42
typename super_type::one_t one_t
Definition: equal_visit.hh:89
bool equal_visit_(const unary_t< Type > &lhs, const unary_t< Type > &rhs)
Definition: equal_visit.hh:132
typename super_type::template variadic_t< Type > variadic_t
Definition: equal_visit.hh:48
labelset_t_of< context_t > labelset_t
Definition: equal_visit.hh:38
bool equal_visit_(const one_t &, const one_t &)
Definition: equal_visit.hh:108
typename super_type::template unary_t< Type > unary_t
Definition: equal_visit.hh:46
typename context_t::ratexp_t ratexp_t
Definition: equal_visit.hh:41
bool equal_visit_(const atom_t &lhs, const atom_t &rhs)
Definition: equal_visit.hh:113
bool operator()(ratexp_t lhs, ratexp_t rhs)
Whether lhs == rhs.
Definition: equal_visit.hh:54
weight_t_of< context_t > weight_t
Definition: equal_visit.hh:40
typename super_type::atom_t atom_t
Definition: equal_visit.hh:84
typename super_type::node_t node_t
Definition: equal_visit.hh:43
typename super_type::template weight_node_t< Type > weight_node_t
Definition: equal_visit.hh:50
bool equal_visit_(const variadic_t< Type > &lhs, const variadic_t< Type > &rhs)
Definition: equal_visit.hh:119
typename super_type::inner_t inner_t
Definition: equal_visit.hh:44
Definition: ratexp.hh:176
An inner node with multiple children.
Definition: ratexp.hh:115
An inner node implementing a weight.
Definition: ratexp.hh:208
#define VISIT(Type)
Definition: equal_visit.hh:76
RatExpSet::ratexp_t equals(const RatExpSet &rs, const typename RatExpSet::ratexp_t &v)
Definition: equal_visit.hh:153
typename internal::weight_t_of_impl< internal::base_t< ValueSet > >::type weight_t_of
Helper to retrieve the type of the weights of a value set.
Definition: traits.hh:81
typename internal::context_t_of_impl< internal::base_t< ValueSet > >::type context_t_of
Helper to retrieve the type of the context of a value set.
Definition: traits.hh:66
typename internal::labelset_t_of_impl< internal::base_t< ValueSet > >::type labelset_t_of
Helper to retrieve the type of the labelset of a value set.
Definition: traits.hh:76
typename internal::weightset_t_of_impl< internal::base_t< ValueSet > >::type weightset_t_of
Helper to retrieve the type of the weightset of a value set.
Definition: traits.hh:86
Main namespace of Awali.
Definition: ato.hh:22