9 template <
typename ExpSet>
11 :
public ExpSet::const_visitor
16 using super_t =
typename expressionset_t::const_visitor;
19 using node_t =
typename super_t::node_t;
23 template <type_t Type>
25 template <type_t Type>
27 template <type_t Type>
29 template <type_t Type>
33 constexpr
static const char*
me() {
return "hash"; }
76 combine_(ExpSet::labelset_t::hash(
v.value()));
79 using tuple_t =
typename super_t::tuple_t;
81 template <
typename =
void>
84 using tupleset_t =
typename expressionset_t::template as_tupleset_t<>;
87 return tupleset_t::hash(v.sub());
93 detail::static_if<context_t::is_lat>
103 template <rat::exp::type_t Type>
110 template <rat::exp::type_t Type>
114 v.sub()->accept(*
this);
118 template <rat::exp::type_t Type>
122 for (
const auto& child : v)
123 child->accept(*
this);
127 template <rat::exp::type_t Type>
131 combine_(ExpSet::weightset_t::hash(v.weight()));
132 v.sub()->accept(*
this);
VCSN_RAT_VISIT(ldivide, v)
void visit_(const weight_node_t< Type > &v)
Traverse a weight node (lweight, rweight).
typename super_t::node_t node_t
Actual node, without indirection.
An inner node implementing a weight.
context_t_of< expressionset_t > context_t
size_t operator()(const expression_t &v)
Entry point: return the hash of v.
typename super_t::tuple_t tuple_t
VCSN_RAT_VISIT(rweight, v)
static constexpr const char * me()
Name of this algorithm, for error messages.
void visit_(const variadic_t< Type > &v)
Traverse an n-ary node.
typename super_t::template unary_t< Type > unary_t
typename expressionset_t::template as_tupleset_t<> tupleset_t
VCSN_RAT_VISIT(lweight, v)
void combine_type_(const node_t &node)
Update res_ by hashing the node type.
VCSN_RAT_VISIT(transposition, v)
typename expressionset_t::const_visitor super_t
void visit(const tuple_t &v, std::true_type) override
void visit_(const unary_t< Type > &v)
Traverse a unary node.
An inner node with multiple children.
typename super_t::template weight_node_t< Type > weight_node_t
typename super_t::template constant_t< Type > constant_t
size_t operator()(const tuple_t &v)
void visit_(const constant_t< Type > &v)
Traverse a nullary node.
VCSN_RAT_VISIT(infiltrate, v)
typename super_t::template variadic_t< Type > variadic_t
void combine_(size_t h)
Update res_ with the hash.
void hash_combine(std::size_t &seed, const T &v)
VCSN_RAT_VISIT(conjunction, v)
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
typename node_t::value_t expression_t
A shared_ptr to node_t.
VCSN_RAT_VISIT(compose, v)
VCSN_RAT_VISIT(complement, v)
The abstract parameterized, root for all rational expression types.
VCSN_RAT_VISIT(shuffle, v)
size_t res_
The result, which must be updated incrementally.