OrderedLink and UnorderedLink

From OpenCog
(Redirected from OrderedLink)
Jump to: navigation, search

UnorderedLink and OrderedLink are base Link types. Generally these link types will not show up in the AtomSpace, but all non-abstract link types either inherit from OrderedLink or UnorderedLink.

OrderedLinks ensure that the first atom in their outgoing set maintains it's position, and is known as the source (which can be checked with Link::isSource(Handle h)). Currently, OrderedLinks also maintain the strict ordering of the outgoing set when set. UnorderedLinks on the other hand sort their outgoing set, so don't maintain the order. UnorderedLinks also consider any atom in the outgoing set to be a source.

Example of a abstract link type that doesn't inherit from these is the HebbianLink. These are generally link classes that are not meant to be created within the AtomSpace, but allow for grouping similar links. In this case, all HebbianLinks, e.g. symmetric, asymmetric, and inverse HebbianLinks.