Relations are the verbs of the knowledge system. They connect subjects to objects and determine how vectors are combined during encoding. This page explains how relations work geometrically, lists the built-in relation types, and describes how to define custom verbs.

How Relations Work

v(Subject) "Dog" v(Object) "Animal" π(Relation) IS_A permutation π(v(Object)) Permuted + Fact encode(S, R, O) = v(S) + π_R(v(O))

Encoding a fact: The object vector is permuted according to the relation, then added to the subject vector with saturating arithmetic. Different relations use different permutations, keeping the dimensionality fixed while encoding role information.

Each relation has a unique permutation table that reorders vector dimensions. When encoding "Dog IS_A Animal", the system:

  1. Gets the base vector for "Dog"
  2. Gets the base vector for "Animal"
  3. Applies the IS_A permutation to "Animal"
  4. Adds the permuted vector to "Dog" with saturation

This produces a single point that represents the fact. See RelationPermuter for implementation details.

Relation Properties

Inverse Relations

Many relations have inverses. If A CAUSES B, then B CAUSED_BY A. Inverse relations use inverse permutations, so the encoding is consistent in both directions.

Symmetric Relations

Some relations are symmetric: SIMILAR_TO is the same in both directions. Symmetric relations reuse the same permutation for both subject and object roles.

Transitive Relations

Relations like IS_A support transitivity: if Dog IS_A Mammal and Mammal IS_A Animal, then Dog IS_A Animal. The Reasoner handles transitivity through chain checking.

Built-in Relations

Taxonomic Relations

RelationInverseMeaningExample
IS_A HAS_INSTANCE Type/class membership Dog IS_A Animal
PART_OF HAS_PART Mereological containment Wheel PART_OF Car
SUBCLASS_OF SUPERCLASS_OF Class hierarchy Mammal SUBCLASS_OF Animal

Causal Relations

RelationInverseMeaningExample
CAUSES CAUSED_BY Direct causation Fire CAUSES Smoke
ENABLES ENABLED_BY Precondition Key ENABLES Door_Opening
PREVENTS PREVENTED_BY Inhibition Vaccine PREVENTS Disease

Spatial Relations

RelationInverseMeaningExample
LOCATED_IN CONTAINS Spatial containment Paris LOCATED_IN France
NEAR NEAR Proximity (symmetric) Library NEAR School
ABOVE BELOW Vertical position Sky ABOVE Ground

Temporal Relations

RelationInverseMeaningExample
BEFORE AFTER Temporal ordering Monday BEFORE Tuesday
DURING CONTAINS_TEMPORALLY Temporal containment Meeting DURING Morning
OVERLAPS OVERLAPS Partial overlap (symmetric) Event1 OVERLAPS Event2

Deontic Relations

RelationInverseMeaningExample
PERMITS PERMITTED_BY Permission License PERMITS Driving
PROHIBITS PROHIBITED_BY Prohibition Law PROHIBITS Theft
OBLIGATES OBLIGATED_BY Obligation Contract OBLIGATES Payment
REQUIRES REQUIRED_BY Requirement Driving REQUIRES License

Property Relations

RelationMeaningExample
HAS_PROPERTY Attribute assignment Water HAS_PROPERTY liquid
HAS_VALUE Numeric value Water HAS_VALUE temp=100
HAS_ATTRIBUTE Named attribute Car HAS_ATTRIBUTE color=red

Similarity Relations

RelationSymmetricMeaningExample
SIMILAR_TO Yes General similarity Dog SIMILAR_TO Wolf
DIFFERENT_FROM Yes Explicit distinction Cat DIFFERENT_FROM Dog

Custom Verbs

AGISystem2 supports defining custom relations beyond the built-in set. Custom verbs enable domain-specific knowledge representation.

Defining a Custom Verb

# In Sys2DSL
DEFINE_RELATION TREATS inverse=TREATED_BY transitive=false

# Usage
ASSERT Aspirin TREATS Headache
ASK "What TREATS Headache?"

Custom Verb Properties

PropertyDescriptionDefault
inverse Name of inverse relation None (unidirectional)
symmetric Same in both directions false
transitive Chains apply (A→B→C means A→C) false
permutation_seed Seed for deterministic permutation Hash of name

Domain Examples

# Medical domain
DEFINE_RELATION TREATS inverse=TREATED_BY
DEFINE_RELATION CONTRAINDICATED_WITH symmetric=true
DEFINE_RELATION METABOLIZED_BY inverse=METABOLIZES

ASSERT Aspirin TREATS Pain
ASSERT Aspirin CONTRAINDICATED_WITH Warfarin
ASSERT Aspirin METABOLIZED_BY Liver

# Legal domain
DEFINE_RELATION GOVERNS inverse=GOVERNED_BY
DEFINE_RELATION SUPERSEDES inverse=SUPERSEDED_BY transitive=true

ASSERT GDPR GOVERNS DataProcessing
ASSERT Regulation_2023 SUPERSEDES Regulation_2020

Natural Language Mapping

The Chat Interface maps natural language phrases to relations:

Natural LanguageRelation
"is a", "are", "is a type of"IS_A
"has", "contains", "includes"HAS_PART
"causes", "leads to", "results in"CAUSES
"is caused by", "comes from"CAUSED_BY
"is in", "located in"LOCATED_IN
"requires", "needs"REQUIRES
"allows", "permits"PERMITS
"prohibits", "forbids"PROHIBITS
"is before", "precedes"BEFORE
"is similar to", "is like"SIMILAR_TO

Geometric Interpretation

IS_A (nested) Animal Mammal Dog CAUSES (link) Fire Smoke SIMILAR_TO (proximity) Dog Wolf close

Different relations create different geometric patterns. IS_A creates nested regions (subsets). CAUSES creates directional links between separate regions. SIMILAR_TO implies proximity in the space.

Related Documentation