Connect++ 0.6.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
term_hash Struct Reference

Hashing for terms using the Boost library. More...

#include <TermHash.hpp>

Public Member Functions

size_t operator() (const Term &t) const
 

Detailed Description

Hashing for terms using the Boost library.

You need to be able to hash Terms, as the term index stores them in an unordered_map.

Definition at line 38 of file TermHash.hpp.

Member Function Documentation

◆ operator()()

size_t term_hash::operator() ( const Term & t) const
inline

Definition at line 39 of file TermHash.hpp.

39 {
40 size_t hash = 0;
41 for (size_t i = 0; i < t.arity(); i++)
42 boost::hash_combine(hash, t[i]);
43 boost::hash_combine(hash, t.get_v());
44 boost::hash_combine(hash, t.get_f());
45 return hash;
46 }
Variable * get_v() const
Self-explanatory access function.
Definition Term.hpp:86
Function * get_f() const
Self-explanatory access function.
Definition Term.hpp:90
Arity arity() const
Self-explanatory access function.
Definition Term.hpp:102

The documentation for this struct was generated from the following file: