Add to the pattern

  (InheritanceLink
                 (VariableNode "$color")
                 (ConceptNode "Color")
        )

and
InheritanceLink
                 (ConceptNode "British")
                 (VariableNode "$man")
       )


On Wed, Jul 6, 2016 at 3:12 AM, Gaurav Gautam <[email protected]> wrote:

> Hello,
>
> As far as I understand, the optional variables list in BindLink can be
> filled with TypedVariableLinks
> whereupon only nodes of that type are used to ground that variable.
>
> I want to know what I should do if I want to ground a pattern with
> particular types of InheritanceLinks instead of
> particular types of nodes. Do I have to write the code to do such things
> or does it exist already? Is this even possible?
> I realize this is vague so I am providing an example program that I want
> to make work.
>
> I have a scheme program below that has a BindLink, which has two variables
> $man and
> $color. I want to make cog-bind! look for InheritanceLinks in atomspace
> and ground $color with those
> links that have the base ConceptNode "Color"(namely C1). And similarly I
> want it to ground the $man with the
> appropriate InheritanceLink(namely P1).
>
> (define C1
>         (InheritanceLink
>                  (ConceptNode "Red")
>                  (ConceptNode "Color")
>         )
> )
>
> (define C2
>        (ConceptNode "Blue")
> )
>
> (define P1
>        (InheritanceLink
>                  (ConceptNode "British")
>                  (ConceptNode "Man")
>        )
> )
>
> (define question
>        (BindLink
>
>               ;Variable list
>               (What do I put here to only match only P1 with "$man" and C1
> with "$color"?)
>
>               ;Pattern
>               (EvaluationLink (stv 1 1)
>                        (PredicateNode "LivesIn")
>                        (ListLink
>                                 (VariableNode "$man")
>                                 (VariableNode "$color")
>                        )
>                )
>
>                ;Return Value
>                (EvaluationLink (stv 1 1)
>                        (PredicateNode "CanLiveIn")
>                        (ListLink
>                                 (VariableNode "$man")
>                                 (VariableNode "$color")
>                        )
>                )
>        )
> )
>
> (cog-bind! question)
>
> 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/08cbd232-9817-4753-b7ad-217b4de61e5b%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/08cbd232-9817-4753-b7ad-217b4de61e5b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHrUA347zFcco9ooq1u60c8Or6yxX2aqcUwisuEwpkVeJDxZYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to