.. index:: single: derangements
.. _derangements/0:

.. rst-class:: right

**object**

``derangements``
================

Implementation of derangement operations over lists.

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

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-05-12

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


| **Implements:**
|    ``public`` :ref:`derangements_protocol <derangements_protocol/0>`
| **Uses:**
|    :ref:`fast_random(Algorithm) <fast_random/1>`
|    :ref:`list <list/0>`
|    :ref:`natural <natural/0>`
|    :ref:`permutations <permutations/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`derangements_protocol/0::count_derangements/2`  :ref:`derangements_protocol/0::count_distinct_derangements/2`  :ref:`derangements_protocol/0::count_partial_derangements/3`  :ref:`derangements_protocol/0::derangement/2`  :ref:`derangements_protocol/0::derangement/3`  :ref:`derangements_protocol/0::derangement_index/3`  :ref:`derangements_protocol/0::derangement_index/4`  :ref:`derangements_protocol/0::derangements/2`  :ref:`derangements_protocol/0::derangements/3`  :ref:`derangements_protocol/0::distinct_derangement/2`  :ref:`derangements_protocol/0::distinct_derangement/3`  :ref:`derangements_protocol/0::distinct_derangement_index/3`  :ref:`derangements_protocol/0::distinct_derangements/2`  :ref:`derangements_protocol/0::distinct_derangements/3`  :ref:`derangements_protocol/0::next_derangement/3`  :ref:`derangements_protocol/0::nth_derangement/3`  :ref:`derangements_protocol/0::nth_derangement/4`  :ref:`derangements_protocol/0::nth_distinct_derangement/3`  :ref:`derangements_protocol/0::previous_derangement/3`  :ref:`derangements_protocol/0::random_derangement/2`  :ref:`derangements_protocol/0::random_distinct_derangement/2`  :ref:`derangements_protocol/0::sample_derangements/3`  :ref:`derangements_protocol/0::sample_distinct_derangements/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)

