AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

System func/var clarifications
 
 

Hi Bruce,

I have just started reading the System Functions and Variables and am interested in the functionality there. However, I have some questions.

- What does %tense return? I assume the strings “past”, “present”, or “Future”?

- What is the need for setrejoinder when we have reuse? Dont both just jump to labelled rule in the topic?

- Similarly isn’t ^input meant to trigger a pattern match? Is it sort of like using a pattern match instead a rule label for ^reuse?

- How do we catch if a function failed? Does it return some value like FAIL, 0 or does it just end the current rule?

- Why do we need to specify ^ for macro definition arguments? Is it so the system can differentiate from arguments in macro call?

- Which is better to use when trying to find a generalization for a word? :concepts or :up ?

Thanks for all your help…..

 

 
  [ # 1 ]

%tense returns as you expected.

setrejoinder does not jump anywhere. It establishes the context for ^rejoinder.  When you do:
t: what is your name
  a: ATX(_~propernoun) Hi, ‘_0

the outputrejoinder is set to ATX. You can change that if you want.  When the next volley comes in, the outputrejoinder is now the inputrejoinder and used for ^rejoinder. You can modify that as well.  Both can exist simultaneously, you have the input context and you set an output context before having used up the inputrejoinder.

^input is not like reuse. It does not change your flow of execution of the current sentence. It injects the specified data as the next sentence you will process when you come to it.

In general failures of functions will terminate a current rule. But not if you are in a protected context like ^NOFAIL or the condition of an if.  eg   if ( query(direct_sv I want ?)) { }  will not fail the rule when the query fails.

You specify ^ on a macro argument definition for visual consistency.  If I allowed:
  outputmacro: ^myfunc (arg1 arg2)
then you’d be tempted to refer to them in the body of the macro as arg1 and arg2, which cannot be distinguished from ordinary words. So by making you use ^arg1 and ^arg2 in the definition, you see that you must use them in the body as well.

as for :concepts and :up.  You should decide that via your own experimentation.  You can also add to that
:prepare   wolf
which shows what concepts get marked.

 

 
  login or register to react
‹‹ Partial match      Creative aids ››