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

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. Function

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.

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.


4. Code of AskUser() from ghost.pl First Working AGI 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 = 830;  # 2018-06-26: 830=DO as auxiliary verb; 
    EnAuxVerb();  # 2018-06-26: Say 830=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 = 830 }  # 2018-06-26: 830=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) {  # 2018-06-26: if yn query-verb found; 
        $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(); 
          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;
  print "\a";  # 2018-06-29: Beep to alert human user to a question being asked.
  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. Troubleshooting and Robotic Psychosurgery

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

5.2.a. Symptom: AI asks confirmation question lacking a verb.
5.1.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.


6. Variables

$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.


7. Future Development


8. Resources

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.