atomspace icon indicating copy to clipboard operation
atomspace copied to clipboard

DualLink currently doesn't support rules that has only variables

Open leungmanhin opened this issue 9 years ago • 1 comments

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?

leungmanhin avatar Aug 12 '16 10:08 leungmanhin

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 ...

linas avatar Aug 13 '16 01:08 linas