OutBuffer module of the

First Working AGI Mind in JavaScript

MindForth for robots -- ghost.pl for webservers


1. Diagram of the OutBuffer Mind-Module


  /^^^^^^^^^^^\OutBuffer has right-justified words/^^^^^^^^^^^\
 /   EYE       \            _________________    /    EAR      \
|               |CONCEPTS  /    Volition     \  |  ___________  |
|   _______     |   | | |  \_________________/  | / MindBoot  \ |
|  / old   \    |   | | |   _|___      _|____   || memory vault||
| / image   \!!!|!!!|!|!|  /     \    /      \  ||             ||
| \ recog   /---|---|-|-+ (EnThink)  (RuThink ) || "students"  ||
|  \_______/    |   |s| |  \_____/    \______/  || "read"      ||
|               |   |t| |          _____|______ || "books"     ||
|               |   |u| | _____   (RuIndicative)| \___________/ |
|               |   |d|b|| Ru- \   \__________/ |               |
|   visual      |  r|e|o|| Noun-\  / ___|____   |               |
|               |  e|n|o|| Phrase\/ / RuVerb-\  |  Я            |
|   memory      |  a|t|k||_______/ /  Phrase  \ |  ЧИТАЮ        |
|               |  d|s|s|          \__________/ |  КНИГИ        |
|   channel     |   | | |   _________|_____     |               |
|               |   | | |  /   RuVerbGen   \    |  ТЫ           |
|               |   | | | (     ЧИТАЕШЬ     )   |  ЧИТАЕШЬ      |
|   _______     |   | | |  \_______________/    |  КНИГИ        |
|  /new    \    |   | | | ___|_____   ___|_____ |               |
| / percept \   |   |_|_||AudBuffer| |OutBuffer||               |
| \ engram  /---|---(Psy)|ЧИТАЮ    | |    ЧИТАЮ||               |
|  \_______/    |    \_/ |_________| |_________||               |


2. Purpose

The OutBuffer module serves the purpose of right-justifying a word in English or Russian or any other natural language so that the AI Mind may change any initial inflected ending into any desired inflectional ending. In order to identify any pre-existing inflection and to determine the stem of a word, a module like RuVerbGen needs to test for the contents of the last few buffer-variables in a right-justified word.


3. Function

The OutBuffer module first erases all data stored in it as the values of the buffer variables. Then OutBuffer converts all the left-justified characters in the AudBuffer into right-justified characters in the OutBuffer, so that a module like EnVerbGen (for thinking in English) or RuVerbGen (for thinking in Russian) may manipulate the right-justified endings, or inflections, stored in the OutBuffer.


4. Code of OutBuffer() from ghost294.pl First Working AGI in Perl


sub OutBuffer() {  # http://ai.neocities.org/OutBuffer.html
  $b01=""; $b02=""; $b03=""; $b04=""; $b05=""; $b06="";  # 2016apr02
  $b07=""; $b08=""; $b09=""; $b10=""; $b11=""; $b12="";  # 2016apr02
  $b13=""; $b14=""; $b15=""; $b16="";  # 2016apr02: clear tabula rasa;
  if ($c16 ne "") {  # 2016apr03: if the AudBuffer is full; 
  $b16=$c16; $b15=$c15; $b14=$c14; $b13=$c13;  # 2016apr02
  $b12=$c12; $b11=$c11; $b10=$c10; $b09=$c09;  # 2016apr02
  $b08=$c08; $b07=$c07; $b06=$c06; $b05=$c05;  # 2016apr02
  $b04=$c04; $b03=$c03; $b02=$c02; $b01=$c01;  # 2016apr02
  return;    # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 16-character word;
  if ($c15 ne "") {  # 2016apr03: if the word is only 15 characters
    $b16=$c15; $b15=$c14; $b14=$c13; $b13=$c12; $b12=$c11; $b11=$c10;
    $b10=$c09; $b09=$c08; $b08=$c07; $b07=$c06; $b06=$c05; $b05=$c04; 
    $b04=$c03; $b03=$c02; $b02=$c01; $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02:  end of transfer of a 15-character word;
  if ($c14 ne "") {  # 2016apr03: if the word is only 14 characters
    $b16=$c14; $b15=$c13; $b14=$c12; $b13=$c11; $b12=$c10; $b11=$c09;
    $b10=$c08; $b09=$c07; $b08=$c06; $b07=$c05; $b06=$c04; $b05=$c03;
    $b04=$c02; $b03=$c01; $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of a 14-character word;
  if ($c13 ne "") {  # 2016apr03: if the word is only 13 characters
    $b16=$c13; $b15=$c12; $b14=$c11; $b13=$c10; $b12=$c09; $b11=$c08;
    $b10=$c07; $b09=$c06; $b08=$c05; $b07=$c04; $b06=$c03; $b05=$c02;
    $b04=$c01; $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of a 13-character word;
  if ($c12 ne "") {  # 2016apr03: if the word is only 12 characters
    $b16=$c12; $b15=$c11; $b14=$c10; $b13=$c09; $b12=$c08; $b11=$c07;
    $b10=$c06; $b09=$c05; $b08=$c04; $b07=$c03; $b06=$c02; $b05=$c01;
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02:  abandon remainder of function; 
  }  # 2016apr02:  end of transfer of a 12-character word;
  if ($c11 ne "") {  # 2016apr03: if the word is only 11 characters
    $b16=$c11; $b15=$c10; $b14=$c09; $b13=$c08; $b12=$c07; $b11=$c06;
    $b10=$c05; $b09=$c04; $b08=$c03; $b07=$c02; $b06=$c01; $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of an 11-character word;
  if ($c10 ne "") {  # 2016apr03: if the word is only 10 characters
    $b16=$c10; $b15=$c09; $b14=$c08; $b13=$c07; $b12=$c06; $b11=$c05;
    $b10=$c04; $b09=$c03; $b08=$c02; $b07=$c01; $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of a 10-character word;
  if ($c09 ne "") {  # 2016apr03: if the word is only 9 characters
    $b16=$c09; $b15=$c08; $b14=$c07; $b13=$c06; $b12=$c05; $b11=$c04;
    $b10=$c03; $b09=$c02; $b08=$c01; $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of a 9-character word; 
  if ($c08 ne "") {  # 2016apr03: if the word is only 8 characters
    $b16=$c08; $b15=$c07; $b14=$c06; $b13=$c05; $b12=$c04; $b11=$c03;
    $b10=$c02; $b09=$c01; $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02:  abandon remainder of function;
  }  # 2016apr02: end of transfer of an 8-character word;
  if ($c07 ne "") {  # 2016apr03: if the word is only 7 characters
    $b16=$c07; $b15=$c06; $b14=$c05; $b13=$c04; $b12=$c03; $b11=$c02;
    $b10=$c01; $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function;
  }  # 2016apr02: end of transfer of a 7-character word; 
  if ($c06 ne "") {  # 2016apr03: if the word is only 6 characters
    $b16=$c06; $b15=$c05; $b14=$c04; $b13=$c03; $b12=$c02; $b11=$c01;
    $b10="";  $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 6-character word; 
  if ($c05 ne "") {  # 2016apr03: if the word is only 5 characters
    $b16=$c05; $b15=$c04; $b14=$c03; $b13=$c02; $b12=$c01; $b11="";
    $b10="";  $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 5-character word; 
  if ($c04 ne "") {  # 2016apr03: if the word is only 4 characters
    $b16=$c04; $b15=$c03; $b14=$c02; $b13=$c01; $b12="";  $b11="";
    $b10="";  $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 4-character word; 
  if ($c03 ne "") {  # 2016apr03: if the word is only 3 characters
    $b16=$c03; $b15=$c02; $b14=$c01; $b13=""; $b12="";  $b11="";
    $b10="";  $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 3-character word; 
  if ($c02 ne "") {  # 2016apr03: if the word is only 2 characters
    $b16=$c02; $b15=$c01; $b14="";  $b13=""; $b12="";  $b11="";
    $b10="";  $b09="";  $b08="";  $b07="";  $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 2-character word;
  if ($c01 ne "") {  # 2016apr03: if the word is only 1 character
    $b16=$c01; $b15=""; $b14="";  $b13=""; $b12="";  $b11="";
    $b10="";  $b09="";  $b08="";  $b07=""; $b06="";  $b05="";
    $b04="";  $b03="";  $b02="";  $b01="";  # 2016apr02
    return;  # 2016apr02: abandon remainder of function; 
  }  # 2016apr02: end of transfer of a 1-character word; 
}  # 2016apr02: OutBuffer() returns to AudBuffer or VerbGen()


5. Variables for First Working Artificial General Intelligence

$b01 -- buffer variable 01 in the OutBuffer() quasi-array

$b15 -- buffer variable 15 in the OutBuffer() quasi-array

$b16 -- buffer variable 16 in the OutBuffer() quasi-array for the right-justifying of an English or Russian word of up to sixteen characters in length. The buffer variable $b16 always contains the very last character in a word of any length. Since each word is right-justified in the OutBuffer(), a module like NounGen() or RuVerbGen() can perform tests on the contents of $b14 and $b15 and $b16 so as to detect one inflectional ending and to replace it with a different ending as necessary. In English, where a noun like "beach" or a verb like "teach" will sometimes need to have "-es" as an ending ("beaches", "teaches"), $b15 and $b16 can be used to detect the "-ch" at the end of the word, as an indicator that the "-es" ending may need to be added on.

$c01 -- the first character of any word stored in AudBuffer().

$c02 -- the second character of any word stored in AudBuffer().


6. Troubleshooting and Robotic Psychosurgery

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


7. Future Development

An AI Mind Maintainer may increase the size of the AudBuffer or the OutBuffer, especially for any natural language containing a vocabulary of especially long words, such as German words like Fliegerabwehrkanone -- which in English becomes flak.


8. Resources


Please see

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


9. AiTree of First Working AGI Mind-Modules


Return to top; or to
http://www.gotai.net/forum -- Russian-language AI forum;
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.