The following dialog refers to the family tree shown in http://subbot.org/logicagent/dialog/familytree.png The dialog shows one way of encoding some of the information in the family tree. Then two questions are asked about the relations in the tree: Are X and Y siblings? Who is X's grandfather? (The last four interactions show how to create a synonymous expression; if "begat" is considered archaic, "had" can be substituted after directing the agent to rewrite "X and Y had Z" as "X and Y begat Z". The "logicbot: " directive followed by a Ruby if-then expression is used to write the directive.) A lot of information has to be input before the two questions can be answered. Also, the methods that handle the questions had to be hand-coded. So adding more information and more questions will require more hand-coding. Is there a way to automate the coding? --- C:\trane\logicagent>ruby logicbot.rb Hello I have loaded C:/trane/logicagent/logicagent-api.yaml. > Christopher married Penelope. Okay, Christopher married Penelope. > Christopher and Penelope begat Arthur. Okay, Christopher and Penelope begat Arthur. > Christopher and Penelope begat Victoria. Okay, Christopher and Penelope begat Victoria. > are Arthur and Victoria siblings? Yes, Arthur and Victoria are siblings. > Andrew married Christine. Okay, Andrew married Christine. > Andrew and Christine begat James. Okay, Andrew and Christine begat James. > Andrew and Christine begat Jennifer. Okay, Andrew and Christine begat Jennifer. > are James and Jennifer siblings? Yes, James and Jennifer are siblings. > are Arthur and Jennifer siblings? I don't think Arthur and Jennifer are siblings. > Victoria married James. Okay, Victoria married James. > Victoria and James begat Colin. Okay, Victoria and James begat Colin. > Victoria and James begat Charlotte. Okay, Victoria and James begat Charlotte. > are Colin and Charlotte siblings? Yes, Colin and Charlotte are siblings. > who is Colin's father? I don't know what Colin's father is. > Colin's father is Arthur Okay, Colin's father is Arthur. > who is Colin's father? Colin's father is arthur > Arthur's father is Christopher Okay, Arthur's father is Christopher. > who is Arthur's father? Arthur's father is christopher > who is Colin's grandfather? christopher > logicbot: if input =~ /(.* and .*) had (.*)/ then self.send("#{$1} begat #{$2}") end Okay I have added if input =~ /(.* and .*) had (.*)/ then self.send("#{$1} begat #{$2}") end. > Roberto and Maria had Emilio Okay, Roberto and Maria had Emilio. > Roberto and Maria begat Lucia Okay, Roberto and Maria begat Lucia. > are Emilio and Lucia siblings? Yes, Emilio and Lucia are siblings. >