opencog / atomspace

The OpenCog (hyper-)graph database and graph rewriting system
https://wiki.opencog.org/w/AtomSpace
Other
826 stars 234 forks source link

DualLink currently doesn't support rules that has only variables #859

Open leungmanhin opened 8 years ago

leungmanhin commented 8 years ago

For example if we do

(use-modules (opencog) (opencog nlp aiml) (opencog openpsi) (opencog exec))

(psi-rule-nocheck
   ;; context
   (list (AndLink
      (Evaluation
         (Predicate "*-AIML-pattern-*")
         (ListLink
            (Glob "$star-1")
         ))
   )) ;TEMPLATECODE
   ;; action
   (ListLink
      (Word "hi")
   ) ; TEMPATOMICEND
   (Concept "AIML chat subsystem goal")
   (stv 1 3.07210617666411e-07)
   (psi-demand "AIML chat demand" 0.97)
)

; then execute
(cog-execute! (Dual (List (Word "ok"))))

will return an empty SetLink. Should DualLink be extended to support situations like this as well?

linas commented 8 years ago

Ugh. Maybe. I dunno. Such a thing would match everything, always, in all situations. Its a psi rule that will always be found. Because of that, you don't really have to search for it. If you just want to always do something, in all situations, it seems better just to hard-code that in...

I guess what you are trying to do is to choose one of the pickup lines, if no other psi rule triggered... I guess DualLink could be fixed to do that, I suppose ... as long as the fix is simple ...