(asking for ... in $)
provides for objects and directions out-of-the-box. You need to extend it to cover topics.
Try adding these, see if it works:
(asking for topic in $)
(understand $Words as $Action)
(implicit action is $Implicit)
(if) (implicit action wants topic) (then) %% added for topic
*(understand $Words as topic $O) %% coverage
(elseif) (implicit action wants direction) (then)
*(understand $Words as direction $O)
(else)
%% We don't know the correct policy, so fall back on 'non-all'.
*(understand $Words as non-all object $O)
(endif)
(recover implicit action $Implicit $O into $Action) (just) %% library override
%% This is new, all others are library overrides
(interface (asking for topic in $<Action))
(asking for topic in $Action)
(now) (implicit action is $Action)
(now) (implicit action wants topic)
(now) ~(implicit action wants direction)
(tick) (stop)
(asking for object in $Action)
(now) (implicit action is $Action)
(now) ~(implicit action wants direction)
(now) ~(implicit action wants topic) %% added for topic coverage
(tick) (stop)
(asking for direction in $Action)
(now) (implicit action is $Action)
(now) (implicit action wants direction)
(now) ~(implicit action wants topic) %% added for topic coverage
(tick) (stop)
(try-complex $ComplexAction) (just) %% added (just) for override
(if) ~(action $ComplexAction preserves the question) (then)
(now) ~(implicit action is $)
(now) ~(implicit action wants direction)
(now) ~(implicit action wants topic) %% added for topic coverage
(endif)
(if) ~(allowed action $ComplexAction) (then)
(report disallowed action $ComplexAction)
(tick) (stop)
(elseif) ([] is one of $ComplexAction) (then)
You're not aware of any such thing!
(tick) (stop)
(else)
(strip decorations from $ComplexAction into $MultiAction)
%% Now we have something like:
%% [put [#marble1 #marble2 #marblefloor] #in #bowl]
(if)
*($Obj is one of $MultiAction)
{
(nonempty $Obj)
(or)
(object $Obj)
~(direction $Obj)
~(relation $Obj)
~(room $Obj)
}
(then)
(notice player's $Obj)
(endif)
(if) *($List is one of $MultiAction) (nonempty $List) (then)
(exhaust) {
*(regroup stripped action $MultiAction of
$MultiAction into $Regrouped $Multi)
%% Assuming the marbles are fungible, now we
%% are backtracking over:
%% [put [#marble1 #marble2] #in #bowl]
%% [put #marblefloor #in #bowl]
(if)
~(empty $Multi)
(then)
%% If at least two multi-actions are
%% implied, describe each step.
(line)
(if) (library links enabled) (then)
(link) (The full $Multi)
(else)
(The full $Multi)
(endif)
:
(endif)
(try regrouped $Regrouped)
}
(else)
%% Optimize the common case.
(try regrouped $MultiAction)
(endif)
(endif)
Edit: Actually try this first before the rigmarole above:
(understand $Words as $Action)
(implicit action is $Implicit)
(if) (implicit action wants direction) (then)
*(understand $Words as direction $O)
(else)
%% We don't know the correct policy, so fall back on 'non-all'.
*(understand $Words as non-all object $O)
(or)
*(understand $Words as topic $O) %% added for topic coverage
(endif)
(recover implicit action $Implicit $O into $Action) (just) %% library override
Use asking for object for topics as well with this version.
Edit 2: And this might work even better(the override above is not ideal, might miss some possibilities with that). Just add this, no override necessary:
(understand $Words as $Action)
(implicit action is $Implicit)
(if) ~(implicit action wants direction) (then)
*(understand $Words as topic $O) %% added for topic coverage
(endif)
(recover implicit action $Implicit $O into $Action)