-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e54ac9f
commit ca2122a
Showing
7 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
and | ||
=== | ||
|
||
The built-in function ``and`` accepts one or more :ref:`sentence expression values <sentencevalue>` and returns a sentence which links each argument sentence using the ``&`` :ref:`connective <and>`. | ||
|
||
Syntax | ||
------ | ||
|
||
.. code-block:: | ||
and([sentence argument expression], ...) | ||
Behavior | ||
-------- | ||
|
||
``and`` accepts one or more argument expressions. If any argument expression does not evaluate to a :ref:`sentence expression value <sentencevalue>` or any argument sentence has unbound objects or predicates, then an error is raised. Otherwise, the output is a sentence composed of each argument sentence joined in order using the ``&`` :ref:`connective <and>`. | ||
|
||
The output sentence value is verified if every argument sentence value is verified. | ||
|
||
Examples | ||
-------- | ||
|
||
If ``in`` is a :doc:`relation <relations>`, ``arg0`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | ~Y in X) | ||
And ``arg1`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
~^X(X in X) | ||
Then the following expression: | ||
|
||
.. code-block:: | ||
and(arg0, arg1) | ||
Evaluates to the following verified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | ~Y in X) & ~^X(X in X) | ||
Additionally, the following expression: | ||
|
||
.. code-block:: | ||
and(arg0, <:^X^Y(X in Y & Y in X)>, <:^E*X(~X in E)>) | ||
Evaluates to the following unverified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | Y in X) & ^X^Y(X in Y & Y in X) & ^E*X(~X in E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Built-in Functions | ||
================== | ||
|
||
There are a few built-in functions for manipulating :ref:`expression values <expressionvalues>` in CORE. Each built-in function expression begins with an identifier followed by a ``(`` character. A built-in function expression term evaluates to the output of the function. You can determine the behavior of the built-in functions in the documents below. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
left <left> | ||
right <right> | ||
and <and> | ||
or <or> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
left | ||
==== | ||
|
||
The built-in function ``left`` accepts one :ref:`sentence expression value <sentencevalue>` and returns the left-hand side of the sentence. It's precise behavior depends on the input value. | ||
|
||
Syntax | ||
------ | ||
|
||
.. code-block:: | ||
left([sentence argument expression]) | ||
Behavior | ||
-------- | ||
|
||
If the argument does not evaluate to a sentence expression value or the argument sentence has unbound objects or propositions, an error is raised. | ||
|
||
The following lists the behavior of the function depending on the argument sentence type: | ||
|
||
- If the argument sentence is of the form ``A & B``, then the output is the sentence ``A``. The output is verified if and only if the argument sentence is verified. | ||
- If the argument sentence is of the form ``A | B``, then the output is the sentence ``A``. The output is unverified. | ||
- If the argument sentence is of the form ``A -> B``, then the output is the sentence ``A``. The output is unverified. | ||
- If the argument sentence is of the form ``A <-> B``, then the output is the sentence ``B -> A``. The output is verified if and only if the argument sentence is verified. | ||
- If the argument sentence is not any of these types, an error is raised | ||
|
||
.. note:: | ||
Since this function's output depends on the association of the operations composing the argument sentence which normally doesn't matter, this function's use is not recommended. Oftentimes this function's purpose is overshadowed by :ref:`trivial implication <trivialimplication>` and :doc:`variable assignment <assign>`. | ||
|
||
Examples | ||
-------- | ||
|
||
If ``X`` and ``Y`` are objects, ``<`` is a relation, the output of the following expression: | ||
|
||
.. code-block:: | ||
left(<: X < Y & Y < X>) | ||
Is the unverified sentence: | ||
|
||
.. code-block:: | ||
X < Y | ||
If ``X`` is an object, ``empty`` is a :doc:`definition <define>`, ``in`` is a :doc:`relation <relations>`, and ``test`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
^E(empty(E) & E in X) & ~X in X | ||
Then the output of the following expression: | ||
|
||
.. code-block:: | ||
left(test) | ||
Is the verified sentence: | ||
|
||
.. code-block:: | ||
^E(empty(E) & E in X) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
or | ||
=== | ||
|
||
The built-in function ``or`` accepts one or more :ref:`sentence expression values <sentencevalue>` and returns a sentence which links each argument sentence using the ``|`` :ref:`connective <or>`. | ||
|
||
Syntax | ||
------ | ||
|
||
.. code-block:: | ||
or([sentence argument expression], ...) | ||
Behavior | ||
-------- | ||
|
||
``or`` accepts one or more argument expressions. If any argument expression does not evaluate to a :ref:`sentence expression value <sentencevalue>` or any argument sentence has unbound objects or predicates, then an error is raised. Otherwise, the output is a sentence composed of each argument sentence joined in order using the ``|`` :ref:`connective <and>`. | ||
|
||
The output sentence value is verified if at least one argument sentence value is verified. | ||
|
||
Examples | ||
-------- | ||
|
||
If ``in`` is a :doc:`relation <relations>`, ``arg0`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | ~Y in X) | ||
And ``arg1`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
~^X(X in X) | ||
Then the following expression: | ||
|
||
.. code-block:: | ||
or(arg0, arg1) | ||
Evaluates to the following verified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | ~Y in X) | ~^X(X in X) | ||
Additionally, the following expression: | ||
|
||
.. code-block:: | ||
or(arg0, <:^X^Y(X in Y & Y in X)>, <:^E*X(~X in E)>) | ||
Evaluates to the following verified sentence: | ||
|
||
.. code-block:: | ||
*X*Y(~X in Y | Y in X) | ^X^Y(X in Y & Y in X) | ^E*X(~X in E) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
right | ||
===== | ||
|
||
The built-in function ``right`` accepts one :ref:`sentence expression value <sentencevalue>` and returns the right-hand side of the sentence. It's precise behavior depends on the input value. | ||
|
||
Syntax | ||
------ | ||
|
||
.. code-block:: | ||
right([sentence argument expression]) | ||
Behavior | ||
-------- | ||
|
||
If the argument does not evaluate to a sentence expression value or the argument sentence has unbound objects or propositions, an error is raised. | ||
|
||
The following lists the behavior of the function depending on the argument sentence type: | ||
|
||
- If the argument sentence is of the form ``A & B``, then the output is the sentence ``B``. The output is verified if and only if the argument sentence is verified. | ||
- If the argument sentence is of the form ``A | B``, then the output is the sentence ``B``. The output is unverified. | ||
- If the argument sentence is of the form ``A -> B``, then the output is the sentence ``B``. The output is unverified. | ||
- If the argument sentence is of the form ``A <-> B``, then the output is the sentence ``A -> B``. The output is verified if and only if the argument sentence is verified. | ||
- If the argument sentence is not any of these types, an error is raised | ||
|
||
.. note:: | ||
Since this function's output depends on the association of the operations composing the argument sentence which normally doesn't matter, this function's use is not recommended. Oftentimes this function's purpose is overshadowed by :ref:`trivial implication <trivialimplication>` and :doc:`variable assignment <assign>`. | ||
|
||
Examples | ||
-------- | ||
|
||
If ``X`` and ``Y`` are objects, ``<`` is a relation, the output of the following expression: | ||
|
||
.. code-block:: | ||
right(<: X < Y & Y < X>) | ||
Is the unverified sentence: | ||
|
||
.. code-block:: | ||
Y < X | ||
If ``X`` is an object, ``empty`` is a :doc:`definition <define>`, ``in`` is a :doc:`relation <relations>`, and ``test`` stores the verified sentence: | ||
|
||
.. code-block:: | ||
^E(empty(E) & E in X) & ~X in X | ||
Then the output of the following expression: | ||
|
||
.. code-block:: | ||
right(test) | ||
Is the verified sentence: | ||
|
||
.. code-block:: | ||
~X in X | ||