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

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.

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

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.


4. Code of InStantiate() from the ghost270.pl AI Mind 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) {  # 2017u-09-17: only during external input, not re-entry
    if ($psi == 791)  {  # 2017-09-17: upon input of 791=WHO
      if ($qucon == 0)  {  # 2017-09-17: to set only once per input idea
        $qucon = 1;  # 2017-09-17: set positive to process rest of input.
      }  # 2017-09-17: end of test for $qucon at zero.    
    }  # 2017-09-17: end of test for input of 791=WHO
    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.    
    }  # 2017-11-27: end of test for input of 781=WHAT
  } # 2017-11-27: end of test for point-of-view to be 2=pov external for input.
  if ($qucon > 0) {  # 2017-09-26: 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) { # 2017-09-26: if verb but not 800=BE
      $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.
  }  # 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 != 830) { # 2017-11-27: if verb but not 830=DO
      $qv2psi = $psi;  # 2017-11-27: for transfer as query-verb to SpreadAct. 
    }  # 2017-11-27: end of test for verb other than auxiliary 830=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.
# print "\n InSta: at tvb= $tvb storing k1= $k[1] k12= $k[12] tkb= $tkb \n"; # 2018-07-05: TEST
    $psy[$tvb]="$k[0],$k[1],$k[2],$k[3],$k[4],$k[5],$k[6],"  # 2017-06-30
    . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$tkb,$k[14]";  # 2017-06-30: insert $tkb
#   . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]";  # 2018-07-03: TEST
  }  # 2017-09-18: end of test for no suppression of associative tag $tkb
   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) {  # 2017-06-24: increment only if there is a match
        if ($psi == 781) { $k[3] = 0 } # 2017-11-27: upon input of 781=WHAT
# print "\n InSta: i= $i k1= $k[1] act=32 k13= $k[13] \n";  # 2018-07-03: TEST
#       $psy[$i]="$k[0],$k[1],$k[2],32,$k[4],$k[5],$k[6],"      # 2017-06-08 
        $psy[$i]="$k[0],$k[1],$k[2],16,$k[4],$k[5],$k[6],"  # 2018-07-06: prevent repetition
        . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]";  # 2017-06-08
      } # 2016-06-24: end of test for matching concept.
    }  # 2016jun26: end of (for loop) searching backwards in time.
  $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;
# print "\n InSta: at tult= $tult for k1= $k[1] storing act= $act \n"; # 2018-07-05: TEST
  $psy[$tult]="$k[0],$k[1],$k[2],act,$k[4],$k[5],$k[6],"  # 2018--07-03: insert $act
  . "$k[7],$k[8],$k[9],$k[10],$k[11],$k[12],$k[13],$k[14]";   # 2018-07-03: concatenate
# if ($verbcon == 1 && $tdo > 0) { $tkb = $tdo}  # 2017-06-25: TEST 
# if ($verbcon == 1 && $tdo > 0) { $tkb = $tdo}  # 2017-09-19: COMMENTING OUT AS TEST
  if ($tkb == $tdo) { $tkb = 0 }  # 2017-09-19: prevent direct-object $tkb
# if ($tkb == $tdo) { $tkb = 0 }  # 2017-09-20: COMMENTING OUT AS TEST
# if ($pos == 8) { $tkb = $tdo };  # 2017-09-20: after a verb; TEST
  # 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 eq "ru") {  # 2017-09-10: 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. Troubleshooting and Robotic Psychosurgery

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

6. Variables

$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


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.