9 template <
typename ExpSet>
11 :
public ExpSet::const_visitor
17 using super_t =
typename expressionset_t::const_visitor;
20 using node_t =
typename super_t::node_t;
24 template <type_t Type>
26 template <type_t Type>
28 template <type_t Type>
30 template <type_t Type>
34 constexpr
static const char*
me() {
return "hash"; }
77 combine_(ExpSet::labelset_t::hash(
v.value()));
86 using tuple_t =
typename super_t::tuple_t;
88 template <
typename =
void>
91 using tupleset_t =
typename expressionset_t::template as_tupleset_t<>;
94 return tupleset_t::hash(v.sub());
100 detail::static_if<context_t::is_lat>
110 template <rat::exp::type_t Type>
117 template <rat::exp::type_t Type>
121 v.sub()->accept(*
this);
125 template <rat::exp::type_t Type>
129 for (
const auto& child : v)
130 child->accept(*
this);
134 template <rat::exp::type_t Type>
138 combine_(ExpSet::weightset_t::hash(v.weight()));
139 v.sub()->accept(*
this);
size_t res_
The result, which must be updated incrementally.
void visit_(const variadic_t< Type > &v)
Traverse an n-ary node.
typename super_t::node_t node_t
Actual node, without indirection.
typename super_t::tuple_t tuple_t
context_t_of< expressionset_t > context_t
An inner node with multiple children.
void combine_type_(const node_t &node)
Update res_ by hashing the node type.
typename expressionset_t::template as_tupleset_t<> tupleset_t
VCSN_RAT_VISIT(rweight, v)
VCSN_RAT_VISIT(infiltrate, v)
typename super_t::template unary_t< Type > unary_t
void visit(const tuple_t &v, std::true_type) override
VCSN_RAT_VISIT(lweight, v)
VCSN_RAT_VISIT(compose, v)
void visit_(const constant_t< Type > &v)
Traverse a nullary node.
VCSN_RAT_VISIT(transposition, v)
VCSN_RAT_VISIT(complement, v)
VCSN_RAT_VISIT(shuffle, v)
typename super_t::template weight_node_t< Type > weight_node_t
An inner node to name the subexpression.
typename detail::context_t_of_impl< base_t< ValueSet > >::type context_t_of
auto hash_value(const T &v) -> decltype(std::hash< T >
Following the naming convention of Boost.
void visit_(const weight_node_t< Type > &v)
Traverse a weight node (lweight, rweight).
void combine_(size_t h)
Update res_ with the hash.
The abstract parameterized, root for all rational expression types.
void visit_(const unary_t< Type > &v)
Traverse a unary node.
typename node_t::value_t expression_t
A shared_ptr to node_t.
typename super_t::template constant_t< Type > constant_t
An inner node implementing a weight.
typename expressionset_t::const_visitor super_t
size_t operator()(const tuple_t &v)
static constexpr const char * me()
Name of this algorithm, for error messages.
void hash_combine(std::size_t &seed, const T &v)
VCSN_RAT_VISIT(conjunction, v)
typename super_t::template variadic_t< Type > variadic_t
VCSN_RAT_VISIT(ldivide, v)
size_t operator()(const expression_t &v)
Entry point: return the hash of v.