InStantiate Module of the

First Working Artificial General Intelligence

ghost.pl for webservers -- MindForth for robots


1. Diagram of InStantiate Mind-Module

InStantiate creates a Psy node for each instance of a concept.

   /^^^^^^^^^\ InStantiate Associates Psy Concepts /^^^^^^^^^\
  /   EYE     \   PSY                   _____     /   EAR     \
 /             \  MINDCORE             /New- \   /             \
|   _______     | CONCEPTS   _______  (Concept)-|-------------\ |
|  /old    \    |  | | |    / Old-  \  \_____/  |  Audition   | |
| / image   \---|----+ |   ( Concept )---|------|----------\  | |
| \ recog   /   |  | | |    \_______/----|------|-------\  |  | |
|  \_______/    | a| | |      |     \  __|___   |  c    |  |  | |
|               | b|C| |      }      \/ POS  \  |   a   |  |  | |
|   visual      | s|O|f|      |      ( Parser ) |    t  |  |  | |
|               | t|N|i|      |       \______/  |     s-/  |  | |
|   memory      | r|C|b|      |        |noun?   |          |  | |
|               | a|E|e|   ___V_____   |verb?   |  e       |  | |
|   remembrance | c|P|r|  /         \  |adj.?   |   a      |  | |
|               | t|T|s| / SpreadAct \ |adverb? |    t-----/  | |
|   channel     |  |_|_| \___________/ |prep.?  |             | |
|   _______     | /Mind-\/  ___________|conj.?  |  f          | |
|  /new    \    |( Core  ) /INSTANTIATE\        |   a         | |
| / percept \---|-\"Psy"/-/ psi     pos \       |    u        | |
| \ engram  /   |  \___/ ( act       pre )      |     n       | |
|  \_______/    |         \ jux     seq /       |      a------/ |
|               |          \___________/        |               |


2. Purpose

The main purpose of the InStantiate module is to create a new time-bound instance of a concept in conceptual memory whenever the AI Mind processes a concept either as an element of input or as part of a thought being remembered or generated. Other purposes of InStantiate involve "trapping" or the special processing of input-concepts for the sake of special handling in other mind-modules such as the SpreadAct module for spreading activation.


3. Algorithm of the InStantiate AI Mind-Module

3.A. Instantiating time-bound associative nodes in the conceptual memory array.

When the AI Mind has either recognized an input word as an old concept or encountered a new word and is creating a new concept for the new word, InStantiate creates a new instance of the concept by attaching any available associative tags to a node of the concept at the time-point of the advancing front of consciousness. Some associative tags must be assigned retroactivately by InStantiate because a word of input may have an associative relationship to another word that has not yet arrived as additional input. For instance, a conceptual node for a verb of input may need the retroactive addition of an associative tag for the object of the verb, which arrives in the AI Mind not simultaneously with the verb, but slightly delayed.

3.B. Activating old associative nodes for a concept.

3.B.1. Inhibiting a current node while activating older nodes.

InStantiate imparts a modest level of activation to the previous nodes of a known concept stretching back over the conceptual MindGrid in such a way as to create a trough of inhibition for the most recent instantiation of the concept, so that old ideas involving the concept may contribute to thinking and so that current thoughts, being immediately inhibited, may yield to remembered thoughts or to the results of automated reasoning by means of logical inference.

3.B.2. Spreading activation sideways from old associative nodes of a concept.

Already in the ghost.pl AI and upcoming in the Forth and JavaScript AI Minds, InStantiate passes activation sideways from a newly activated concept to other concepts associated in the past with the concept for which a fresh associative node is being instantiated. If the AI Mind is familiar with a noun like "DICE" only as the direct object of a verb in memory, the sideways spread of activation makes it possible for a human user to input the one noun and to observe that the AI uses the sideways spread of activation to remember and output a thought like "GOD DOES NOT PLAY DICE".

3.C. Trapping the input of interrogative words requiring a query-response.

Besides assigning associative tags, InStantiate also sets various conditional flags for dealing with special inputs such as query-words or adverbs of negation, such as "not".


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


sub InStantiate() {  # http://ai.neocities.org/InStantiate.html
  if ($pre == 0) { $pre = $prevtag }  # 2017-09-25: still needed.
  $prevtag = 0;  # 2016mar12: Reset for safety. 
  if ($pov == 2) {  # 2017-09-17: only during external input, not re-entry
    if ($psi == 781)  {  # 2017-11-27: upon input of 781=WHAT
      if ($whatcon == 0)  {  # 2017-11-27: to set only once per input idea
        $whatcon = 1;  # 2017-11-27: set positive to process rest of input.
      }  # 2017-11-27: end of test for $whatcon at zero.    
    }  # 2019-01-25: end of test for input of query-word 781=WHAT.
    if ($psi == 791)  {  # 2018-09-30: upon input of 791=WHO
      $whocon = 1;  # 2018-09-30: set positive for use in SpreadAct()
    }  # 2019-01-25: end of test for input of query-word 791=WHO.
    if ($psi==781 || $psi==791)  {  # 2018-09-29: upon 781=WHAT or 791=WHO
        $qucon = 1;  # 2017-09-17: set positive to process rest of input.
    }  # 2019-01-25: end of test for input of query-words 781=WHAT or 791=WHO.
  } # 2017-11-27: end of test for point-of-view to be 2=pov external for input.
  if ($qucon > 0 || $whatcon > 0) {  # 2018-09-29: deal with more than "who is" queries...
    if ($psi == 800)  {  # 2017-09-17: if 800=Be-Verb...
      $qv2psi = 800;  # 2017-09-17: for transfer to SpreadAct.
    }  # 2017-09-17: end of test for 800=BE. 
    if ($pos==8 && $psi != 800 && $psi != 818) { # 2018-12-10: not 800=BE or 818=DO
      $qvdocon = 1;    # 2017-09-26: set flag for query who+verb+direct-object. 
      $qv2psi = $psi;  # 2017-10-24: for transfer to SpreadAct. 
    }  # 2017-09-26: end of test for verb other than 800=BE. 
    if ($qvdocon > 0 && $pos == 5) { # 2017-09-26: if 5=noun comes in...
      $qv4psi = $psi;  # 2017-09-26: to send direct object into SpreadAct()
    } # 2017-09-26: end of test for noun during who-verb-dirobj query.
    if ($pos==5 && $dba==4) {  # 2018-09-30: if noun and direct object...
      $qv4psi = $psi;  # 2018-09-30: to send direct object into SpreadAct()
    } # 2018-09-30: end of test for noun with query involving direct object.
  }  # 2017-09-26: end of test for positive query-condition $qucon.
  if ($whatcon > 0) {  # 2017-11-27: deal with what-queries...
    if ($psi == 800)  {  # 2017-11-27: if 800=Be-Verb...
      $qv2psi = 800;  # 2017-11-27: for transfer to SpreadAct.
    }  # 2017-11-27: end of test for 800=BE. 
    if ($pos==5 || $pos==7) { # 2017-11-27: if 5=noun or 7=pronoun...
      $qv1psi = $psi;  # 2017-11-27: for transfer as query-subject to SpreadAct.
    }  # 2017-11-27: end of test for 5=noun or 7=pronoun
    if ($pos==8 && $psi != 800 && $psi != 818) { # 2018-12-10: if verb but not 818=DO
      $qv2psi = $psi;  # 2017-11-27: for transfer as query-verb to SpreadAct. 
    }  # 2018-12-10: end of test for verb other than auxiliary 818=DO. 
  }  # 2017-11-27: end of test for positive query-condition $whatcon.
  if ($oldpsi == 701) { $pos = 7 }  # 2016jun19: 7 = pronoun.
  $act = 0;   # 2016jun26: preparing to activate only older nodes of concepts.
  if ($moot == 0) {  # 2017-09-18: if no query is being input...
    my @k=split(',',$psy[$tvb]);  # 2017-06-30: inspect @psy flag-panel at time of verb
    if ($qucon==1 && $k[12]==701) { $k[7] = 2 } #2017-11-26: 2nd person 800=ARE
    if ($whatcon==1 && $k[1]==800) { $k[7] = 0 } #2017-11-28: skip $dba person.
    if ($whatcon==1 && $k[1]==781) { $k[3] = 0 } # 2018-09-11: deactivate 781=WHAT
    if ($whatcon > 0) {  # 2018-09-12: deal with what-queries...
      if ($pos==8 && $psi != 800 && $psi != 818) {  # 2018-12-10: if not BE or DO
        $qv2psi = $psi;  # 2018-09-12: for transfer as query-verb to SpreadAct()
      }  # 2018-09-12: end of test for verb other than auxiliary BE or DO.
    }  # 2018-09-12: end of test for positive query-condition $ whatcon.
    $psy[$tvb]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
    . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$tkb,$k[14]";  # 2017-06-30: insert $tkb
  }  # 2017-09-18: end of test for no suppression of associative tag $tkb
  if ($pov == 2) {  # 2019-01-25: only during external input, not re-entry
    for (my $i=$tpu; $i>$midway; $i--) {  # 2018-06-28: search backwards in time.
      my @k=split(',',$psy[$i]);  # 2016jun26: inspect @psy flag-panel
      if ($k[1] == $psi) {  # 2019-01-19: increment activation on matching concepts
        if ($k[0] < 1) { $k[0] = 0 };  # 2018-09-26: BUGFIX: initialize. 
        $k[3] = ($k[3] + 24);  # 2019-03-31: activate enough to spark a thought
        if ($psi == 781) { $k[3] = 0 } # 2017-11-27: upon input of 781=WHAT
        $psy[$i]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"
        . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]";  # 2017-06-08
        if ($k[10] > 0) {  # 2019-03-31: if there is a "pre" concept...
          $prepsi = $k[10];  # 2019-03-31: grab hold of the "pre" as $prepsi
          for (my $j=$tpu; $j>$midway; $j--) {  # 2019-03-31: search within a search.
            my @p=split(',',$psy[$j]);  # 2019-03-31: inspect @psy flag-panel
            if ($p[1] == $prepsi)  {  # 2019-03-31: if first inner loop finds $prepsi...
              for (my $x=$tpu; $x>$midway; $x--) {  # 2019-03-31: search within a search.
                my @q=split(',',$psy[$x]);  # 2019-03-31: inspect @psy flag-panel
                if ($q[1] > 0 && $q[12] == $prepsi) {  # 2019-03-31: if subject of $prepsi
                  $psy[$x]="$q[0],$q[1],$q[2],32,$q[4],$q[5],$q[6],"  # 2019-03-31: 
                  . "$q[7],$q[8],$q[9],$q[10],$q[11],$q[12],$q[13],$q[14]";  # 2019-03-31
                }  # 2019-03-31: end of test for subject of $prepsi.
              }  # 2019-03-31: end of second inner loop spreading activation sideways.
            }  # 2019-03-31: end of test for $prepsi.
          }  # 2019-03-31: end of first inner loop with its own index.
        }  # 2019-03-31: end of test for existence of a "pre" concept.
      } # 2016-06-24: end of test for matching concept.
    }  # 2016jun26: end of (for loop) searching backwards in time.
  } # 2019-01-25: end of test for point-of-view to be 2=pov external for input.

  $tult = ($t - 1);  # 2017-06-25: penultimate time
  $act = -48;  # 2016JUL06: for a "trough" of recent-most inhibition. 
  if ($qv2num > 0) { $num = $qv2num }  # 2017-10-22: for who+verb+dir.obj. query-response
  my @k=split(',',$psy[$tult]);  # 2018-07-03: expose flag-panel at tult;
  $psy[$tult]="$k[0],$k[1],$k[2],$act,$k[4],$k[5],$k[6],"
  . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]";   # 2018-07-03: concatenate
  if ($tkb == $tdo) { $tkb = 0 }  # 2017-09-19: prevent direct-object $tkb
  # 2017-06-25 Next line governs only direct objects?
  $psy[$tult] = "$tru,$psi,$hlc,$act,$mtx,$jux,$pos,$dba,$num,$mfn,$pre,$iob,$seq,$tkb,$rv"; 
  $tult = 0;  # 2017-06y-23: reset for safety
  if ($jux == 250) { $jux = 0 }  # 2016jun17: Reset after use.
  if ($prejux == 250) {  # 2016jun17: 250=NOT from OldConcept()
    $jux = 250;  # 2016jun17: set $jux for next instantiand;
    $prejux = 0;  # 2016jun17: Reset for safety.
  }  # 2016jun17: end of post-instantiation test;
  if ($hlc == 3) {     # 2018-09-27: only for Russian input
    if ($seqneed == 8 && (ord $pho) == 32) {
      if ($pov > 1) {   # 2017-09-10: only during input
        $t++;  # 2017-09-10: increment internal AI time "t"
        $audpsi = 1800;  # 2017-09-10: by default assume provisional 1800=BE verb.
        $ear[$t] = "$pho,0,$audpsi";     # 2017-09-10: store verb 800=BE
        $psi = 1800;  # 2017-09-10: set the concept to 800=BE. 
        $prevpsi = 1800;  # 2017-09-10: to enable cancellation of be-verb
        $pos = 8;    # 2017-09-10: set the part-of-speech $pos to 8=verb.
        $psy[$t] = "$tru,$psi,$hlc,$act,$mtx,$jux,$pos,$dba,$num,$mfn,$pre,$iob,$seq,$tkb,$rv"; 
        $t++;  # 2017-09-10: increment internal AI time "t"
      }  # 2017-09-10: end of test for input-mode only.
    }  # 2017-09-10: test for 32=SPACE
    if ($prevpsi == 1800 && $seqneed == 5) {  # 2017-09-10: if noun is expected...
      if ($pos == 8)  {  # 2017-09-10: if real verb follows pseudo-be-verb
        $seqneed = 8;  # 2017-09-10: the seq to the real verb is needed
        $prevpsi = 0;  # 2017-09-10: reset after using.
      }  # 2017-09-10: end of test for a real verb
    }  # 2017-09-10: end of test
  }  # 2017-09-10: end of test for Russian human-language-code $hlc
  if ($pos == 5) { $usx = $psi };  # 2018-09-03: for transfer to EnArticle()
  if ($pos != 5) { $usx = 0 };  # 2018-09-03: transfer only noun-concepts. 
  if ($pos == 5 || $pos == 7) { $prevtag = $psi };  # 2016mar12: after subject
  if ($pos == 8) { $prevtag = $psi };  # 2016mar12: after a verb.
  if ($pos == 8 && $seqneed == 0) { $seq = $psi };  # 2016mar15: for the $seq of a subject
  if ($pos == 5 || $pos == 7) {  # 2016mar15: if noun or pronoun...
    $seq = 0;  # 2016mar15: until set by the $seqneed mechanism...
    if ($seqneed == 0) { $seqneed = 8 } # 2016mar15: if start of input sentence...
    if ($seqneed == 5) { $seqneed = 0 } # 2016mar15: for subject only
  }  # 2016mar15: 
  if ($pos == 5 || $pos == 7) { $actpsi = $psi }  # 2016JUL10: for ReEntry() & SpreadAct()
  if ($pos == 5 || $pos == 7) {$qv1psi = $psi}   # 2017-11-24: SUCCEEDS AS A BUGFIX
  if ($qucon == 0) { # 2017-11-24: not during who-queries:
    if ($pos == 5 || $pos == 7) { $qv1psi = $psi }  # 2017-09-17: subj. for SpreadAct
  }  # 2017-09-26: end of test to prevent interference with who-queries.
  if ($pos == 8) { $qv2psi = $psi }  # 2017-09-17: verb for SpreadAct
  if ($pos == 8) { $seqneed = 5 };  # 2016mar15: if verb, need direct object.
  $act = 0;  # 2016apr27: reset to prevent carry-over
  $finlen = 0;  # 2017-12-26: reset to prevent carry-over. 
  $prc = 0;  # 2017-12-26: reset to prevent carry-over. 
  $pre = 0;  # 2016mar12: Reset to prevent carry-over. 
  $rv = 0;   # 2017-09-22: TEST
}  # 2017-09-17: InStantiate() returns to EnParser() or RuParser().


5. Variables for the InStantiate AI Mind-Module

$j -- secondary index beyond "i" for the first inner loop of InStantiate code that implements sideways spreading activation so that the input of a word may cause the activation of not only the word itself in conceptual memory, but also of other concepts associated with the input-word. Since one loop is already searching backwards in time for instances of the input-word in memory using "i" for "index", a different variable must be used to loop through a separate search for any associated concepts when the input-word is found in memory. Then a second inner loop must be based on yet another index variable for yet another associated concept.

$jux -- jux(taposed) concept in @psy array, especially the word "NOT" to negate a verb.

$midway -- dynamically adjustable time-limit for searching backwards in the experiential memory of the AI.

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

$oldpsi -- used in OldConcept to de-globalize "psi"

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

$pre -- pre(vious) associated @psy concept.

$prevtag -- local pre(vious) tag for use in InStantiate(). After a noun or a verb has been instantiated, $prevtag holds its concept-number ready to be inserted as a $pre tag, if needed, during the instantiation of a succeeding concept. Thus a verb can have a $pre back to its subject, and a direct object can have a $pre back to a verb.

$psi -- variable for an element of the @psy conceptual array, with a numeric identifier serving as an mtx tag for the same concept in another language.

$qucon -- query-condition – segregates SpreadAct() code to respond to input who-queries.

$qv2psi -- concept for SpreadAct to seek as a verb, so that the AI may remember ideas containing the same verb.

$qv4psi -- concept for SpreadAct to seek as a direct object, so that the AI may use the target concept as a subject or as a direct object in the remembrance of ideas.

$qvdocon -- query-condition for who+verb+direct-object – segregates SpreadAct() code to respond to input queries similar in form to "Who makes robots?"

$tpu -- time-pen-ultimate before current I/O (input and output).

$tult -- t penultimate, or time-minus-one.

$tvb -- time-of-verb for parsing. The EnParser module sets "t - 1" as the tvb if the word being parsed is a verb by part-of-speech. InStantiate uses the time-of-verb tvb to fill the tkb-slot in a verb-panel with the time-location of the direct object of the verb. EnParser uses the time-of-verb tvb to find the numeric verb-concept that will be the pre of a direct object being parsed. EnParser also uses the time-of-verb tvb to store the time-of-direct-object tdo as the tkb in the flag-panel of the verb. Therefore the tvb-flag needs to be reset to zero not during but after AudInput, when program-flow has returned to the Sensorium module.

$usx -- a transfer variable for InStantiate to transfer the concept number of an incoming noun to whichever us1-us7 upstream variable is up next in the rotation of up to seven recently mentioned noun-concepts, so that the EnArticle module may insert the definite article "the" before any noun currently under discussion in a conversation or an internal thought.

$whatcon -- SpreadAct() flag for condition of answering a what-query


6. Troubleshooting and Robotic Psychosurgery

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


7. Future Development


8. Resources

Please see

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

http://github.com/PriorArt/AGI/wiki/MindGrid

http://github.com/kernc/mindforth/blob/master/wiki/InStantiate.wiki

http://en.wikipedia.org/wiki/Grandmother_cell

http://www.scholarpedia.org/article/Binding_by_synchrony


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.