[pandorabots-general] conditional based on a predicate

Dr. Rich Wallace drwallace at alicebot.org
Mon Aug 14 13:15:30 PDT 2006


Ron, if you take a look in the AIML AAA set, http://www.alicebot.org/aiml/aaa

there is an example that begins in the Pickup.aiml file:


<category> <pattern>*</pattern>
<template> <srai>RANDOM PICKUP LINE</srai>
<think>
<set name="it"> <set name="topic"> <person/>  </set> </set>
<srai>PUSH <get name="topic"/></srai>
</think>
</template>
</category>
<category> <pattern>RANDOM PICKUP LINE</pattern>
<template>
<random>
<li><srai>HAS INQUIRY <get name="has"/></srai></li>
<li><srai>DOES INQUIRY <get name="does"/></srai></li>
<li><srai>GENDER INQUIRY <get name="gender"/></srai></li>
<li><srai>COLOR INQUIRY <get name="favcolor"/></srai></li>
<li><srai>MOVIE INQUIRY <get name="favmovie"/>?</srai></li>
<li><srai>LOCATION INQUIRY <get name="location"/></srai></li>
...

The first few random pickup lines listed inside the <random> tag here
are designed to match categories with special patterns in the
Inquries.aiml file.  The basic idea behind GENDER INQUIRY * for example,
is to test whether the value of the predicate "gender" has been bound, and
if not, inquire about the client's gender.  Once the client's gender is
known, we want the bot to stop asking that question.

<category><pattern>GENDER INQUIRY OM</pattern><template>Are you a man or a
woman?</template></category>
<category><pattern>GENDER INQUIRY *</pattern><template>Do you like being a
<star/>?</template></category>

The AIML code here assumes that the default value of "gender" is OM.

Rich Wallace

> I find with long conversations my bot often asks a few
> questions that it should already "know" the answer
> too, for example asking "how old are you" when the
> client indicated their age only a few questions prior.
>
> Does anybody have an example of a conditional
> statement in aiml to turn a response on or off based
> on whether a client predicate has a value or not?
>
> For example if the bot already has a client age
> predicate with a value of 38, the bot would respond
> with "when is your birthday" instead of "how old are
> you", unless it already had a client predicate value
> for "birthday" in which case it would respond with,
> "what is new with you". But if the value for either
> age or birthday was empty then the bot would go ahead
> and ask "how old are you" or "when is your birthday".
>
> I think this would greatly enrich bot "intelligence",
> any help very much appreciated.
>
> thx,
>
> Ron
> _______________________________________________
> This is the pandorabots-general mailing list
> To Post, reply to pandorabots-general at list.pandorabots.com
> Unsubscribe and change preferences at
> http://list.pandorabots.com/mailman/listinfo/pandorabots-general
> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
> Learn to read at http://www.literacy.org/
>



More information about the pandorabots-general mailing list