EnVerbPhrase module of the

First Working AGI Mind in JavaScript

MindForth for robots -- ghost.pl for webservers


1. Diagram of the EnVerbPhrase Mind-Module


   /^^^^^^^^^\             ________________        /^^^^^^^^^\
  /   EYE     \     | | | / EnThink module \      /   EAR     \
 /             \    | | | \________________/     /  _________  \
|               |   | | |  _____|________       |  /MindBoot \  |
|   _______     |   | | | (  Indicative  )      | / English   \ |
|  /image  \    |   | | |  \____________/       | \ bootstrap / |
| / percept \---|-----+ |       |    \          |  \"vault"  /  |
| \ engram  /   |  a| | |       |     \______   |   \_______/   |
|  \_______/    |  b|c| |       |     /      \  |               |
|               |  s|o|f|       |    / EnVerb-\ |auditory memory|
|   visual      |  t|n|i|       |    \Phrase  / |where ideas are|
|               |  r|c|b|       |    /\______/  |stored as words|
|   memory      |  a|e|e|       |   /     |     |after being    |
|               |  c|p|r|    ___V__/      |     |generated      |
|   channel     |  t|t|s|   /EnNoun-\     |     |internally or  |
|               |   | | |  ( Phrase  )    |     |perceived      |
|               |   | | |   \_______/     |     |externally     |
|               |   | | |       |         |     |   ________    |
|   _______     |   | | |  _____V____   __V__   |  /        \   |
|  /fresh  \    |   |_|_| ( English  ) / En  \  | /  "cats"  \  |
| / image   \   |  /     \ \ Nouns  / / Verbs \-|-\  "eat"   /  |
| \ engram  /---|--\ Psy /--\      /  \_______/ |  \ "fish" /   |
|  \_______/    |   \___/    \____/-------------|---\______/    |


2. Purpose


3. Algorithm


4. Code of EnVerbPhrase() from ghost.pl First Working AGI in Perl

sub EnVerbPhrase() {  # http://ai.neocities.org/EnVerbPhrase.html 
# print "\n EnVP; VL= $verblock negjux= $negjux jux= $jux \n";  # 2018-07-06: TEST
  $act = 0;  # 2016apr25: Start with zero to look for psi1 higher than $act.
  $aud = 0;  # 2018-06-28: prevent carry-over.
  $audjuste = 0;  # 2016feb17: prevent carry-over
  $motjuste = 0;  # 2016feb17: 
  my $negjux = 0;  # 2016jun17: flag for 250=NOT juxtaposed to a verb;
  $vphraud = 0;   # 2016apr10: initially
  if ($verblock > 0) {  # 2016apr13: is there already a verblock?
    my @k=split(',',$psy[$verblock]);  # 2016apr13: inspect t=verblock row;
    $verbpsi = $k[1];   # 2017jun08: lexical verbpsi;
    $svo2 = $k[1];      # 2017-06-08: item #2 of subj - verb - ind.obj - dir.obj
#   $negjux = $k[5];    # 2017jun08: for negation of verb; 
    if ($k[5] == 250) { $negjux = 250; }  # 2018-07-06: TEST
# print "\n EnVPh; VL= $verblock negjux= $negjux jux= $jux \n";  # 2018-07-06: TEST
    $nounlock = $k[13]; # 2017jun08: k13 $tkb becomes $nounlock.
    if ($k[14] > 0) { $audbase = $k[14] }  # 2017jun08: VerbGen parameter;  
    if ($k[14] > 0) { $aud = $k[14] }      # 2017jun08: auditory recall-vector
    if ($k[14] > 0) { $vphraud = $k[14] }  # 2017jun08: auditory recall-vector
    if ($subjpsi==701 || $subjpsi==731) { $prsn=1 } # 2016apr14: I or WE
    if ($svo1==701) { $prsn=1; $subjnum=1 } # 2017-06-07: I
    if ($subjpsi==707 || $subjpsi==737) { $prsn=2 } # 2016apr14: "YOU"
    if ($subjpsi==713 || $subjpsi==719) { $prsn=3 } # 2016apr14: HE; SHE
    if ($subjpsi==725 || $subjpsi==743) { $prsn=3 } # 2016apr14: IT THEY
    $dba = $prsn;  # 2016apr14:  parameter for VerbGen()
    for (my $i=$tpu; $i>$midway; $i--) {  # 2018-06-28: search the @psy array
      my @k=split(',',$psy[$i]);  # 2016apr14: inspect t=verblock row;
      if ($k[1] == $verbpsi && $k[1] == 800) {  # 2017jun08: special 800=BE-verb
        if ($k[6] == 8) {  # 2017jun08: select only $pos=8 verbs, even homonyms
        # Following code accepts only a verb-form matching three 
        # requirements: [ ]same concept; [ ]num(ber); and [ ]person:
          if ($qv2num > 0) { $subjnum = $qv2num }  # 2017-10-22: for query-response.
          if ($k[1]==$verbpsi && $k[8]==$subjnum && $k[7]==$prsn) {  # 2017-06-08
            if ($k[14] > 0) { $aud = $k[14] }      # 2017jun08: find positive $rv; 
            if ($k[14] > 0) { $vphraud = $k[14] }  # 2017jun08: find positive $rv; 
            if ($k[14] > 0) { last }  # 2017jun08: exit loop once $rv is found.
          } # 2016apr14: end of test to find regular or irregular verb-form
        }  # 2016apr14: end of test for part-of-speech $pos == "8" (verb)
      }  # 2016apr14: end of test for correct verb-concept $verbpsi
      if ($k[1] == $verbpsi && $k[1] != 800) {  # 2017jun08: other than 800=BE
        if ($k[6] == 8) {  # 2017jun08: select only $pos=8 verbs, even homonyms
          if ($k[1]==$verbpsi && $i==$verblock) {  # 2017-10-24: zero in!
            if ($k[14] > 0) { $aud = $k[14] }      # 2017jun08: find positive $rv; 
            if ($k[14] > 0) { $vphraud = $k[14] }  # 2017jun08: find positive $rv; 
            if ($k[14] > 0) { last }  # 2017jun08: exit loop once $rv is found.
          } # 2016apr20: end of test to find regular or irregular verb-form
        }  # 2016apr14: end of test for part-of-speech $pos == "8" (verb)
      }  # 2016apr14: end of test for correct verb-concept $verbpsi
    }  # 2016apr14: End of (for loop) searching for correct verb-form.
  }  # 2016apr13: end of test for a positive verblock.
  if ($vphraud > 0) { $aud = $vphraud }  # 2016apr14: correct form?
  if ($vphraud > 0) { $audjuste = $vphraud }  # 2016apr14: correct form?
  if ($verblock == 0)  {  # 2016apr13: prevent false negations;
    for (my $i=$t; $i>$midway; $i--) {  # 2016feb17: search backwards in time.
      my @k=split(',',$psy[$i]);  # 2016mar15: inspect @psy knowledge-nodes.
      if ($k[2] eq "en") {  # 2016mar15: select only English words
        if ($k[6] == 8) {  # 2017jun08: select only k6 $pos=8 verbs
          if ($k[3] > 0) {  # 2017jun08: if k3 activation $act is...
            $tselv = $i;  # 2016apr13: retain time of winning verb;
            $motjuste = $k[1];  # 2017jun08: Select the most active verb.
            $svo2 = $k[1];      # 2017-06-08: for calling VisRecog()
            $audjuste = $k[14]; # 2017jun08: recall-vector $rv for Speech()
          }  # 2016feb17: end of test of activation-level
        }  # 2016feb17: end of test for part-of-speech $pos == "8" verb
      }  # 2016feb17: end of test for human language code $hlc == "en"
    }  # 2016mar12: End of (for loop) searching for most active "motjuste"
  }  # 2016apr13: end of test for absence of a verblock from subject to verb 
  if ($negjux == 250) {  # 2016jun17: if verb is negated with 250=NOT;
# print "EnVPhr: VL= $verblock svo1= $svo1 negjux= $negjux jux= $jux \n";  # 2018-07-06: 
  # if ($motjuste != 800) {  # 2016jun17: if other than an 800=BE verb; 
    if ($svo2 != 800) {  # 2017may29: if other than an 800=BE verb; 
      $auxverb = 830;  # 2016jun17: 830=DO as auxiliary verb; 
      EnAuxVerb();  # 2016jun17: to say 830=DO or "DOES"; 
      $auxverb = 0;  # 2016jun17: reset for safety.
      for (my $i=$t; $i>$midway; $i--) {  # 2016jun17: search for 250=NOT
        my @k=split(',',$psy[$i]);  # 2016jun17: examine @psy array;
        if ($k[1] == 250) {  # 2017jun08: if 250=NOT is found;
          $audjuste = $k[14];  # 2017jun08: "NOT" recall-vector;
          $aud = $k[14];  # 2017jun08: "NOT" recall-vector for Speech()
          if ($k[14]>0) { $aud=$k[14]; last }  # 2017jun08: insurance
        }  # 2016jun17: End of search for 250=NOT;
      }  # 2016jun17: End of search loop from $t back to $midway.
      Speech();  # 2016jun17: speak the word starting at the $aud time. 
      $aud = 0;  # 2018-06-28: reset for safety.
      $negjux = 0;  # 2018-06-28: reset for safety.
#     $jux = 0;  # 2018-07-06: reset for safety?
    }  # 2016jun17: end of test to prevent auxiliary with 800=BE verb.
  }  # 2016jun17: end of test for 250=NOT negjux.
  $aud = $audjuste;  # 2016feb17: for transfer into Speech() module
  $motjuste = $verbpsi; # 2018-06-28: to search for verb-form.
  if ($vphraud != 0) { $aud = $vphraud }  # 2016apr10: Accept rv of 3 parameters.
  if ($subjpsi == 701) { $dba = 1; }  # 2016apr10: "I" 1st person sing.
  if ($subjpsi == 707) { $dba = 2; }  # 2016apr10: "you" 2nd person sing.
  if ($subjpsi == 713) { $dba = 3; }  # 2016apr10: "he" 3rd person sing;
  if ($subjpsi == 719) { $dba = 3; }  # 2016apr10: "she" 3rd person sing.
  if ($subjpsi == 725) { $dba = 3; }  # 2016apr10: "it" 3rd person sing.
  if ($subjpsi == 731) { $dba = 1; }  # 2016apr10: "we" 1st person plural
  if ($subjpsi == 737) { $dba = 2; }  # 2016apr10: "you" 2nd person plural
  if ($subjpsi == 743) { $dba = 3; }  # 2016apr10: "they" 3rd person plural
  if ($vphraud == 0) {  # 2016apr10: if not substituted above;
    for (my $i=$tpu; $i>$midway; $i--) {  # 2018-06-28: skip current engrams.
      my @k=split(',',$psy[$i]);  # 2016apr10: inspect @psy lexical nodes
      if ($motjuste != 0 && $k[1] == $motjuste) {  # 2017-06-30: look for $motjuste;
        $svo2 = $motjuste;  # 2017-04-11: TEST; REMOVE
        $audbase = $k[14];  # 2017jun08: location of quasi-stem for VerbGen();
        if ($k[14] > 0) { $vphraud = $k[14]; last }  # 2018-06-28: infinitive?
        if ($k[7] == $dba)  {   # 2017jun08:  for proper person;
          if ($k[8] == $snu) {  # 2017jun08: subject num(ber) parameter; 
            $vphraud = $k[14];  # 2017jun08: auditory recall-vector; 
            last;  # 2016apr10:  exit the loop after first find;
          }  # 2016apr10: end of subject number-parameter test; 
        }  # 2016apr10: end of dba-parameter test;
      }  # 2016apr10: end of test to find regular or irregular verb-form
    }  # 2016apr10: end of (for loop) searching through @psy conceptual array.
  }  # 2016apr10: end of test of $vphraud.
  if ($vphraud > 0) { $aud = $vphraud }  # 2016apr10: correct form?
  Speech();  # 2017may29: main call from EnVerbPhrase() to Speech()
  $aud = 0;  # 2016apr20: Reset to prevent carry-over. 
  my @k=split(',',$psy[$tselv]);  # 2016apr13: inspect verb at time of selection;
  $psy[$tselv]="$k[0],$k[1],$k[2],-16,$k[4],$k[5],$k[6],"   # 2017-06-10: BUGFIX
  . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]"; # 2017-06-05: concatenator
  # Above line inserts neural inhibition upon currently selected verb. 
  if ($svo2 == 800) {  # 2017may29: if the selected verb is a be-verb
    if ($negjux == 250) {  # 2017may29: if there is a 250=NOT negation flag
      for (my $i=$t; $i>$midway; $i--) {  # 2017may29: search for 250=NOT
        my @k=split(',',$psy[$i]);  # 2017may29: examine @psy array;
        if ($k[1] == 250) {  # 2017jun08: if 250=NOT is found;
          $audjuste = $k[14];  # 2017jun08: "NOT" recall-vector;
          $aud = $k[14];  # 2017jun08: "NOT" recall-vector for Speech()
          if ($k[14]>0) { $aud=$k[14]; last }  # 2017jun08: insurance
        }  # 2017may29: End of search for 250=NOT;
      }  # 2017may29: End of search loop from $t back to $midway.
      Speech();  # 2017may29: speak the word starting at the $aud time. 
      $negjux = 0;  # 2017may29: reset for safety. 
    }  # 2017may29: end of test for negated be-verb
  }  # 2017may29: end of test for 800=BE verb in case of negation.
  $dirobj = 1;  # 2016mar29: set flag positive for seeking direct object. 
  if ($subjpsi == 701) {  # 2017-04-11: only for subject 701=I;
    if ($svo2 == 820) {     # 2017-04-11: only for verb 820=SEE;
      if ($svo4 == 0) {  # 2017-04-11: if SEE has no direct object
      # 2017-04-11: i.e., if there is no robot camera for computer vision...
        VisRecog();  # 2017-04-11: a challenge for robot AI coders
        $svo2 = 0;  # 2017-04-11: reset for safety.
        $svo4 = 0;  # 2017-04-11: reset for safety.
        return;      # 2017-04-11: abandon rest of VerbPhrase
      }  # 2017-04-30: end of test for direct object; 
    }  # 2017-04-11: end of test for "820=SEE";
  }  # 2017-04-11: end of test for ego-concept 701=I as subject. 
  EnNounPhrase();  # 2016mar10: for direct object or predicate nominative
  if ($actpsi > 0) {  # 2018-06-27: if there is activation to spread...
    SpreadAct();  # 2018-06-27: for a chain of thought.
    $actpsi = 0;  # 2018-06-27: reset to zero for safety.
  }  # 2018-06-27: end of test for positive $actpsi.
  $dirobj = 0;  # 2016mar29: reset flag after thinking direct object. 
  if ($prepgen > 0) { EnPrep() }  # 2016mar30: if "Where?" call EnPrep(). 
  $audbase = 0;  # 2016apr25: reset for safety. 
  $num = 0;      # 2017-10-22: reset after output of one query-response.  
  $qv2num = 0;   # 2017-10-22: reset after output of one query-response. 
}  # 2017-11-29: EnVerbPhrase() returns to Indicative() module


5. Troubleshooting and Robotic Psychosurgery

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


6. Variables for First Working Artificial General Intelligence

$verblock -- for subject-noun to lock onto seq-verb. The $verblock is a time-point in conceptual @psy memory where the $seq of a subject-noun is located, so that any crucial consideration such as the negation of a verb will be found when the verb-phrase module fetches the verb-concept from memory. If the thinking process finds and activates a particular subject-noun in memory, the $tkb of the subject noun becomes the $verblock so that a particular verb at a particular time will be selected by the English or Russian verb-phrase module.


7. Future Development


8. Resources


Please see

http://mind.sourceforge.net/v-phrase.html



9. AiTree of First Working AGI Mind-Modules


Return to top; or to
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.