| Did you know ... | Search Documentation: |
| Predicate variant_sha1/2 |
This predicate raises an exception when trying to compute the hash on an attributed term. Attributed terms are not handled because subsumes_chk/2 is not considered well defined for attributed terms.
Cyclic terms are supported. The hash is taken over a canonical form of the term graph, so that terms denoting the same infinite tree hash alike however many cells they were written with. That is, given A=[a|A] and B=[a,a|B], A and B produce the same hash. Note that the hash of a cyclic term is not the hash of any acyclic term, as a cyclic term is never =@=/2 to one.
This hash was developed for lookup of solutions to a goal stored in a table. By using a cryptographic hash, heuristic algorithms can often ignore the possibility of hash collisions and thus avoid storing the goal term itself as well as testing using =@=/2.