Did you know ... | Search Documentation: |
nb_set.pl -- Non-backtrackable sets |
This library provides a non-backtrackabe set of terms that are variants of each other. It is primarily intended to implement distinct/1 from library(solution_sequences). The set is implemented as a hash table that is built using non-backtrackable primitives, notably nb_setarg/3.
The original version of this library used binary trees which provides immediate ordering. As the trees were not balanced, performance could get really poor. The complexity of balancing trees using non-backtrackable primitives is too high. The next iteration used open hash tables, while the current incarnation uses closed hash tables, providing better perfomance and less space usage.
false
. Otherwise, New is unified with true
and a copy of
Key is added to the set.