[][src]Module zamm_yin::concepts

Object-oriented representations of nodes as first-class individuals, as opposed to merely being one of many components of a knowledge-base.

The wrappers module provides additional low-level capabilities for nodes, above and beyond those of regular graphs. This module abstracts away those low-level capabilities and greatly cuts down on the possibilities, in exchange for offering much stronger compile-time checks on which edge-node combinations are semantically meaningful.

Do not mistake the map for the territory. Concepts are the map that tells you how to interact with the territory of the actual data structures that they point to.

Examples

We need to choose which graph implementation to ground our knowledge and reasoning on. All implementations should be logically equivalent. Let's use the in-memory one for simplicity:

use zamm_yin::graph::bind_in_memory_graph;

bind_in_memory_graph();

Now, we can create a new concept:

use zamm_yin::concepts::{Tao, ArchetypeTrait, FormTrait};

let mut concept = Tao::individuate();
assert!(concept.has_ancestor(Tao::archetype()));

We can set a name for this concept. Note that names don't need to be unique.

use zamm_yin::node_wrappers::CommonNodeTrait;
use std::rc::Rc;

concept.set_internal_name("A".to_string());
assert_eq!(concept.internal_name(), Some(Rc::new("A".to_string())));

Modules

attributes

Contains all attribute archetypes.

Structs

Archetype

Represents an archetype from which various individual nodes can be derived.

Tao

The Tao that can be made into a struct is not the eternal Tao.

Constants

YIN_MAX_ID

The maximum concept ID inside the types distributed by Yin itself. App-specific type concepts should continue their numbering on top of this.

Traits

ArchetypeTrait

All formally defined archetypes should be describable by these properties.

FormTrait

All forms are derived from archetypes. All forms, by their very existence, are capable of the following interactions.