[alicebot-archcomm] <that> when

Kim Sullivan alicebot-archcomm@list.alicebot.org
Thu, 24 Jan 2002 02:38:49 +0100


> 1) Does the value of <that> change during a srai?
> 2) Should AIML allow the AIML author to change the value of <that> (as a
> predicate with name "that")?
>
> For better or for worse, Program D 4.1.4 currently works like this:
>
> 1) <that> does *not* change during a srai.
> 2) The AIML author *is* allowed to change the value of <that>.

This seems quite a good solution. If a botmaster knows that he encounters a
loop in a category, he can change the value of that to whatever he needs. It
should be understood, that this change of "that" should only be temporary,
in the scope of processing one template (this includes all srais), but
should not propagate to the 'calling category', nor affect the general
dialog history (beforethat etc.).

The recent implementation by Jon Roewen uses a little different approach.
It's like a stack - the current value of <that> is pushed on the stack
before a <srai> to prevent loops, and after the srai returns the original
value is popped.

Maybe we need a mechanism for optionally pushing the value of <that> (maybe
the whole conversation history?) before a srai:
<srai that="">foo</srai>
<srai that="foobar">bar</srai>
<sr that=""/>

Since this relieves us of the cumbersome introduction of temporary variables
just to set <that> back to the value it was.

> 1) PROS of changing <that> during a srai:
>
> a. It becomes possible to "escape" from loops.
>
> I am not so comfortable with that scenario, but I think this is the kind
> of thing people have run into.

Actually, I think this is such a special case that it needs to be construced
on purpose, and doesn't need global handling of <that> & <srai>. I would
guess that finding 5 normal categories (from actual AIML sets, not
constructed to show the problem) that are subject to this problem would be
pretty hard. If the botmaster has such a category he probably knows about
it.


> CONS of allowing the AIML author to change the value of <that> (in
> general):
>
> a. The predictability problem mentioned above is the same.

As said, I think that an AIML author probably knows which specific category
is causing a loop, and has a pretty darn well picture of what's going to
happen if he changes it. Better to give the control to the BM, instead of
just doing something automatically.

> b. The original meaning of <that> gets left in the dust.  One might as
> well not say that <that> really has anything to do with context at all
> anymore, if its value can be manipulated at any time.  It just becomes a
> kind of special index always hovering within easy reach.

If the new value of <that> is discarded as soon as we leave the category (or
just after the <srai>), I don't think this will be a problem. Besides, the
change doesn't stay in effect, since <that> is set everytime one complete
response is processed an sent to the user.

Kim