.. index:: single: pattern_miner_protocol
.. _pattern_miner_protocol/0:

.. rst-class:: right

**protocol**

``pattern_miner_protocol``
==========================

Protocol for machine learning pattern-mining algorithms.

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

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-04-30

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


| **Dependencies:**
|   (none)


| **Remarks:**
|    (none)

| **Inherited public predicates:**
|    (none)

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

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

.. index:: mine/3
.. _pattern_miner_protocol/0::mine/3:

``mine/3``
^^^^^^^^^^

Mines a pattern miner result from the given dataset object using the specified options.

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

| **Template:**
|    ``mine(Dataset,PatternMiner,Options)``
| **Mode and number of proofs:**
|    ``mine(+object_identifier,-compound,+list(compound))`` - ``one``


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

.. index:: mine/2
.. _pattern_miner_protocol/0::mine/2:

``mine/2``
^^^^^^^^^^

Mines a pattern miner result from the given dataset object using default options.

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

| **Template:**
|    ``mine(Dataset,PatternMiner)``
| **Mode and number of proofs:**
|    ``mine(+object_identifier,-compound)`` - ``one``


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

.. index:: diagnostics/2
.. _pattern_miner_protocol/0::diagnostics/2:

``diagnostics/2``
^^^^^^^^^^^^^^^^^

Returns diagnostics and metadata associated with a mined pattern miner in a representation-independent way.

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

| **Template:**
|    ``diagnostics(PatternMiner,Diagnostics)``
| **Mode and number of proofs:**
|    ``diagnostics(+compound,-list(compound))`` - ``one``


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

.. index:: diagnostic/2
.. _pattern_miner_protocol/0::diagnostic/2:

``diagnostic/2``
^^^^^^^^^^^^^^^^

Tests or enumerates individual diagnostics metadata terms for a mined pattern miner.

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

| **Template:**
|    ``diagnostic(PatternMiner,Diagnostic)``
| **Mode and number of proofs:**
|    ``diagnostic(+compound,?compound)`` - ``zero_or_more``


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

.. index:: pattern_miner_options/2
.. _pattern_miner_protocol/0::pattern_miner_options/2:

``pattern_miner_options/2``
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Returns the effective mining options recorded in a mined pattern miner diagnostics list.

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

| **Template:**
|    ``pattern_miner_options(PatternMiner,Options)``
| **Mode and number of proofs:**
|    ``pattern_miner_options(+compound,-list(compound))`` - ``zero_or_one``


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

.. index:: check_pattern_miner/1
.. _pattern_miner_protocol/0::check_pattern_miner/1:

``check_pattern_miner/1``
^^^^^^^^^^^^^^^^^^^^^^^^^

Checks that the argument is a structurally valid mined pattern miner term for the receiving pattern miner implementation, throwing an exception on invalid input when applicable.

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

| **Template:**
|    ``check_pattern_miner(PatternMiner)``
| **Mode and number of proofs:**
|    ``check_pattern_miner(@compound)`` - ``one_or_error``

| **Exceptions:**
|    ``PatternMiner`` is a variable:
|        ``instantiation_error``
|    ``PatternMiner`` is neither a variable nor a valid pattern miner:
|        ``domain_error(pattern_miner,PatternMiner)``


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

.. index:: valid_pattern_miner/1
.. _pattern_miner_protocol/0::valid_pattern_miner/1:

``valid_pattern_miner/1``
^^^^^^^^^^^^^^^^^^^^^^^^^

True when ``check_pattern_miner/1`` succeeds for the argument without throwing an exception.

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

| **Template:**
|    ``valid_pattern_miner(PatternMiner)``
| **Mode and number of proofs:**
|    ``valid_pattern_miner(@compound)`` - ``zero_or_one``


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

.. index:: export_to_clauses/4
.. _pattern_miner_protocol/0::export_to_clauses/4:

``export_to_clauses/4``
^^^^^^^^^^^^^^^^^^^^^^^

Converts a pattern miner result into a list of predicate clauses. ``Functor`` is the functor for the generated predicate clauses.

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

| **Template:**
|    ``export_to_clauses(Dataset,PatternMiner,Functor,Clauses)``
| **Mode and number of proofs:**
|    ``export_to_clauses(+object_identifier,+compound,+callable,-list(clause))`` - ``one``


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

.. index:: export_to_file/4
.. _pattern_miner_protocol/0::export_to_file/4:

``export_to_file/4``
^^^^^^^^^^^^^^^^^^^^

Exports a pattern miner result to a file. ``Functor`` is the functor for the generated predicate clauses.

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

| **Template:**
|    ``export_to_file(Dataset,PatternMiner,Functor,File)``
| **Mode and number of proofs:**
|    ``export_to_file(+object_identifier,+compound,+callable,+atom)`` - ``one``


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

.. index:: print_pattern_miner/1
.. _pattern_miner_protocol/0::print_pattern_miner/1:

``print_pattern_miner/1``
^^^^^^^^^^^^^^^^^^^^^^^^^

Prints a pattern miner result to the current output stream in a human-readable format.

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

| **Template:**
|    ``print_pattern_miner(PatternMiner)``
| **Mode and number of proofs:**
|    ``print_pattern_miner(+compound)`` - ``one``


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

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

(none)

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

(none)

Operators
---------

(none)

.. seealso::

   :ref:`transaction_dataset_protocol <transaction_dataset_protocol/0>`, :ref:`sequence_dataset_protocol <sequence_dataset_protocol/0>`

