EquivalenceLink
The EquivalenceLink is a type of Link that may be used for defining new predicates.
For instance given an InheritanceLink defining a relation between two concepts, and some existing predicate, the EquivalenceLink may be used to define a new predicate that refines the existing one. In that type of use one can think of EquivalenceLink as being similar to the define directive in scheme (or defun in lisp), in that it allows you to define a complex functional structure and give it a name.
The EquivalenceLink is a declarative version of DefineLink, which is imperative. That is, DefineLink is used by the pattern matcher as a beta redex, at the time that a pattern search is performed. An EquivalenceLink is used by PLN during reasoning. See the link comparison chart for other such correspondences.
The SatisfyingSetLink provides a simpler mechanism for giving a name to all of the atoms satisfying some formula.
The model theoretic understanding of an EquivalenceLink is that it gives a model-theoretic interpretation. That is, it provides a map between terms of one signature to those with another.
PLN semantics
In PLN an EquivalenceLink between 2 predicates is semantically equivalent to a SimilarityLink over the satifying sets of the predicates. So for instance the following 2 express the same thing
SimilarityLink <0.6, 0.9> ConceptNode: tall ConceptNode: adult
EquivalenceLink <0.6, 0.9> PredicateNode: is_tall PredicateNode: is_adult
Example
Suppose, for example, one has a relationship "PartOf": for example:
EvaluationLink PredicateNode: PartOf ListLink ConceptNode: battery ConceptNode: car
And suppose that one wanted to refine this notion of "PartOf" into "MechanicalPartOf", "ElectricalPartOf", "BodyPartOf". This refinement could be done by stating that
ImplicationLink PredicateNode: MechanicalPartOf PredicateNode: PartOf
and likewise for "ElectricalPartOf", "BodyPartOf", etc. But what is the meaning of "ElectricalPartOf"? How can we tell when something is an electrical part, or not? These questions can be answered by observing that we already know something about batteries, namely, we already know that
InheritanceLink ConceptNode: battery ConceptNode: electrical device
Thus, the definition of the new predicate "ElectricalPartOf" can be completed by saying "electrical parts are those parts that are electrical", by using the EquivalenceLink:
EquivalenceLink EvaluationLink ElectricalPartOf $X $Y AndLink InheritanceLink $X "electrical device" EvaluationLink PartOf $X $Y
The above is short-hand for the more verbose:
EquivalenceLink EvaluationLink PredicateNode: ElectricalPartOf ListLink VariableNode: $X VariableNode: $Y AndLink InheritanceLink VariableNode $X ConceptNode: "electrical device" EvaluationLink PredicateNode:PartOf ListLink VariableNode $X VariableNode $Y
DefineLink
Outside of PLN, but inside the pattern matcher, the DefineLink is used in a fashion similar to the EquivalenceLink. However, there are differences due to the implementation. The DefineLink moves the variable binding to the body of the definition. Thus, the above example would be written as:
DefineLink PredicateNode: ElectricalPartOf LambdaLink VariableList VariableNode: $X VariableNode: $Y AndLink InheritanceLink VariableNode $X ConceptNode: "electrical device" EvaluationLink PredicateNode:PartOf ListLink VariableNode $X VariableNode $Y
The LambdaLink is used to declare the variables that are to be associated with the predicate. The variable declaration is now a part of the definition of the PredicateNode, as opposed to being used in the EvaluationLink when the EquivalenceLink is used.
There are other differences: the EquivalenceLink can be used multiple times; however, the DefineLink can be used only once, to declare a meaning. Thus, in the above example, there can be only one definition
DefineLink PredicateNode: ElectricalPartOf ....
and the only way to redefine ElectricalPartOf would be to delete the above DefineLink first, and then create a new one. By contrast, EquivalenceLink can be used to create many, possibly conflicting definitions.
StateLink
The StateLink is similar to the DefineLink, in that it allows only one definition at a time; however, the definition can be changed at any time, without needing to explicitly perform a deletion first. One might say, with a StateLink, that the most recent definition is the one in effect; it is useful for storing time-varying state (just as it's name implies).