AbsentLink

From OpenCog
Jump to: navigation, search

The AbsentLink is a kind of virtual link that can be used to declare the absence of it's target in the AtomSpace during a pattern match search. It is the intuitionistic logic (Wikipedia,Stanford) form of NotLink; it can be thought of as a kind-of "don't know" or "unknown" or "unproven" link (because the AtomSpace contains no knowledge about the thing that its absent, its essentially "not known").

Roughly speaking, in intuitionistic logic or constructive logic, the opposite of "true" is not "false", the opposite of true is "don't know". Thus, AbsentLink can be used to declare a "don't know" state, or an "absent" state.

There is a difference between it and NotLink. The AbsentLink says: "this sub-pattern should not be present in the atomspace", while NotLink says "this evaluatable expression should be false"; the targets of the NotLink are usually virtual links or GPNs.

It is used during pattern matching to find clauses that may or may not be present: clauses that are optionally present. The AbsentLink should be contrasted to the PresentLink, which evaluates to true only when the indicated terms are present in the atomspace (can be grounded in the atomspace). See link comparison for other related links.

Conceptually, one might think that AbsentLink is equivalent to (NotLink (PresentLink ...)) but, in terms of the difficulty of the actual implementation, its not really. The code needed to negatively affirm presence is more difficult to implement than the code to positively affirm absence. It is the difficulty of the implementation that is driving this subtle distinction. In particular, AbsentLink is fully supported in the pattern matcher, but (NotLink (PresentLink ...)) is broken -- (NotLink (PresentLink AtomX)) works great if AtomX does exist, but fails when AtomX does not.

Because the AbsentLink can be understood to have a true/false value, depending on whether it is groundable or not, it can be thought of as a "clear-box" virtual link. Because, when evaluated, it takes on a crisp boolean true/false value, it can be combined with AndLink, OrLink and NotLink to create arbitrarily complex expressions. This is possible because the AbsentLink does NOT bind its variables: they remain free and "leak out" of the link.

Thus for example, in the below, the term $x is the same variable in both terms.

OrLink
   AbsentLink
         InheritanceLink
             VariableNode $x
             ConceptNode "plant"
   GreaterThanLink
         VariableLink $x
         NumberNode 42

which states that either the Variable $x is not a kind-of plant (because the InheritcanceLink is not groundable, has no solution in the atomspace) or that it is (a number) greater than 42.

See also