AskUser module of the

First Working Artificial General Intelligence

ghost.pl for webservers -- MindForth for robots


1. Diagram of the AskUser Mind-Module

The asking of a simple question requires an auxiliary verb.

   /^^^^^^^^^\Generation of "Does John read books?"/^^^^^^^^^\
  /   EYE     \  Auxiliary +Subject +Verb +Object /   EAR     \
 /             \    | | |    ___________         /             \
|   _______     |   | | |   / Sentence  \       |               |
|  /"book" \    |   | | |   \___________/-------|-------------\ |
| / percept \---|---|-|-+     |        \        |             | |
| \ engram  /   |  r|s|b|     |        _\____   |             | |
|  \_______/    |  e|t|o|     |       /EnVerb\  |             | |
|               |  a|u|o|     |      ( Phrase ) |             | |
|               |  d|d|k|     |      /\______/  |             | |
|   visual      |   |e|s|     |     /    / |    |  auditory   | |
|               |   |n| |  ___|__  /    /  |    |             | |
|   memory      |   |t| | /EnNoun\/   _/_  |    |  memory     | |
|               |   |s| |( Phrase )  /Aux\ |    |             | |
|   channel     |   | | | \______/   \___/ |    |  channel    | |
|               |   | | |     |        \   |    |     ____    | |
|               |   | | |     |         \  |    |    /    \   | |
|   _______     |   | | |     |         _\_|_   |   /"does"\  | |
|  /fresh  \    |   |_|_|    _|___     / En  \  |  / "John" \ | |
| / image   \   |  /     \  / En  \   / Verbs \-|-/  "read"  \| |
| \ engram  /---|--\ Psi /-/ Nouns \  \_______/ | \  "books" /  |
|  \_______/    |   \___/  \_______/------------|--\________/   |


2. Purpose of the AskUser AI Mind-Module

The AskUser mind-module has several purposes. One is to ask the human user a question seeking confirmation or negation of a logical InFerence made by the InFerence module. Another purpose is to let the Volition module decide to ask various questions in pursuit of conducting a conversation with the human user.


3. Algorithm of the AskUser Module of Strong AI with NLU

Whereas the SpreadAct module causes the AI to spread so much activation to a sequence of concepts that they surface in the output of the AI as a response to a query submitted by a human user, the AskUser module is engineered to ask specific questions of a human user in specific situations.

3.A. Ask a yes-or-no question to validate or reject a silent inference.

When the InFerence module makes a silent inference on the basis of input data, various parameters such as the subject of the inference, the verb involved, and the direct object of the inferred verb, are fed as variables to the AskUser module so that the AI may ask a human user if the inference is true. When the user answers "yes" or "no" or "maybe" or no answer at all, the KbRetro module retroactively adjusts the inferred idea in the knowledge base (KB) so that the AI may either use or disregard the idea in the future.

If you tell a mentifex-class AI Mind a general fact, such as "Women have a child" or "Boys play games" and you then input a specific fact such as "Mary is a woman" or "John is a boy", the AI will make a silent inference and then use the AskUser mind-module to ask for confirmation or refutation of the inference.

You can try it out with http://ai.neocities.org/FirstWorkingAGI.html by using Internet Explorer to input "Mary is a woman". Then the AI will ask you, "Does Mary have a child?" There are four possible answers anticipated by the AI software: Yes; No; maybe; or no answer at all. Then the KbRetro() module adjusts the knowledge base (KB) with your answer.

3.B. Ask a question out of AI curiosity.

Some versions of the AI Mind, MindForth in particular, are being coded to ask "Who are you?" if there has been no contact with the outside world after an arbitrary interval as specified by the AI coder or AI mind maintainer. Although this question needs to be reworked so that it arises spontaneously as an initiative undertaken at the behest of the Volition module for free will in robots, the question is important because any previous user may have departed from the scene and the AI Mind may need to become aware that it is dealing with a different user than before.

MindForth is the first AI Mind to implement the ability of the AskUser module to ask a who-question like "Who are you?" based upon a kind of artificial curiosity caused by an arbitrarily long period without any human input. The isolation flag is incremented one-by-one for any thought-cycle with no human input until a threshold level decreed by the AI mind maintainer sets the whoq flag to a unitary positive one, which prepares the AI to ask a question but does not yet actually ask the question. When human input causes the isolation flag to be reset to zero, the MindForth Volition module calls AskUser to start a conversation with "WHO ARE YOU". As long as the human user remains in conversation with the artificial intelligence, brief periods of no human input will not re-trigger the question of "WHO ARE YOU", because presumably a realistically long threshold has been set by the AI coder or mind-maintainer. It is important that the Volition module ask the question, so that psychological priorities may influence not only what question is asked, but indeed whether any question at all is asked. It is also significant that the questions asked by the AskUser module facilitate the man-machine dialog or conversation which is the hallmark of a true artificial intelligence.

3.C. Cycle through a delay-loop while the AI waits for a human response.

Normally the AI Mind will perform one mental operation after another without any delay, but a delay-loop serves the purpose of giving the human user time to respond to the artificial intelligence after the AI asks the user a question.


4. Code of AskUser() from ghost296.pl AI source code in Perl


sub AskUser() {  # http://ai.neocities.org/AskUser.html
  $pov = 1;  # 2018-06-26: 1=internal; 2=external;  
  $quobjaud = 0;  # 2018-06-26: safety measure; 
  if ($ynverb == 0) {  # 2018-06-26: ask y/n question only once; 
    $ynverb = $quverb;  # 2018-06-26: isolate at start; 
    $moot = 1;  # 2018-06-26: prevent storing of "tkb" and "seq"; 
    $auxverb = 818;  # 2018-12-10: 818=DO as auxiliary verb; 
    $prsn = 3;  # 2018-10-08: assumption; otherwise track value thru code.
    EnAuxVerb();  # 2018-12-10: Say 818=DO or DOES; 
    $auxverb = 0;  # 2018-06-26: reset for safety; 
    $moot = 0;  # 2018-06-26: reset after use;
    for (my $i=$inft; $i>$midway; $i--) {  # 2018-06-26: skip silent inference; 
      my @k=split(',',$psy[$i]);  # 2018-06-26: examine @psy array;
      if ($k[1] == $qusub) {  # 2018-06-26: if query-subject found; 
        $aud = $k[14];  # 2018-06-26: assign auditory recall-tag; 
        last;  # 2018-06-26: exit the loop after first find; 
      }  # 2018-06-26: end of test for query-subject; 
    }  # 2018-06-26: end of loop in search of quobj. 
    Speech();  # 2018-06-26: say subject-word starting at "aud" value; 
    if ($quverb == 0) { $quverb = 818 }  # 2018-12-10: 818=DO default; 
    for (my $i=$inft; $i>$midway; $i--) {  # 2018-06-26: skip silent inference; 
      my @k=split(',',$psy[$i]);  # 2018-06-26: examine @psy array;
      if ($k[1] == $quverb && $k[7] == 0) {  # 2018-10-08: infinitive dba=0
        $aud = $k[14];  # 2018-06-26: assign most recent recall-tag; 
        last;  # 2018-06-26: exit the loop after first find; 
      }  # 2018-06-26: end of test for $quverb.
    }  # 2018-06-26: end of loop in search of yes-or-no ("yn") quverb; 
    $verbprsn = 0;  # 2018-06-26:  Store the verb as an infinitive form; 
    $audnum = 0;    # 2018-06-26:  infinitive without num(ber); 
    $holdnum = 0;   # 2018-06-26:  infinitive without num(ber); 
    $infincon = 1;  # 2018-06-26:  set flag to positive one; 
    $nphrnum = 0;   # 2018-06-26: for no influence on infinitive; 
    $numsubj = 0;   # 2018-06-26:  for no influence on infinitive; 
    $putnum = 0;    # 2018-06-26:  for insisting on zero num infinitive; 
    Speech();      # 2018-06-26:  speak the verb starting at "aud" value; 
    if ($quobj == 0) { $quobj = 711 }  # 2018-06-26: 711=ANYTHING default; 
    for (my $i=$inft; $i>$midway; $i--) {  # 2018-06-26: skip silent inference; 
      my @k=split(',',$psy[$i]);  # 2018-06-26: examine psy concedptual array;
      if ($k[1] == $quobj) {  # 2018-06-26: if query-object found; 
        if ($k[7]==4) {  # 2018-06-26: dba=4 accusative? 
          $quobjaud = $k[14];  # 2018-06-26: hold thru EnArticle(); 
          $usx=0;  # 2018-09-19: Suppress "THE" in the EnArticle() module. 
          $us1=0;$us2=0;$us3=0;$us4=0;$us5=0;$us6=0;$us7=0; # 2018-09-19
          EnArticle();  # 2018-06-26: insert "A" or "THE" article.
          $aud = $quobjaud;   # 2018-06-26: restore after EnArticle; 
          last;  # 2018-06-26: exit the loop after first grammatical find; 
        }  # 2018-06-26: end of test for accusative dba=4.
      }  # 2018-06-26: end of test for $quobj.
    }  # 2018-06-26: end of loop in search of quobj; 
    $dirobj = 1;  # 2018-06-26: So OldConcept will set "dba" = 4 (accusative) 
    Speech();     # 2018-06-26: say object word starting at "aud" value; 
    $dirobj = 0;  # 2018-06-26: Reset for safety after asking question; 
    $yncon = 0;   # 2018-06-26: assuming question has been asked; 
    $kbcon = 1;   # 2018-06-26: because waiting for answer; 
    $ynverb = 0;  # 2018-06-26: zero out; prevent repeat of query; 
  }  # 2018-06-26: end of test of ynverb; 
  if ($subjpsi==701) { $prsn=1; }  # 2018-06-26:  1st person "I"; 
  if ($subjpsi==731) { $prsn=1; }  # 2018-06-26:  1st person "WE"; 
  if ($subjpsi==707) { $prsn=2; }  # 2018-06-26:  2nd person YOU; 
  if ($subjpsi==713) { $prsn=3; }  # 2018-06-26:  3rd person HE; 
  if ($subjpsi==719) { $prsn=3; }  # 2018-06-26:  3rd person SHE; 
  if ($subjpsi==725) { $prsn=3; }  # 2018-06-26:  3rd person IT; 
  if ($subjpsi==743) { $prsn=3; }  # 2018-06-26:  3rd person THEY; 
  $numsubj = 0;  # 2018-06-26: reset for safety; 
  $qusnum = 0;   # 2018-06-26: reset for safety; 
  $qusub = 0;    # 2018-06-26: reset for safety; 
  $recon = 0;    # 2018-06-26: remove incentive for asking a question.
  $bias = 5;     # 2018-06-26: restore expectation of a noun; 
  my $rsvp = 0;  # 2018-06-2016: counter for response-delay;
  until ($rsvp == 100000) {  # 2018-06-26: upper limit on count;
    $rsvp++;  # 2018-06-26: Increment $rsvp counter
  }  # 2018-06-26: end of loop waitng for user-response.
  $pov = 2;  # 2018-06-26: 1=internal; 2=external; 
}  # 2018-06-26: AskUser() returns to EnThink()


5. Variables for the AskUser Module of the AI Mind

$aud -- in the Speech() module is an associative tag leading to the typically most recent engram of a word stored in the @ear array of the auditory memory channel.

$audnum -- grammatical num(ber) variable potentially of use for locating an infinitive verb-form with zero as a grammatical num(ber).

$auxverb -- auxiliary verb such as "DOES" or "HAS".

$bias -- expected part-of-speech for any parsing module.

$dirobj -- flag indicates seeking for a direct object.

$holdnum -- transfers number from subject to verb.

$infincon -- infinitive condition flag

$kbcon -- flag for KbRetro to wait for a yes-or-no answer.

$moot -- as in legally moot -- is a flag to prevent the formation of associative tags during mental operations which are not truly a part of cognition, such as the processing of an input query, the formation of a silent InFerence, or the creation of an output query.

$nphrnum -- grammatical number of noun-phrase.

$numsubj -- for number of subject.

$pov -- point-of-view: 1=self; 2=dual; 3=alien. When pov=1, the word "you" is somebody in the external word. When pov=2, the word "you" refers to the self-concept "I" in the AI. When pov=3, the word "you" is interpreted as part of a conversation by a third-party or as a word in a text, not referring to the self-concept of either the AI or of someone talking to the AI.

$putnum -- putative num(ber) for subject-verb agreement.

$quobj -- query object – holds onto the psi identifier of a word chosen by the InFerence() module to be the direct object of a query created by the AskUser() module.

$quobjaud -- auditory recall-tag for AskUser module

$qusnum -- query-subject number – for the AskUser module to ask a question seeking yes-or-no confirmation of a logical inference made by the AI Mind.

$qusub -- query subject – is a transfer-vehicle of the subject-identifier from any module prompting a question into the specific module that will ask the question.

$quverb -- query verb -- is set in the InFerence module with the identifier of a verb concept serving as part of an InFerence being made about user input. Then the AskUser module transforms the quverb identifier into the yes-or-no-verb identifier ynverb so that AskUser can use the query-verb to ask a question expecting a yes-or-no answer.

$recon -- incentive for reconaissance by asking a question.

$rsvp -- to hold an arbitrary value for a delay in thinking to wait for user input.

$verbprsn -- verb-person -- reverting to zero for infinitive forms.

$yncon -- yes-or-no condition – is a status flag that a module like InFerence() can set to a positive one in order to trigger the calling of the AskUser() module by the English EnThink() module.

$ynverb -- yes-or-no-verb – identifier of a verb to be used in AskUser() for the asking of a question expecting a yes-or-no answer.


6. Troubleshooting and Robotic Psychosurgery

6.1.a. Symptom: (Something goes wrong.)
6.1.b. Solution: (AI Mind Maintainer devises solution.)

6.2.a. Symptom: AI asks confirmation question lacking a verb.
6.2.b. Solution: The AI Mind needs to have the query-verb in the MindBoot sequence as an infinitive form with a dba=0 indicating that the verb is not in first person or second person or third person.


7. Future Development of the AskUser AI Mind-Module


8. Resources in connection with the AskUser module

Please see

http://mind.sourceforge.net/ask.html

http://cyborg.blogspot.com/search/label/AskUser -- is a weblog URL which invites Netizens to view blog-posts discussing the AskUser mind-module.


9. AiTree of First Working AGI Mind-Modules


Return to top; or to
http://en.wikipedia.org/wiki/Natural_language_understanding -- solved.
http://old.reddit.com/r/ControlProblem -- NOT SOLVED.
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.
If you have any questions about the First Working AGI, please Join the Discussion.
Joint Artificial Intelligence Center (JAIC) -- the AI Manhattan Project.