Hello,

I was adding some things to the third lesson in Hands_On_With_OpenCog when 
I came across this. 
I have attached the guile script to this post so you can look at the whole 
thing.

I used cog-bind to perform a graph-rewrite to do the following:
1. Look for all atoms that are types of Animals
2. Create a new InheritanceLink to mark all such nodes as Pets

;The BindLink
(define rewrite 
    (BindLink
        ;Declare the variables [optional]
        (VariableNode "$denizen")
        ;Declare the pattern used to ground the variables
        (InheritanceLink
            (VariableNode "$denizen")
            (ConceptNode "Animal")
        )
        ;If a match is found for the pattern then we want
        ;to add the following hypergraph ot the Atomspace
        (InheritanceLink
            (VariableNode "$denizen")
            (ConceptNode "Pet")
        )
    )
)

The output of bind-link is as expected:
(SetLink
   (InheritanceLink
      (ConceptNode "fish")
      (ConceptNode "Pet")
   )
   (InheritanceLink
      (ConceptNode "dog")
      (ConceptNode "Pet")
   )
   (InheritanceLink
      (ConceptNode "cat")
      (ConceptNode "Pet")
   )
)

But when I run a cog-satisfying-set query to look for all pets in the 
Atomspace I find that a new Pet has been defined
with the name "$denizen".
The pattern I use for cog-satisfying-set is:
(define petnode
    (SatisfactionLink
        ;Declare varibales [optional]
        (VariableNode "$animal")
        ;The pattern that the variable must satisfy
        (InheritanceLink
            (VariableNode "$animal")
            (ConceptNode "Pet")
        )
    )
)

The output is:
(SetLink
   (ConceptNode "fish")
   (ConceptNode "dog")
   (ConceptNode "cat")
   (VariableNode "$denizen") <--- This is the thing I don't understand
)

Is this the expected behavior for bind-link? I thought that the "$denizen" 
VariableNode is never entering the Atomspace. Is this untrue?

Yours sincerely
Gaurav Gautam

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/620e1bc1-841e-4ae3-ad07-bc01294b06dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: helloPM.scm
Description: Binary data

Reply via email to