.. index:: single: packs
.. _packs/0:

.. rst-class:: right

**object**

``packs``
=========

Pack handling predicates.

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

| **Author:** Paulo Moura
| **Version:** 0:89:0
| **Date:** 2026-03-24

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


| **Imports:**
|    ``public`` :ref:`packs_common <packs_common/0>`
|    ``public`` :ref:`options <options/0>`
| **Uses:**
|    :ref:`git <git/0>`
|    :ref:`list <list/0>`
|    :ref:`logtalk <logtalk/0>`
|    :ref:`os <os/0>`
|    :ref:`registries <registries/0>`
|    :ref:`type <type/0>`
|    :ref:`user <user/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`options_protocol/0::check_option/1`  :ref:`options_protocol/0::check_options/1`  :ref:`options_protocol/0::default_option/1`  :ref:`options_protocol/0::default_options/1`  :ref:`packs_common/0::directory/1`  :ref:`packs_common/0::directory/2`  :ref:`packs_common/0::help/0`  :ref:`packs_common/0::logtalk_packs/0`  :ref:`packs_common/0::logtalk_packs/1`  :ref:`options_protocol/0::option/2`  :ref:`options_protocol/0::option/3`  :ref:`packs_common/0::pin/0`  :ref:`packs_common/0::pin/1`  :ref:`packs_common/0::pinned/1`  :ref:`packs_common/0::prefix/0`  :ref:`packs_common/0::prefix/1`  :ref:`packs_common/0::readme/1`  :ref:`packs_common/0::readme/2`  :ref:`packs_common/0::reset/0`  :ref:`packs_common/0::setup/0`  :ref:`packs_common/0::unpin/0`  :ref:`packs_common/0::unpin/1`  :ref:`options_protocol/0::valid_option/1`  :ref:`options_protocol/0::valid_options/1`  :ref:`packs_common/0::verify_commands_availability/0`  

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

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

.. index:: available/2
.. _packs/0::available/2:

``available/2``
^^^^^^^^^^^^^^^

Enumerates, by backtracking, all available packs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``available(Registry,Pack)``
| **Mode and number of proofs:**
|    ``available(?atom,?atom)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: available/1
.. _packs/0::available/1:

``available/1``
^^^^^^^^^^^^^^^

Lists all the packs that are available for installation from the given registry.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``available(Registry)``
| **Mode and number of proofs:**
|    ``available(+atom)`` - ``one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``


------------

.. index:: available/0
.. _packs/0::available/0:

``available/0``
^^^^^^^^^^^^^^^

Lists all the packs that are available for installation from all defined registries.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``available`` - ``one``


------------

.. index:: installed/4
.. _packs/0::installed/4:

``installed/4``
^^^^^^^^^^^^^^^

Enumerates by backtracking all installed packs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``installed(Registry,Pack,Version,Pinned)``
| **Mode and number of proofs:**
|    ``installed(?atom,?atom,?compound,?boolean)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``Pinned`` is neither a variable nor a boolean:
|        ``type_error(boolean,Pinned)``


------------

.. index:: installed/3
.. _packs/0::installed/3:

``installed/3``
^^^^^^^^^^^^^^^

Enumerates by backtracking all installed packs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``installed(Registry,Pack,Version)``
| **Mode and number of proofs:**
|    ``installed(?atom,?atom,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``


------------

.. index:: installed/1
.. _packs/0::installed/1:

``installed/1``
^^^^^^^^^^^^^^^

Lists all the packs that are installed from the given registry. Fails if the registry is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``installed(Registry)``
| **Mode and number of proofs:**
|    ``installed(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``


------------

.. index:: installed/0
.. _packs/0::installed/0:

``installed/0``
^^^^^^^^^^^^^^^

Lists all the packs that are installed.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``installed`` - ``one``


------------

.. index:: outdated/5
.. _packs/0::outdated/5:

``outdated/5``
^^^^^^^^^^^^^^

Enumerates by backtracking all installed but outdated packs (together with the current version installed and the latest version available) using the given options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``outdated(Registry,Pack,Version,LatestVersion,Options)``
| **Mode and number of proofs:**
|    ``outdated(?atom,?atom,?compound,?compound,++list(compound))`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``LatestVersion`` is neither a variable nor a compound term:
|        ``type_error(compound,LatestVersion)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``compatible(Boolean)`` option: Restrict listing to compatible packs. Default is ``true``.
    - ``status(Status)`` option: Restrict listing to updates with the given status. Default is ``[stable,rc,beta,alpha]``. Set to ``all`` to also list ``experimental`` and ``deprecated`` updates.


------------

.. index:: outdated/4
.. _packs/0::outdated/4:

``outdated/4``
^^^^^^^^^^^^^^

Enumerates by backtracking all installed but outdated packs (together with the current version installed and the latest version available) using default options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``outdated(Registry,Pack,Version,LatestVersion)``
| **Mode and number of proofs:**
|    ``outdated(?atom,?atom,?compound,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``LatestVersion`` is neither a variable nor a compound term:
|        ``type_error(compound,LatestVersion)``

| **See also:**
|    :ref:`packs/0::outdated/5`


------------

.. index:: outdated/2
.. _packs/0::outdated/2:

``outdated/2``
^^^^^^^^^^^^^^

Lists all the packs from the given registry that are installed but outdated using the given options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``outdated(Registry,Options)``
| **Mode and number of proofs:**
|    ``outdated(+atom,++list(compound))`` - ``one``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``compatible(Boolean)`` option: Restrict installation to compatible packs. Default is ``true``.
    - ``status(Status)`` option: Restrict listing to updates with the given status. Default is ``[stable,rc,beta,alpha]``. Set to ``all`` to also list ``experimental`` and ``deprecated`` updates.


------------

.. index:: outdated/1
.. _packs/0::outdated/1:

``outdated/1``
^^^^^^^^^^^^^^

Lists all the packs from the given registry that are installed but outdated using default options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``outdated(Registry)``
| **Mode and number of proofs:**
|    ``outdated(+atom)`` - ``one``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``

| **See also:**
|    :ref:`packs/0::outdated/2`


------------

.. index:: outdated/0
.. _packs/0::outdated/0:

``outdated/0``
^^^^^^^^^^^^^^

Lists all the packs that are installed but outdated using default options.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``outdated`` - ``one``

| **See also:**
|    :ref:`packs/0::outdated/1`


------------

.. index:: orphaned/2
.. _packs/0::orphaned/2:

``orphaned/2``
^^^^^^^^^^^^^^

Lists all the packs that are installed but whose registry is no longer defined.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``orphaned(Registry,Pack)``
| **Mode and number of proofs:**
|    ``orphaned(?atom,?atom)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: orphaned/0
.. _packs/0::orphaned/0:

``orphaned/0``
^^^^^^^^^^^^^^

Lists all the packs that are installed but whose registry is no longer defined.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``orphaned`` - ``one``


------------

.. index:: versions/3
.. _packs/0::versions/3:

``versions/3``
^^^^^^^^^^^^^^

Returns a list of all available pack versions. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``versions(Registry,Pack,Versions)``
| **Mode and number of proofs:**
|    ``versions(+atom,+atom,-list)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: describe/2
.. _packs/0::describe/2:

``describe/2``
^^^^^^^^^^^^^^

Describes a registered pack, including installed version if applicable. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``describe(Registry,Pack)``
| **Mode and number of proofs:**
|    ``describe(+atom,+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: describe/1
.. _packs/0::describe/1:

``describe/1``
^^^^^^^^^^^^^^

Describes a registered pack, including installed version if applicable. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``describe(Pack)``
| **Mode and number of proofs:**
|    ``describe(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: pack_metadata/4
.. _packs/0::pack_metadata/4:

``pack_metadata/4``
^^^^^^^^^^^^^^^^^^^

Enumerates by backtracking resolved metadata for installed packs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``pack_metadata(Registry,Pack,Version,Metadata)``
| **Mode and number of proofs:**
|    ``pack_metadata(?atom,?atom,?compound,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``Metadata`` is neither a variable nor a compound term:
|        ``type_error(compound,Metadata)``

| **Remarks:**

    - ``Metadata``: Resolved metadata term for the selected installed pack version.
    - Resolved fields: The metadata term includes both version-independent pack metadata and version-specific metadata selected from the installed version.
    - Absent optional metadata: Missing optional metadata is normalized to ``none`` instead of causing failure.
    - Metadata term: Metadata is returned using the term ``metadata(Name, Description, License, Home, SourceURL, Checksum, Dependencies, Portability, Directory, Pinned, Installed, Loaded)``.

| **See also:**
|    :ref:`packs/0::pack_property/4`
|    :ref:`packs/0::pack_object/3`
|    :ref:`packs/0::loaded_pack/3`


------------

.. index:: pack_property/4
.. _packs/0::pack_property/4:

``pack_property/4``
^^^^^^^^^^^^^^^^^^^

Enumerates by backtracking resolved properties for installed pack versions.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``pack_property(Registry,Pack,Version,Property)``
| **Mode and number of proofs:**
|    ``pack_property(?atom,?atom,?compound,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``Property`` is neither a variable nor a compound term:
|        ``type_error(compound,Property)``

| **Remarks:**

    - ``Property``: A resolved property term for the selected installed pack version.
    - Supported properties: Supported properties are ``name(Name)``, ``description(Description)``, ``license(License)``, ``home(Home)``, ``source_url(URL)``, ``checksum(Checksum)``, ``dependencies(Dependencies)``, ``portability(Portability)``, ``directory(Directory)``, ``pinned(Boolean)``, ``installed(Boolean)``, and ``loaded(Boolean)``.
    - Absent optional metadata: Missing optional metadata is normalized to ``none``.

| **See also:**
|    :ref:`packs/0::pack_metadata/4`
|    :ref:`packs/0::pack_object/3`


------------

.. index:: pack_object/3
.. _packs/0::pack_object/3:

``pack_object/3``
^^^^^^^^^^^^^^^^^

Enumerates by backtracking pack specification objects for defined registry and pack pairs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``pack_object(Registry,Pack,PackObject)``
| **Mode and number of proofs:**
|    ``pack_object(?atom,?atom,?atom)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``PackObject`` is neither a variable nor an atom:
|        ``type_error(atom,PackObject)``

| **Remarks:**

    - ``PackObject``: Identifier of the object implementing the ``pack_protocol`` for the given registry and pack.
    - Intended use: This predicate is a low-level bridge for advanced tools and should not be required by most consumers when ``pack_metadata/4`` or ``pack_property/4`` is sufficient.

| **See also:**
|    :ref:`packs/0::pack_metadata/4`
|    :ref:`packs/0::pack_property/4`


------------

.. index:: loaded_pack/3
.. _packs/0::loaded_pack/3:

``loaded_pack/3``
^^^^^^^^^^^^^^^^^

Enumerates by backtracking all installed packs that contributed loaded files to the current session.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``loaded_pack(Registry,Pack,Version)``
| **Mode and number of proofs:**
|    ``loaded_pack(?atom,?atom,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``

| **Remarks:**

    - Loaded pack: A pack is considered loaded iff at least one currently loaded file belongs to its installation directory.
    - ``Version``: Installed version of the loaded pack.

| **See also:**
|    :ref:`packs/0::loaded_pack_file/4`
|    :ref:`packs/0::pack_metadata/4`
|    :ref:`packs/0::installed/3`


------------

.. index:: loaded_pack_file/4
.. _packs/0::loaded_pack_file/4:

``loaded_pack_file/4``
^^^^^^^^^^^^^^^^^^^^^^

Enumerates by backtracking loaded files that belong to installed packs in the current session.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``loaded_pack_file(Registry,Pack,Version,File)``
| **Mode and number of proofs:**
|    ``loaded_pack_file(?atom,?atom,?compound,?atom)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``File`` is neither a variable nor an atom:
|        ``type_error(atom,File)``

| **Remarks:**

    - ``File``: Absolute path of a currently loaded file belonging to the selected installed pack.
    - Intended use: This predicate supports diagnostics, tests, and the definition of ``loaded_pack/3``.

| **See also:**
|    :ref:`packs/0::loaded_pack/3`


------------

.. index:: search/1
.. _packs/0::search/1:

``search/1``
^^^^^^^^^^^^

Searches packs whose name or description includes the search term (case sensitive).

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``search(Term)``
| **Mode and number of proofs:**
|    ``search(+atom)`` - ``one``

| **Exceptions:**
|    ``Term`` is a variable:
|        ``instantiation_error``
|    ``Term`` is neither a variable nor an atom:
|        ``type_error(atom,Term)``


------------

.. index:: pack_dependency/6
.. _packs/0::pack_dependency/6:

``pack_dependency/6``
^^^^^^^^^^^^^^^^^^^^^

Enumerates by backtracking resolved direct pack-to-pack dependencies for installed pack versions.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``pack_dependency(Registry,Pack,Version,DependencyRegistry,DependencyPack,DependencyVersion)``
| **Mode and number of proofs:**
|    ``pack_dependency(?atom,?atom,?compound,?atom,?atom,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``DependencyRegistry`` is neither a variable nor an atom:
|        ``type_error(atom,DependencyRegistry)``
|    ``DependencyPack`` is neither a variable nor an atom:
|        ``type_error(atom,DependencyPack)``
|    ``DependencyVersion`` is neither a variable nor a compound term:
|        ``type_error(compound,DependencyVersion)``

| **Remarks:**

    - Resolved dependency: Dependencies are resolved against the current installed packs using the same version comparison semantics used by the tool installation logic.
    - Supported dependency forms: Version ranges, alternatives, and conjunctions are resolved using the canonical packs dependency semantics.
    - Non-pack dependencies: Dependencies on Logtalk, Prolog backends, and operating systems are ignored by this predicate and therefore do not produce results.

| **See also:**
|    :ref:`packs/0::loaded_pack_dependency/6`
|    :ref:`packs/0::pack_metadata/4`
|    :ref:`packs/0::loaded_pack/3`


------------

.. index:: loaded_pack_dependency/6
.. _packs/0::loaded_pack_dependency/6:

``loaded_pack_dependency/6``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Enumerates by backtracking resolved direct pack-to-pack dependencies where both the source pack and the dependency pack contributed loaded files to the current session.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``loaded_pack_dependency(Registry,Pack,Version,DependencyRegistry,DependencyPack,DependencyVersion)``
| **Mode and number of proofs:**
|    ``loaded_pack_dependency(?atom,?atom,?compound,?atom,?atom,?compound)`` - ``zero_or_more``

| **Exceptions:**
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is neither a variable nor a compound term:
|        ``type_error(compound,Version)``
|    ``DependencyRegistry`` is neither a variable nor an atom:
|        ``type_error(atom,DependencyRegistry)``
|    ``DependencyPack`` is neither a variable nor an atom:
|        ``type_error(atom,DependencyPack)``
|    ``DependencyVersion`` is neither a variable nor a compound term:
|        ``type_error(compound,DependencyVersion)``

| **Remarks:**

    - Loaded dependency edge: This predicate is the loaded-pack counterpart of ``pack_dependency/6`` and only succeeds when both endpoints are currently loaded.
    - Intended use: This predicate is especially useful for tools that need to describe relationships between the installed packs that contributed code to the current session.

| **See also:**
|    :ref:`packs/0::pack_dependency/6`
|    :ref:`packs/0::loaded_pack/3`


------------

.. index:: install/4
.. _packs/0::install/4:

``install/4``
^^^^^^^^^^^^^

Installs a new pack using the specified options. Fails if the pack is unknown or already installed but not using ``update(true)`` or ``force(true)`` options. Fails also if the pack version is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``install(Registry,Pack,Version,Options)``
| **Mode and number of proofs:**
|    ``install(+atom,+atom,++compound,++list(compound))`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is a variable:
|        ``instantiation_error``
|    ``Version`` is neither a variable nor a valid version:
|        ``type_error(pack_version,Version)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``update(Boolean)`` option: Update pack if already installed. Default is ``false``. Overrides the ``force/1`` option.
    - ``force(Boolean)`` option: Force pack re-installation if already installed. Default is ``false``.
    - ``compatible(Boolean)`` option: Restrict installation to compatible packs. Default is ``true``.
    - ``clean(Boolean)`` option: Clean pack archive after installation. Default is ``false``.
    - ``verbose(Boolean)`` option: Verbose installing steps. Default is ``false``.
    - ``checksum(Boolean)`` option: Verify pack archive checksum. Default is ``true``.
    - ``checksig(Boolean)`` option: Verify pack archive signature. Default is ``false``.
    - ``git(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``downloader(Atom)`` option: Downloader utility. Either ``curl`` or ``wget``. Default is ``curl``.
    - ``curl(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``wget(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``gpg(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``tar(Atom)`` option: Extra command-line options. Default is ``''``.


------------

.. index:: install/3
.. _packs/0::install/3:

``install/3``
^^^^^^^^^^^^^

Installs the specified version of a pack from the given registry using default options. Fails if the pack is already installed or unknown. Fails also if the pack version is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``install(Registry,Pack,Version)``
| **Mode and number of proofs:**
|    ``install(+atom,+atom,?compound)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is a variable:
|        ``instantiation_error``
|    ``Version`` is neither a variable nor a valid version:
|        ``type_error(pack_version,Version)``

| **See also:**
|    :ref:`packs/0::install/4`


------------

.. index:: install/2
.. _packs/0::install/2:

``install/2``
^^^^^^^^^^^^^

Installs the latest version of a pack from the given registry using default options. Fails if the pack is already installed or unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``install(Registry,Pack)``
| **Mode and number of proofs:**
|    ``install(+atom,+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``

| **See also:**
|    :ref:`packs/0::install/3`


------------

.. index:: install/1
.. _packs/0::install/1:

``install/1``
^^^^^^^^^^^^^

Installs a pack (if its name is unique among all registries) using default options. Fails if the pack is already installed or unknown. Fails also if the pack is available from multiple registries.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``install(Pack)``
| **Mode and number of proofs:**
|    ``install(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is not an atom:
|        ``type_error(atom,Pack)``

| **See also:**
|    :ref:`packs/0::install/2`


------------

.. index:: update/3
.. _packs/0::update/3:

``update/3``
^^^^^^^^^^^^

Updates an outdated pack to the specified version using the specified options. Fails if the pack or the pack version is unknown or if the pack is not installed. Fails also if the pack is orphaned or pinned and not using a ``force(true)`` option.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``update(Pack,Version,Options)``
| **Mode and number of proofs:**
|    ``update(+atom,++callable,++list(callable))`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Version`` is a variable:
|        ``instantiation_error``
|    ``Version`` is neither a variable nor a valid version:
|        ``type_error(pack_version,Version)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``install(Boolean)`` option: Install pack latest version if not already installed. Default is ``false``.
    - ``force(Boolean)`` option: Force update if the pack is pinned or breaks installed packs. Default is ``false``.
    - ``compatible(Boolean)`` option: Restrict updating to compatible packs. Default is ``true``.
    - ``status(Status)`` option: Specify allowed pack status. Default is ``[stable,rc,beta,alpha]``. Set to ``all`` to also allow ``experimental`` and ``deprecated``.
    - ``clean(Boolean)`` option: Clean pack archive after updating. Default is ``false``.
    - ``verbose(Boolean)`` option: Verbose updating steps. Default is ``false``.
    - ``checksum(Boolean)`` option: Verify pack archive checksum. Default is ``true``.
    - ``checksig(Boolean)`` option: Verify pack archive signature. Default is ``false``.
    - ``git(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``downloader(Atom)`` option: Downloader utility. Either ``curl`` or ``wget``. Default is ``curl``.
    - ``curl(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``wget(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``gpg(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``tar(Atom)`` option: Extra command-line options. Default is ``''``.


------------

.. index:: update/2
.. _packs/0::update/2:

``update/2``
^^^^^^^^^^^^

Updates an outdated pack to its latest version using the specified options. Fails if the pack is orphaned, unknown, or not installed. Fails also if the pack is pinned and not using a ``force(true)`` option.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``update(Pack,Options)``
| **Mode and number of proofs:**
|    ``update(+atom,++list(callable))`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``install(Boolean)`` option: Install pack latest version if not already installed. Default is ``false``.
    - ``force(Boolean)`` option: Force update if the pack is pinned or breaks installed packs. Default is ``false``.
    - ``compatible(Boolean)`` option: Restrict updating to compatible packs. Default is ``true``.
    - ``status(Status)`` option: Specify allowed pack update status. Default is ``[stable,rc,beta,alpha]``. Set to ``all`` to also allow ``experimental`` and ``deprecated``.
    - ``clean(Boolean)`` option: Clean pack archive after updating. Default is ``false``.
    - ``verbose(Boolean)`` option: Verbose updating steps. Default is ``false``.
    - ``checksum(Boolean)`` option: Verify pack archive checksum. Default is ``true``.
    - ``checksig(Boolean)`` option: Verify pack archive signature. Default is ``false``.
    - ``git(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``downloader(Atom)`` option: Downloader utility. Either ``curl`` or ``wget``. Default is ``curl``.
    - ``curl(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``wget(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``gpg(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``tar(Atom)`` option: Extra command-line options. Default is ``''``.


------------

.. index:: update/1
.. _packs/0::update/1:

``update/1``
^^^^^^^^^^^^

Updates an outdated pack to its latest version using default options. Fails if the pack is pinned, orphaned, not installed, unknown, or breaks installed packs.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``update(Pack)``
| **Mode and number of proofs:**
|    ``update(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``

| **See also:**
|    :ref:`packs/0::update/2`
|    :ref:`packs/0::update/3`


------------

.. index:: update/0
.. _packs/0::update/0:

``update/0``
^^^^^^^^^^^^

Updates all outdated packs (that are not pinned) using default options.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``update`` - ``zero_or_one``


------------

.. index:: uninstall/2
.. _packs/0::uninstall/2:

``uninstall/2``
^^^^^^^^^^^^^^^

Uninstalls a pack using the specified options. Fails if the pack is unknown or not installed. Fails also if the pack is pinned or have dependents and not using a ``force(true)`` option.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``uninstall(Pack,Options)``
| **Mode and number of proofs:**
|    ``uninstall(+atom,++list(compound))`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``force(Boolean)`` option: Force deletion if the pack is pinned. Default is ``false``.
    - ``clean(Boolean)`` option: Clean pack archive after deleting. Default is ``false``.
    - ``verbose(Boolean)`` option: Verbose uninstalling steps. Default is ``false``.


------------

.. index:: uninstall/1
.. _packs/0::uninstall/1:

``uninstall/1``
^^^^^^^^^^^^^^^

Uninstalls a pack using default options. Fails if the pack is pinned, have dependents, not installed, or unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``uninstall(Pack)``
| **Mode and number of proofs:**
|    ``uninstall(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``

| **See also:**
|    :ref:`packs/0::uninstall/2`


------------

.. index:: uninstall/0
.. _packs/0::uninstall/0:

``uninstall/0``
^^^^^^^^^^^^^^^

Uninstalls all packs using the ``force(true)`` option.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``uninstall`` - ``zero_or_one``


------------

.. index:: clean/2
.. _packs/0::clean/2:

``clean/2``
^^^^^^^^^^^

Cleans all pack archives. Fails if the the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``clean(Registry,Pack)``
| **Mode and number of proofs:**
|    ``clean(+atom,+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: clean/1
.. _packs/0::clean/1:

``clean/1``
^^^^^^^^^^^

Cleans all pack archives. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``clean(Pack)``
| **Mode and number of proofs:**
|    ``clean(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``

| **See also:**
|    :ref:`packs/0::clean/2`


------------

.. index:: clean/0
.. _packs/0::clean/0:

``clean/0``
^^^^^^^^^^^

Cleans all archives for all packs.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``clean`` - ``one``


------------

.. index:: save/2
.. _packs/0::save/2:

``save/2``
^^^^^^^^^^

Saves a list of all installed packs and registries plus pinning status to a file using the given options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``save(File,Options)``
| **Mode and number of proofs:**
|    ``save(+atom,++list(compound))`` - ``one_or_error``

| **Exceptions:**
|    ``File`` is a variable:
|        ``instantiation_error``
|    ``File`` is neither a variable nor an atom:
|        ``type_error(atom,File)``
|    ``File`` is an existing file but cannot be written:
|        ``permission_error(open,source_sink,File)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``lock(Boolean)`` option: Save lock extension facts (lockfile version, git registry commits, and pack integrity hashes) in addition to the standard requirements facts. Default is ``false``.
    - ``save(What)`` option: Save registries without installed packs when ``What`` is ``all`` and skip them when ``What`` is ``installed``. Default is ``installed``.


------------

.. index:: save/1
.. _packs/0::save/1:

``save/1``
^^^^^^^^^^

Saves a list of all installed packs and their registries plus pinning status to a file using default options.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``save(File)``
| **Mode and number of proofs:**
|    ``save(+atom)`` - ``one_or_error``

| **Exceptions:**
|    ``File`` is a variable:
|        ``instantiation_error``
|    ``File`` is neither a variable nor an atom:
|        ``type_error(atom,File)``
|    ``File`` is an existing file but cannot be written:
|        ``permission_error(open,source_sink,File)``

| **See also:**
|    :ref:`packs/0::save/2`


------------

.. index:: restore/2
.. _packs/0::restore/2:

``restore/2``
^^^^^^^^^^^^^

Restores a list of registries and packs plus their pinning status from a file using the given options. Fails if restoring is not possible.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``restore(File,Options)``
| **Mode and number of proofs:**
|    ``restore(+atom,++list(compound))`` - ``zero_or_one_or_error``

| **Exceptions:**
|    ``File`` is a variable:
|        ``instantiation_error``
|    ``File`` is neither a variable nor an atom:
|        ``type_error(atom,File)``
|    ``File`` is an atom but not an existing file:
|        ``existence_error(file,File)``
|    ``File`` is an existing file but cannot be read:
|        ``permission_error(open,source_sink,File)``
|    ``Options`` is a variable:
|        ``instantiation_error``
|    ``Options`` is neither a variable nor a list:
|        ``type_error(list,Options)``
|    An element ``Option`` of the list ``Options`` is a variable:
|        ``instantiation_error``
|    An element ``Option`` of the list ``Options`` is neither a variable nor a compound term:
|        ``type_error(compound,Option)``
|    An element ``Option`` of the list ``Options`` is a compound term but not a valid option:
|        ``domain_error(option,Option)``

| **Remarks:**

    - ``lock(Boolean)`` option: Require lock extension facts and enforce strict restoring (exact versions, git registry commits, and pack integrity hashes). Default is ``false``.
    - ``force(Boolean)`` option: Force restoring if a registry is already defined or a pack is already installed. Default is ``true``.
    - ``compatible(Boolean)`` option: Restrict installation to compatible packs. Default is ``true``.
    - ``clean(Boolean)`` option: Clean registry and pack archives after restoring. Default is ``false``.
    - ``verbose(Boolean)`` option: Verbose restoring steps. Default is ``false``.
    - ``checksum(Boolean)`` option: Verify pack archive checksums. Default is ``true``.
    - ``checksig(Boolean)`` option: Verify pack archive signatures. Default is ``false``.
    - ``git(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``downloader(Atom)`` option: Downloader utility. Either ``curl`` or ``wget``. Default is ``curl``.
    - ``curl(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``wget(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``gpg(Atom)`` option: Extra command-line options. Default is ``''``.
    - ``tar(Atom)`` option: Extra command-line options. Default is ``''``.


------------

.. index:: restore/1
.. _packs/0::restore/1:

``restore/1``
^^^^^^^^^^^^^

Restores a list of registries and packs plus their pinning status from a file using default options. Fails if restoring is not possible.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``restore(File)``
| **Mode and number of proofs:**
|    ``restore(+atom)`` - ``zero_or_one_or_error``

| **Exceptions:**
|    ``File`` is a variable:
|        ``instantiation_error``
|    ``File`` is neither a variable nor an atom:
|        ``type_error(atom,File)``
|    ``File`` is an atom but not an existing file:
|        ``existence_error(file,File)``
|    ``File`` is an existing file but cannot be read:
|        ``permission_error(open,source_sink,File)``

| **See also:**
|    :ref:`packs/0::restore/2`


------------

.. index:: dependents/3
.. _packs/0::dependents/3:

``dependents/3``
^^^^^^^^^^^^^^^^

Returns a list of all installed packs that depend on the given pack from the given registry. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``dependents(Registry,Pack,Dependents)``
| **Mode and number of proofs:**
|    ``dependents(+atom,+atom,-list(atom))`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: dependents/2
.. _packs/0::dependents/2:

``dependents/2``
^^^^^^^^^^^^^^^^

Prints a list of all installed packs that depend on the given pack from the given registry. Fails if the pack is unknown.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``dependents(Registry,Pack)``
| **Mode and number of proofs:**
|    ``dependents(+atom,+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: dependents/1
.. _packs/0::dependents/1:

``dependents/1``
^^^^^^^^^^^^^^^^

Prints a list of all installed packs that depend on the given pack if unique from all defined registries. Fails if the pack is unknown or available from multiple registries.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``dependents(Pack)``
| **Mode and number of proofs:**
|    ``dependents(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: lint/2
.. _packs/0::lint/2:

``lint/2``
^^^^^^^^^^

Checks the pack specification. Fails if the pack is unknown or if linting detects errors.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``lint(Registry,Pack)``
| **Mode and number of proofs:**
|    ``lint(+atom,+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Registry`` is a variable:
|        ``instantiation_error``
|    ``Registry`` is neither a variable nor an atom:
|        ``type_error(atom,Registry)``
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: lint/1
.. _packs/0::lint/1:

``lint/1``
^^^^^^^^^^

Checks the pack specification. Fails if the pack is unknown, or available from multiple registries, or if linting detects errors.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``lint(Pack)``
| **Mode and number of proofs:**
|    ``lint(+atom)`` - ``zero_or_one``

| **Exceptions:**
|    ``Pack`` is a variable:
|        ``instantiation_error``
|    ``Pack`` is neither a variable nor an atom:
|        ``type_error(atom,Pack)``


------------

.. index:: lint/0
.. _packs/0::lint/0:

``lint/0``
^^^^^^^^^^

Checks all pack specifications.

| **Compilation flags:**
|    ``static``

| **Mode and number of proofs:**
|    ``lint`` - ``one``


------------

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

(no local declarations; see entity ancestors if any)

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

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

