SatisfyingSetScopeLink

From OpenCog
Jump to: navigation, search

The SatisfyingSetScopeLink can be seen as a concept constructor. That is, when used with an EquivalenceLink, it allows ConceptNodes to be defined. Formally, it is syntactic sugar for a SatisfyingSetLink wrapping a ScopeLink: it allows explicit variable declarations to be specified.

Formats

SatisfyingSetScopeLink inherits ScopeLink, and thus, like most scope links, it follows the following formats

SatisfyingSetScopeLink
  <vardecl>
  <body>

or

SatisfyingSetScopeLink
  <body>

When this second format is use, i.e. when there are no explicit variable declarations, then all of the free variables in the <body> are bound to the SatisfyingSetScopeLink.

Semantics

SatisfyingSetScopeLink is merely syntactic sugar for

SatisfyingSetLink
  ScopeLink
    <vardecl>
    <body>

In spirit the SatisfyingSetScopeLink is very close to the GetLink, except that the SatisfyingSetScopeLink is declarative, and GetLink is imperative. That is, the execution of GetLink can be forced by calling the cog-execute! function, which then returns a SetLink of all of the items currently in the AtomSpace that satisfy it.

In its most common, frequent usage, SatisfyingSetLink is used with an EvaluationLink; it will connects a PredicateNode to a ConceptNode, by means of an EquivalenceLink. See the section on EquivalenceLink, below. Since satisfying sets are sets, their members can be declared with the MemberLink.

Because all atoms in the AtomSpace carry a truth value, the concept of a predicate in OpenCog is more general than that of a predicate in first-order logic. it is more closely akin to an characteristic function in probability theory, or a classifying topos in mathematical logic.

Example

An example:

 SatisfyingSetScopeLink
   EvaluationLink
     PredicateNode "breathe"
     ListLink
       VariableNode "$X"
       ConceptNode "air"

specifies the indicator function "things $X that breathe air". The use of the SatisfyingSetScopeLink here indicates that variable $X occuring in the EvaluationLink is the bound variable for this expression. This then allows set membership to be indicated as follows:

 MemberLink
   ConceptNode "animals"
   SatisfyingSetScopeLink
     EvaluationLink
       PredicateNode "breathe"
       ListLink
         VariableNode "$X"
         ConceptNode "air"

which states that "animals" belong to the set of "things $X that breath air". The above can be understood to be a beta redex, and, by applying beta-reduction, it can be reduced to the much smaller and simpler constant expression:

  EvaluationLink
     PredicateNode "breathe"
     ListLink
       ConceptNode "animals"
       ConceptNode "air"

which just states that "animals breath air".

Note that MemberLinks resemble PutLinks in reverse order. The PutLink is the normal way of writing a beta redex in the AtomSpace; it is imperative, whereas the MemberLink is declarative. Thus,

 PutLink
   SatisfyingSetScopeLink
     EvaluationLink
       PredicateNode "breathe"
       ListLink
         VariableNode "$X"
         ConceptNode "air"
   ConceptNode "animals"

when reduced, will give the EvaluationLink above.

Equivalence to ConceptNode

The above example is equivalent to the

 ConceptNode "the-set-of-all-things-that-breathe-air"

This equivalence can be made formal by using the EquivalenceLink: by asserting that the following is true:

 EquivalenceLink
   ConceptNode "the-set-of-things-that-breath-air"
   SatisfyingSetScopeLink
     EvaluationLink
       PredicateNode "breathe"
       ListLink
         VariableNode "$X"
         ConceptNode "air"


This defines a new ConceptNode "the-set-of-things-that-breath-air" in terms of two previously existing ConceptNodes: those for "breath" and "air".

PLN semantics

The PLN semantics is derived from the fact that it is a syntactic sugar of

SatisfyingSetLink
  ScopeLink
    <vardecl>
    <body>

For instance consider again the example above, this time with explicit truth values indicated:

 EquivalenceLink
   ConceptNode "the-set-of-things-that-breath-air" <TV1>
   SatisfyingSetScopeLink <TV2>
     EvaluationLink
       PredicateNode "breathe"
       ListLink
         VariableNode "$X"
         ConceptNode "air"

In the PLN interpretation, one has that <TV1> == <TV2> and that both truth values are small, given that most things don't breath. Very roughly, <TV> == "probability that something breaths air", which is low. To get high probabilities, use the ContextLink; the Contextlinks provide a way of encoding conditional probabilities; thus P(breathes air | animal) = 1.0; that is, the probability that something breathes air, conditioned on the prior that it is an animal, is 1.0, since all animals breathe air.

Variable declarations

At this time the declaratively-equivalent GetLink allows explicit variable declarations and type restrictions.

Thus, for example, the following declares that the variable $X is not only bound, but that it's type must be restricted only to ConceptNodes.

  SatisfyingSetLink
       TypedVariableLink
            VariableNode $X
            TypeNode "ConceptNode"
       InheritanceLink 
            VariableNode $X 
            ConceptNode Famous@45678

Related links