17 #ifndef AWALI_CORE_RAT_HASH_HH
18 # define AWALI_CORE_RAT_HASH_HH
27 template <
typename RatExpSet>
28 class hash :
public RatExpSet::const_visitor {
32 using weight_t =
typename context_t::weightset_t::value_t;
34 using node_t =
typename super_type::node_t;
35 using inner_t =
typename super_type::inner_t;
36 template <type_t Type>
38 template <type_t Type>
40 template <type_t Type>
42 using leaf_t =
typename super_type::leaf_t;
53 size_t operator()(
const std::shared_ptr<const node_t>& v) {
59 # define DEFINE(Type) \
60 using Type ## _t = typename super_type::Type ## _t; \
61 virtual void visit(const Type ## _t& v) override
80 void combine_type(
const node_t& node);
83 void visit_nullary(
const node_t& v);
86 template <rat::exp::type_t Type>
87 void visit_unary(
const unary_t<Type>& v);
90 template <rat::exp::type_t Type>
91 void visit_variadic(
const variadic_t<Type>& v);
94 template <rat::exp::type_t Type>
95 void visit_weight_node(
const weight_node_t<Type>& v);
size_t operator()(const std::shared_ptr< const node_t > &v)
Entry point: return the hash of v.
Definition: hash.hh:53
typename super_type::template variadic_t< Type > variadic_t
Definition: hash.hh:37
typename super_type::template weight_node_t< Type > weight_node_t
Definition: hash.hh:41
typename super_type::node_t node_t
Definition: hash.hh:34
size_t operator()(const node_t &v)
Entry point: return the hash of v.
Definition: hash.hh:46
typename super_type::inner_t inner_t
Definition: hash.hh:35
typename super_type::template unary_t< Type > unary_t
Definition: hash.hh:39
context_t_of< ratexpset_t > context_t
Definition: hash.hh:31
typename context_t::weightset_t::value_t weight_t
Definition: hash.hh:32
typename super_type::leaf_t leaf_t
Definition: hash.hh:42
RatExpSet ratexpset_t
Definition: hash.hh:30
typename ratexpset_t::const_visitor super_type
Definition: hash.hh:33
variadic< type_t::sum, Label, Weight > sum
Definition: fwd.hh:154
weight_node< type_t::lweight, Label, Weight > lweight
Definition: fwd.hh:164
unary< type_t::star, Label, Weight > star
Definition: fwd.hh:129
constant< type_t::zero, Label, Weight > zero
Definition: fwd.hh:113
variadic< type_t::ldiv, Label, Weight > ldiv
Definition: fwd.hh:148
variadic< type_t::conjunction, Label, Weight > conjunction
Definition: fwd.hh:145
variadic< type_t::shuffle, Label, Weight > shuffle
Definition: fwd.hh:151
weight_node< type_t::rweight, Label, Weight > rweight
Definition: fwd.hh:167
unary< type_t::transposition, Label, Weight > transposition
Definition: fwd.hh:132
constant< type_t::one, Label, Weight > one
Definition: fwd.hh:116
unary< type_t::complement, Label, Weight > complement
Definition: fwd.hh:126
variadic< type_t::prod, Label, Weight > prod
Definition: fwd.hh:142
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
Main namespace of Awali.
Definition: ato.hh:22
#define DEFINE(Type)
Definition: hash.hh:59