I would like to be able to inherit properties of parent subjects. So for example, abilities of subjects are defined with the verb “can”. Given the facts:
CREATURE CAN BREATHE
BIRD IS CREATURE
BIRD CAN FLY
ROBIN IS BIRD
ROBIN CAN SING
I want to ask “Can a robin sing”, “Can a robin fly” and “Does a robin breathe?”
My pattern is:
#! Can a robin fly?
?: ([can do does] {a an the} _*1 _*1 _0?~NOUN _1?~VERB) ^noerase() ^repeat()
if(query(direct_s<vo _0 can _1)) {Yes} else {No}
My custom search is:
#1: tag member/is as 1. tag all words up from subject with 2. Queue the verb tagged 3. Queue the objects tagged 4.
#2: Use verb and object field facts from queued words.
#3: If the subject field of fact is taged with 2, the verb with a 3 and the object with a 4, we have a winner.
direct_s<vo 1’is.t_1’member.t_2s<1e_3vq_4oq:vo:s2_v3_o4
It seems to work generally but once in a while it seems to not work. I just wanted confirmation that the query seemed correctly formed and that there was not already a predefined query that might do what I explained above. It seems to work for the case “ROBIN CAN SING” but i would have expected to have to use ^query(direct_SVO _0 can _1) since the verb and object are not “up from” the subject. Can someone explain the “2s<1e” in my custom query expression? It means to queue everything “up from” the subject? Does the “1” mean everything up from the facts tagged with “1” or only go “up from” the tagged facts by “1 level”?
Being able to define custom queries is very powerful and sets Chatscript apart from other chatbot scripting platforms. I appreciate any feedback anyone has on using queries for deductive reasoning or for inferring specific facts from general facts.