.. index:: single: treap_set
.. _treap_set/0:

.. rst-class:: right

**object**

``treap_set``
=============

Set predicates implemented using treaps (tree heaps). A treap is a binary search tree with randomly assigned priorities. Uses ``==/2`` for element comparison and standard term ordering.

| **Availability:** 
|    ``logtalk_load(sets(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-01-28

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Implements:**
|    ``public`` :ref:`setp <setp/0>`
| **Extends:**
|    ``public`` :ref:`compound <compound/0>`
| **Uses:**
|    :ref:`fast_random(Algorithm) <fast_random/1>`
|    :ref:`list <list/0>`
|    :ref:`set <set/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`comparingp/0::(<)/2`  :ref:`comparingp/0::(=:=)/2`  :ref:`comparingp/0::(=<)/2`  :ref:`comparingp/0::(=\=)/2`  :ref:`comparingp/0::(>)/2`  :ref:`comparingp/0::(>=)/2`  :ref:`setp/0::as_list/2`  :ref:`setp/0::as_set/2`  :ref:`termp/0::check/1`  :ref:`setp/0::delete/3`  :ref:`termp/0::depth/2`  :ref:`setp/0::disjoint/2`  :ref:`setp/0::empty/1`  :ref:`setp/0::equal/2`  :ref:`termp/0::ground/1`  :ref:`setp/0::insert/3`  :ref:`setp/0::insert_all/3`  :ref:`setp/0::intersect/2`  :ref:`setp/0::intersection/3`  :ref:`setp/0::intersection/4`  :ref:`setp/0::member/2`  :ref:`setp/0::memberchk/2`  :ref:`termp/0::new/1`  :ref:`termp/0::numbervars/1`  :ref:`termp/0::numbervars/3`  :ref:`termp/0::occurs/2`  :ref:`setp/0::powerset/2`  :ref:`setp/0::product/3`  :ref:`setp/0::select/3`  :ref:`setp/0::selectchk/3`  :ref:`termp/0::singletons/2`  :ref:`setp/0::size/2`  :ref:`setp/0::subset/2`  :ref:`termp/0::subsumes/2`  :ref:`termp/0::subterm/2`  :ref:`setp/0::subtract/3`  :ref:`setp/0::symdiff/3`  :ref:`setp/0::union/3`  :ref:`setp/0::union/4`  :ref:`termp/0::valid/1`  :ref:`termp/0::variables/2`  :ref:`termp/0::variant/2`  :ref:`termp/0::varnumbers/2`  :ref:`termp/0::varnumbers/3`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

.. seealso::

   :ref:`set <set/0>`, :ref:`set(Type) <set/1>`

