[alicebot-archcomm] <srai> stack
Gary Dubuque
alicebot-archcomm@list.alicebot.org
Sun, 2 Mar 2003 09:43:54 -0800
Then the proposal for the standards is that "stars are fixed at every level
of recursion". In the working draft of version 1.01 I believe that would be
included in section 7.1.1 Star and in 7.1.4 Thatstar and 7.1.5 Topicstar and
7.5.1 SRAI.
Respectifully,
Gary Dubuque
Listening for further comments
-----Original Message-----
From: alicebot-archcomm-admin@list.alicebot.org
[mailto:alicebot-archcomm-admin@list.alicebot.org]On Behalf Of Dr. Rich
Wallace
Sent: Saturday, March 01, 2003 8:44 AM
To: alicebot-archcomm@list.alicebot.org
Subject: Re: [alicebot-archcomm] <srai> stack
Program M says the stars are fixed at every level of recursion. A local
variable "environ", saved on the stack, stores the binding environment for
the stars at each call to Srai().
--- Srai:- "symbolic reduction" in AIML, also known as "syntactic rewrite",
--- "simple recursion", "stimulus-response" or "synonym resolution."
proc Srai(x, environ);
[client, stars, matchpath, depth] := environ;
topic := Normalize(Predicates(client, 'topic'));
thats := Predicates(client, 'thats');
if thats(1) /= om and #thats(1) > 0 then
that := Normalize(thats(1)(#thats(1)));
else that := 'Undefined';
end if;
x := Response(environ, x);
x := Normalize(x);
if x = om or x = '' then return ['You said nothing','']; end if;
input := x;
path := split(x+" that "+that+" topic "+topic, ' ');
stars := [];
matchpath := '';
result := [template, stars, matchpath];
Matchai(ROOT, path, 1, result);
[template, stars, matchpath] := result;
environ := [client, stars, matchpath, depth+1];
reply := Response(environ, template);
if reply = '' then
reply := 'I said nothing.';
end if;
reply ?:= 'I said OM.';
reply := Formalize(reply);
return [reply, matchpath];
end proc;
--- Response: top level AIML template evaluator.
proc Response(environ, remainder);
[client, stars, matchpath, depth] := environ;
prefix := '';
if depth < DeepestDepth then
environ := [client, stars, matchpath, depth+1];
while remainder /= '' loop;
remainder := Macroai(remainder); --- AIML Macro Substitutions
[result, remainder] := Tagai(environ, remainder); -- Process tag.
remainder := prefix + result + remainder; --- Recombine result.
remainder := Trimai(remainder);
prefix := span(remainder, templatechars); --- Advance to next '<'
end loop;
end if;
return prefix;
end proc;
> Gary Dubuque wrote:
>>
>> Implementation orientated, do stars nest through <srai> tags so when
>> you use them after </srai> they are from the current context and not
>> from the last match that took place, that is, not inherited?
>>
> Should be!
>
> Please see
>
http://list.alicebot.org/pipermail/alicebot-general/2002-December/007189.htm
l
>
> It has been fixed for ProgramD - look around near this thread:
>
http://list.alicebot.org/pipermail/alicebot-general/2002-December/007161.htm
l
> (the zip-links are invalid).
>
> The next release of ProgramV will be fixed too.
>
> Ernest
>
> --
> ProgramV - Alice on Perl - available at
> http://www.virtualitas.net/perl/aiml/
>
> VIRTUALITAS - Manufacturer of fine OOPPS - since 1996
> ********************************************************************* *
> VIRTUALITAS Inc. * http://www.virtualitas.net * *
> * * *
> European Consultant Office * * *
> Internationales Handelszentrum * * *
> Friedrichstraße 95 * contact:Ernest Lergon * *
> 10117 Berlin / Germany * mailto:Ernest@virtualitas.net *
> *********************************************************************
> PGP-Fingerprint 6E6F DC17 A886 342D D63F 7880 12F5 6BA9
> PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc
>
> _______________________________________________
> alicebot-archcomm mailing list
> alicebot-archcomm@list.alicebot.org
> http://list.alicebot.org/mailman/listinfo/alicebot-archcomm
--
Dr. Rich
W A L L A C E
ALICE A.I. Foundation
drwallace@www.alicebot.org
_______________________________________________
alicebot-archcomm mailing list
alicebot-archcomm@list.alicebot.org
http://list.alicebot.org/mailman/listinfo/alicebot-archcomm