.. index:: counters
.. _counters/0:

.. rst-class:: right

**category**

``counters``
============

Named integer counters. Counter names can be any nonvar term.

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2011-01-03

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


| **Dependencies:**
|   (none)


| **Remarks:**
|    (none)

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

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

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

.. raw:: html

   <div id="counter/2"> </div>

.. index:: counter/2
.. _counters/0::counter/2:

``counter/2``
^^^^^^^^^^^^^

True if ``Counter`` is a counter with value ``Value``.

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

| **Template:**
|    ``counter(Counter,Value)``
| **Mode and number of proofs:**
|    ``counter(?nonvar,?integer)`` - ``zero_or_more``


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

.. raw:: html

   <div id="increment_counter/1"> </div>

.. index:: increment_counter/1
.. _counters/0::increment_counter/1:

``increment_counter/1``
^^^^^^^^^^^^^^^^^^^^^^^

Increments the named counter.

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

| **Template:**
|    ``increment_counter(Counter)``
| **Mode and number of proofs:**
|    ``increment_counter(+nonvar)`` - ``one``


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

.. raw:: html

   <div id="decrement_counter/1"> </div>

.. index:: decrement_counter/1
.. _counters/0::decrement_counter/1:

``decrement_counter/1``
^^^^^^^^^^^^^^^^^^^^^^^

Decrements the named counter.

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

| **Template:**
|    ``decrement_counter(Counter)``
| **Mode and number of proofs:**
|    ``decrement_counter(+nonvar)`` - ``one``


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

.. raw:: html

   <div id="reset_counter/1"> </div>

.. index:: reset_counter/1
.. _counters/0::reset_counter/1:

``reset_counter/1``
^^^^^^^^^^^^^^^^^^^

Resets the named counter to zero. Creates the counter if it does not exist.

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

| **Template:**
|    ``reset_counter(Counter)``
| **Mode and number of proofs:**
|    ``reset_counter(+nonvar)`` - ``one``


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

.. raw:: html

   <div id="reset_counters/0"> </div>

.. index:: reset_counters/0
.. _counters/0::reset_counters/0:

``reset_counters/0``
^^^^^^^^^^^^^^^^^^^^

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

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


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

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

(none)

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

.. raw:: html

   <div id="counter_/2"> </div>

.. index:: counter_/2
.. _counters/0::counter_/2:

``counter_/2``
^^^^^^^^^^^^^^

Table of named counters.

| **Compilation flags:**
|    ``dynamic``

| **Template:**
|    ``counter_(Counter,Value)``
| **Mode and number of proofs:**
|    ``counter_(?nonvar,?integer)`` - ``zero_or_more``


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

Operators
---------

(none)

