Houston, we have a problem. The ghost.pl AI Mind in freely available -- download it now -- Strawberry Perl Five -- is not properly answering the question of "what do you think". The JSAI (JavaScript Artificial Intelligence) easily answers the same question with "I THINK THAT I HELP KIDS". So what is the Perl AI doing wrong that the JavaScript AI is doing right?
The problem seems to lie in the SpreadAct() module. We notice one potential problem right away. SpreadAct() in Perl is still using "$t-12" as a rough approximation for when to start a backwards search for previous knowledge about the subject-noun $qv1psi of a what-query, whereas the JSAI uses the more exact $tpu for the same search. So let us start using the penultimate time $tpu, which excludes the current-most input, and see if there is any improvement. There is no improvement, so we test further for both $qvipsi and $qv2psi, which are the subject-noun and the associated verb conveyed in the what-query.
SpreadAct() easily responds correctly to what-queries for which there is an answer ready in the knowledge base (KB), such as "I AM A PERSON" in response to "what are you". However, when we ask "what think you" or "what do you think", there is no pre-set answer, and the AI is supposed to generate a response starting with "I THINK" followed by the conjunction "that" and a statement of whatever the AI Mind is currently thinking.
From diagnostic messages we learn that program-flow is not quickly transiting from SpreadAct() to EnThink(). The AI must be searching through the entire MindBoot() sequence and not finding any matches. When the program-flow does indeed pass through EnThink() to Indicative() to EnNounPhrase(), there are no pre-set subjects or verbs, but rather there are concepts highly activated by the SpreadAct() module. So EnNounPhrase() must find the highly activated pronoun 701=I in order to start the sentence "I THINK..." in response to "what do you think".
Now we discover that the JavaScript version of EnNounPhrase() has special code for a topical response to "what-think" queries. In the course of AI evolution, it may be time now to go beyond such a hard-coded response and instead to let the activated "think" concept play its unsteered, unpredetermined role, which will happen not in EnNounPhrase() but in EnVerbPhrase().
It is possible that EnNounPhrase() finds the activated subject 701=I but then unwarrantedly calls the SpreadAct() module. However, it turns out that EnVerbPhrase() is making the unwarranted call to the SpreadAct() module, which we now prevent by letting it proceed only if there is no what-query being processed as evidenced by a $whatcon flag set to zero.
The early part of EnVerbPhrase() in the JavaScript AI has some special code for dealing with "what-think" queries. In the ghost.pl AI, let us try to insert some similar code but without it being geared specifically to the verb "think". We would like to enable responses to any generic verb of having an idea, such as "think" or "know" or "fear" or "imagine" or "suspect" and so forth.
By bringing some code from the JavaScript EnVerbPhrase() into the Perl EnVerbPhrase, but with slight changes in favor of generality, we get the ghost.pl AI to respond "I THINK". Next we need to generate the conjunction "that". But first let us remark that the AI also says "I KNOW" when we ask it "what do you know", so the attempt at generality is paying off. Let us try "what do you suspect". It even says "I SUSPECT". It also works with "what do you fear". We ask it "what do you suppose" and it answers "I SUPPOSE".
We still have a problem, Houston, because EnVerbPhrase() is calling EnNounPhrase() for a direct object instead of returning to Indicative() as a prelude to calling the ConJoin() module to say "I THINK THAT...." We set up some conditional testing to end that problem.