.. index:: assignvarsp
.. _assignvarsp/0:

.. rst-class:: right

**protocol**

``assignvarsp``
===============

Assignable variables (supporting backtracable assignment of non-variable terms) protocol.

| **Author:** Nobukuni Kino and Paulo Moura
| **Version:** 1.01
| **Date:** 2019/6/10

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


| **Dependencies:**
|   (none)


| **Remarks:**
|    (none)

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

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

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

.. raw:: html

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

.. index:: assignable/1
.. _assignvarsp/0::assignable/1:

``assignable/1``
^^^^^^^^^^^^^^^^

Makes ``Variable`` an assignable variable. Initial state will be empty.

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

| **Template:**
|    ``assignable(Variable)``
| **Mode and number of proofs:**
|    ``assignable(--assignvar)`` - ``one``

| **Exceptions:**
|    Variable is not a variable:
|        ``type_error(variable,Variable)``


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

.. raw:: html

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

.. index:: assignable/2
.. _assignvarsp/0::assignable/2:

``assignable/2``
^^^^^^^^^^^^^^^^

Makes ``Variable`` an assignable variable and sets its initial state to ``Value``.

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

| **Template:**
|    ``assignable(Variable,Value)``
| **Mode and number of proofs:**
|    ``assignable(--assignvar,@nonvar)`` - ``one``

| **Exceptions:**
|    Variable is not a variable:
|        ``type_error(variable,Variable)``
|    Value is not instantiated:
|        ``instantiation_error``


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

.. raw:: html

   <div id="(<=)/2"> </div>

.. index:: (<=)/2
.. _assignvarsp/0::(<=)/2:

``(<=)/2``
^^^^^^^^^^

Sets the state of the assignable variable ``Variable`` to ``Value`` (initializing the variable if needed).

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

| **Template:**
|    ``Variable<=Value``
| **Mode and number of proofs:**
|    ``(?assignvar)<=(@nonvar)`` - ``one``

| **Exceptions:**
|    Value is not instantiated:
|        ``instantiation_error``


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

.. raw:: html

   <div id="(=>)/2"> </div>

.. index:: (=>)/2
.. _assignvarsp/0::(=>)/2:

``(=>)/2``
^^^^^^^^^^

Unifies ``Value`` with the current state of the assignable variable ``Variable``.

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

| **Template:**
|    ``Variable=>Value``
| **Mode and number of proofs:**
|    ``(+assignvar)=>(?nonvar)`` - ``zero_or_one``

| **Exceptions:**
|    Variable is not instantiated:
|        ``instantiation_error``


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

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

(none)

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

(none)

Operators
---------

``op(100,xfx,<=)``
^^^^^^^^^^^^^^^^^^

| **Scope:**
|    ``public``

``op(100,xfx,=>)``
^^^^^^^^^^^^^^^^^^

| **Scope:**
|    ``public``



.. seealso::

   :ref:`assignvars <assignvars/0>`

