|
Posted: May 8, 2013 |
[ # 46 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
Of course not, unless such a “module” was created to deal with one specific puzzle of that nature. To write discrete code for, say a dozen such puzzles would take an AIML master (of which I am NOT) quite a while to do. Far better would be a deduction/inference engine that could process the information given for any number of logic problem, arrive at the correct conclusions, and then pass these conclusions (in some form of “coded” format) to the AIML interpreter for output. That, I’m afraid, does not yet exist.
It would be fun to have, though, wouldn’t it?
|
|
|
|
|
Posted: May 8, 2013 |
[ # 47 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
I had a closer look at some simple puzzles like this. This is one I made up:
1 - John and Joe have two toys, a bike and a car
2 - Joe has a red toy
3 - The yellow toy is a bike
Who has what?
The bot could form associations and remove the options as it works them out.
It would use the following steps.
1 - John and Joe have two toys, a bike and a car.
John has a bike/car
Joe has a bike/car
2 - Joe has a red toy
John has a bike/car
Joe has a red bike/car
3 - The yellow toy is a bike
John has a yellow bike
Joe has a red car
I see this more as a programming challenge rather than a feature of the language itself I would say. Obviously, this is just a simple example but you see what I mean?
|
|
|
|
|
Posted: May 8, 2013 |
[ # 48 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
Yes, I do, but I’m thinking that added layers of complexity will quickly turn things ugly, and it’s almost impossible to write a single AIML category (or even a group of them, within the topic of LOGIC PROBLEM) to handle a wider range of puzzles within the genre. For example, think about the coding nightmare that the following logic problem would present:
Five of Mr. Carroll’s history students each gave an oral presentation today on a different Roman Emperor. Match each student to their emperor and grade, and determine the length of each presentation.
Below are all categories and options used in this puzzle.
Lengths:
6 minutes
8 minutes
10 minutes
12 minutes
14 minutes
Names
Faye
Leroy
Rudy
Teri
Vickie
Emperors
Galerius
Licinius
Nero
Severus
Valerian
Grades
A
B+
B-
C+
C-
Initial Data:
1.) Of the student who got the A and the presenter who spoke for 14 minutes, one was Vickie and the other talked about Nero.
2.) The student who got the C- spoke 2 minutes less than the presenter who got the C+.
3.) The student who got the C+ talked about Galerius.
4.) The presenter who got the C+, Vickie and the student who spoke for 12 minutes were all different students.
5.) Rudy got the B-.
6.) Vickie talked about Licinius.
7.) Faye didn’t talk about Valerian.
8.) Teri spoke for 14 minutes.
9.) Faye got the C-.
10.) The presenter who spoke for 10 minutes didn’t get the C+.
Like I said… Ugly.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 49 ]
|
|
Guru
Total posts: 1081
Joined: Dec 17, 2010
|
Steve Worswick - May 8, 2013:
I see this more as a programming challenge rather than a feature of the language itself I would say. Obviously, this is just a simple example but you see what I mean?
Do you think this kind of problem might be easier in languages that had a “while” construct?
Dave’s puzzle site describes this type of puzzle as a logic grid. I would think that this may be able to be coded in a straight forward way, I ‘ll have to think about it, it reminds me of solving Sudoku problems.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 50 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
You can create your own “while” categories in AIML using the condition tag like so:
<condition name="check"> <li value="TRUE"><srai>ENDLOOP</srai></li> <li value="FALSE"><srai>do whatever</srai></li> </condition>
|
|
|
|
|
Posted: May 8, 2013 |
[ # 51 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
You see? This is why you’re an AIML Master, while I’m just a lowly Journeyman.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 52 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
Trying to code your puzzle 4 posts above would still scare me to death though!
|
|
|
|
|
Posted: May 8, 2013 |
[ # 53 ]
|
|
Moderator
Total posts: 206
Joined: Jul 1, 2009
|
There is a looping construct in AIML 2.0.
Sample dialog:
Human: Count to 14
Robot: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
<category><pattern>COUNT TO <set>number</set></pattern> <template> <think> <set name="count">0</set> </think> <condition name="count"> <li><value><star/></value></li> <li><set name="count"><map><name>successor</name><get name="count"/></map></set> <loop/></li> </condition> </template> </category>
For more information about the loop tag, see https://docs.google.com/document/d/1wNT25hJRyupcG51aO89UcQEiG-HkXRXusukADpFnDs4/pub Section 6n.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 54 ]
|
|
Moderator
Total posts: 206
Joined: Jul 1, 2009
|
Dave Morton - May 8, 2013: Yes, I do, but I’m thinking that added layers of complexity will quickly turn things ugly, and it’s almost impossible to write a single AIML category (or even a group of them, within the topic of LOGIC PROBLEM) to handle a wider range of puzzles within the genre. For example, think about the coding nightmare that the following logic problem would present:
Five of Mr. Carroll’s history students each gave an oral presentation today on a different Roman Emperor. Match each student to their emperor and grade, and determine the length of each presentation.
Below are all categories and options used in this puzzle.
Lengths:
6 minutes
8 minutes
10 minutes
12 minutes
14 minutes
Names
Faye
Leroy
Rudy
Teri
Vickie
Emperors
Galerius
Licinius
Nero
Severus
Valerian
Grades
A
B+
B-
C+
C-
Initial Data:
1.) Of the student who got the A and the presenter who spoke for 14 minutes, one was Vickie and the other talked about Nero.
2.) The student who got the C- spoke 2 minutes less than the presenter who got the C+.
3.) The student who got the C+ talked about Galerius.
4.) The presenter who got the C+, Vickie and the student who spoke for 12 minutes were all different students.
5.) Rudy got the B-.
6.) Vickie talked about Licinius.
7.) Faye didn’t talk about Valerian.
8.) Teri spoke for 14 minutes.
9.) Faye got the C-.
10.) The presenter who spoke for 10 minutes didn’t get the C+.
Like I said… Ugly.
It’s worth considering that it would not be easy to solve this kind of problem—especially not in a general way—using ANY known programming language, even the ones that support logical deduction and reasoning. You could solve this puzzle in Prolog for example, but it would still be a long tedious coding exercise.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 55 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
Steve Worswick - May 8, 2013: Trying to code your puzzle 4 posts above would still scare me to death though!
lol, that’s sort of my point, and that particular puzzle is considered to be an “easy” one.
|
|
|
|
|
Posted: May 8, 2013 |
[ # 56 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
@Rich:
First, thanks for the info regarding the <loop> tag. That’s going to prove useful in a lot of ways, I think.
Secondly, I agree that solving this sort of puzzle is difficult to impossible in the overwhelming majority of programming languages. I was simply pointing out that there are still some challenges in store for those of us who are trying to “tackle the AI problem”. I think this is one small part of why Marvin grew into a “paranoid android”.
|
|
|
|
|
Posted: May 9, 2013 |
[ # 57 ]
|
|
Senior member
Total posts: 308
Joined: Mar 31, 2012
|
So are you still referring to them as “Chatbots”, conversationalists, Digital Assistants or what?
I would think that the vast majority of people would never have reason to pose such puzzles to their computers / chatbots or whatever you call them. Interesting for even a Turing or other mental physics event but for the average user(s), I really think not. Heck, I know a lot of people who couldn’t figure it out!
How can your program (bot) best acquire new knowledge without having it “programmed” by the botmaster? I know this question has been posed and pondered in the past and I’m also aware that Steve Worswick has worked on a “learnable” routine for say, Mitsuku. How could that be reliably expanded to other areas of learning within the bot(s)?
A friend recently told me that all those bots are simply “Pattern Matchers” and nothing more! I told him that we humans do exactly the same thing every day. We see a familiar object (it’s pattern), we quickly recall it and decide on an appropriate “match” for it. After I told him this is done countless times each day, he thought about it for a few minutes then agreed but said, “Yeah, but they still can’t think on their own!” I replied, “Perhaps, but I know a lot of people who share that same dilemma!”
Give ‘em time…it’ll come.
|
|
|
|
|
Posted: May 9, 2013 |
[ # 58 ]
|
|
Senior member
Total posts: 473
Joined: Aug 28, 2010
|
Actually these sorts of problems are fairly easy to solve if you can enumerate all possible solutions and then test them against the constraints to see which one(s) are consistent and which ones are a contradiction. In the example above there are only four variables with five values each so you would only have to examine 625 distinct possible solutions. Even a human could do it with pencil and paper if they were keen enough!
They come under the category of Constraint Satisfaction Problems and there has been an enormous amount of research done in this area. They only become difficult when there are large numbers of variables involved because they are NP-complete in terms of their complexity. The most famous example is called the Travelling Salesman Problem.
If the constraints are expressed as statements in First Order Logic (which should be easy for someone practised in knowledge base development, not me, yet, but I’m learning as fast as I can) then it practically becomes trivial in any language that has a library for logical resolution such as Common Lisp or Prolog.
http://en.wikipedia.org/wiki/Boolean_satisfiability_problem
|
|
|
|
|
Posted: May 9, 2013 |
[ # 59 ]
|
|
Experienced member
Total posts: 92
Joined: Apr 24, 2012
|
Andrew Smith - May 9, 2013: In the example above there are only four variables with five values each so you would only have to examine 625 distinct possible solutions. Even a human could do it with pencil and paper if they were keen enough!
No there is (5!) ^ 4 solutions = 207360000 you need a large paper
Like the order of solutions isn’t important, you can limit to (5!) ^ 3 = 1728000
|
|
|
|
|
Posted: May 9, 2013 |
[ # 60 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
As Art says though, who is going to ask a chatbot this sort of puzzle?
|
|
|
|