Connect++ 0.4.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. (Well, it will eventually. This is currently unused.)

Definition at line 39 of file TermHash.hpp.

Member Function Documentation

◆ operator()()

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

Definition at line 40 of file TermHash.hpp.

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

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