Skip to content

Sets and set operations in NAL

Pei Wang edited this page Jul 7, 2019 · 13 revisions

Sets and set operations allow the system to specify instances or properties of a concept, as well as to create compound terms, so as to express and derive more complex conclusions.

Compound Terms

In Basic Syllogistic Inference, each term is “atomic”, named by a word. For more complicated descriptions, compound terms are added to NAL.

Compound term (op c1, c2,..., cn) is a term formed by one or more terms c1, c2,..., cn, called its components, with an operator, op. The order of the components usually matters.
Each term in NARS has a syntactic complexity that is completely defined according to its internal structure: atomic terms (such as a word) have complexity value of 1, and a compound's complexity is the sum of the complexity values of its components plus 1 (for the operator).

Set Intersection Definitions

Extensional intersection: If T1 and T2 are different terms, their extensional intersection, (&, T1, T2), is a compound term defined by (∀x)(x --> (&, T1, T2)) ≡ ((x --> T1) ∧ (x --> T2))).
Example: “Ravens are black birds” can be represented as <raven --> (&, [black], bird)>, where the predicate term is an extensional intersection of the term [black] and the term bird, i.e., its extension is the intersection of the extensions of its components, and its intension is the union of the intensions of its components.

Intensional intersection: If T1 and T2 are different terms, their intensional intersection, (|, T1, T2), is a compound term defined by (∀x)(((|, T1, T2) --> x) ≡ ((T1 --> x) ∧ (T2 --> x))).
Example: "Dogs and cats are pets" can be expressed as <(|, dog, cat) --> pet>, where the subject term is an intensional intersection of the term dog and the term cat, i.e., its intension is the intersection of the intensions of its components, and its extension is the union of the extensions of its components.

Set Difference Definitions

Extensional Difference: If T1 and T2 are different terms, their extensional difference, (-, T1, T2), is a compound term defined by (∀x)((x --> (-, T1, T2)) ≡ ((x --> T1) ∧ ¬(x --> T2))).
Example: "Penguins are birds that cannot fly” can be represented as <penguin --> (-, bird, [flying])>, where the predicate term is an extensional difference of the term bird and the term [flying], i.e., its extension is the difference of the extensions of its components, and its intension is the intensions of its first component.
Intensional Difference: If T1 and T2 are different terms, their intensional difference, (~, T1, T2), is a compound term defined by (∀x)(((~, T1, T2) --> x) ≡ ((T1 --> x) ∧ ¬(T2 --> x)))
Example: "Dogs differ from the other pets by their loyalty" can be represented as <(~, dog, pet) --> [loyal])>, where the subject term is an intensional difference of the term dog and the term pet, i.e., its intension is the difference of the intensions of its components, and its extension is the extensions of its first component.

Product and relational term

For two terms T1 and T2, their product (*, T1, T2) is a compound term defined by ((*, S1, S2) --> (*, P1, P2)) ≡ ((S1 --> P1) ∧ (S2 --> P2)). This definition can be extended to allow more than two components in a product.
A relation is a term R such that there are other terms T1 and T2 satisfying (*, T1, T2) --> R or R --> (*, T1, T2)”.
Example: “Acid and base neutralize each other” can be represented as <(*, acid, base) --> neutralization>, and “Neutralization happens between acid and base” can be represented as <neutralization --> (*, acid, base)>.

visit #nars (more active) and ##nars on FreeNode

Clone this wiki locally