Summon the AI4U Textbook Mind into your presence with MSIE.

The Listen Module of the Mind.Forth AI Breakthrough
by Mentifex

1. Theory of AI Textbook Algorithm Steps: Code the Listen Mind-Module

  /^^^^^^^^^^^\                        _____      /^^^^^^^^^^^\
 /visual memory\    | | |             /New- \    / Listen()    \
|   _______     |   | | |    _____   (Concept)--|-------------\ |
|  /old    \    |   | | |   /Old- \   \_____/   |  audRecog() | |
| / image   \---|-----+ |  (Concept)----|-------|----------\  | |
| \ recog   /   |  a|C|f|   \_____/-----|-------|-------\  |  | |
|  \_______/    |  b|O|i|        |______|       |  c    |  |  | |
|               |  s|N|b|       /Parser()\      |   a   |  |  | |
|               |  t|C|e|       \________/      |    t  |  |  | |
|               |  r|E|r|   ________|______     |     s-/  |  | |
|               |  a|P|s|  /               \    |  e       |  | |
|               |  c|T| | (  Instantiate()  )   |   a      |  | |
|   _______     |  t| | |  \_______________/    |    t-----/  | |
|  /new    \    |   |_|_|  / _____      _____   |  f          | |
| / percept \   |  /     \/ / En  \    / En  \  |   i         | |
| \ engram  /---|--\ Psi /-/ Nouns \--/ Verbs \ |    s        | |
|  \_______/    |   \___/  \_______/  \_______/ |     h-------/ |

http://mind.sourceforge.net/diagrams.html shows a Theory of Mind.

The Listen module enables an intelligent robot to simulate
hearing in humans. There are two important considerations here
for programmers who wish to port the AI to other languages, or
to enhance the sufficient but minimal complexity of the AI Mind.


2. To Listen Is To Be Event-Driven

In the language that you choose for re-implementing the structures
of the Robot AI Mind, it is quite essential that you find a way to
poll the keyboard for human input without stopping the AI program,
that is, without forcing the aLife routine to stop thinking while
passively waiting for the input which may or may not be coming.
Your AI program will need to include either a feature of letting the
user interrupt the robot thought processes, or a subroutine which
waits for an arbitrarily brief time to see if anyone is communicating.

The second consideration is that robot AI programs must eventually
improve the AI algorithm and use speech recognition to capture and
record the actual phonemes of human speech.


http://mind.sourceforge.net/ai4u_157.html is an overview of Mind.


3. JavaScript free Seed AI source code with free User Manual
// Listen() is called automatically when the user
// types a character into the HTML FORM INPUT area.
function Listen() {  // ATM 2aug2002; or your ID & date.
  quiet = false;  // So that aLife() will not yet call Think().
  fyi = "Calling the Listen module; when done press [ENTER]";
  Voice(); // Display the Voice:brain fyi message.
  inert = 0; // Upon input, retreat from calling Ego().
  pov = "*"; // symbol to display "external" point-of-view
  document.onkeypress = function (evt) {
    c = event.keyCode;
    if (c == 27) Shutdown(); // on [ESCAPE] key...
    // Let user input bring a dead AI back to life.
    if (c != 27) { // If a key other than [ESCAPE] is pressed...
      if (life == false) { // ... and if the AI has been "killed"...
        life = true; // give the AI another chance to live.
        fyi = ("AI alive again.");
      } // end of inner if-clause
    } // end of outer if-clause
    pho = String.fromCharCode(c);
    if (hardcopy == true) { // if Transcript is checked "on"
      inbuffer += pho; // Build up a line of user input.  
    } // end of if-clause testing for Transcript mode.
    ++t; // immediate increment of time right now
    if (eot == 13) {
      beg = 1;  // Reset the beg(inning?) flag to 1=true.
      c = 32; // as if SPACE-BAR "32" were pressed
    } // end of if-clause checking for carriage-return
    if (c == 32) Audition();
    beg = 1; // word beg(inning?) 1=true as default setting.
    ctu = 1; // a default changed only by Audition().
    // Uppercase for convenience in comparisons:
    pho = pho.toUpperCase();
    onset = (spt + 1);
    if (onset == t) beg = 1; // ...if a word is beginning...
    else beg = 0; // i.e., not a word-beginning
    // Only call audSTM if input is higher than SPACE-BAR 32:
    if (c > 32) {
      len = (len + 1); // keep track of length of word
      audSTM(); // which obtains "psi" from audRecog()
    } // end of if-clause checking for alphabet characters
    c = " "; // Reset for safety, e.g., blank audNodes.
    pho = " "; // Reset for safety, e.g., blank audNodes.
    return true;  // The work of the module is done.
  } // End of "document.onkeypress"
} // End of Listen() for each character of user input.

4. Mind.Forth free artificial general intelligence with User Manual
\ LISTEN is attentive for the entry of a single keystroke.
:  LISTEN  \ ATM 29jul2002; or your ID & date.
  rsvp @  1  DO  \ Value may be tailored to the CPU speed.
    KEY? IF      \ If a character from a key is waiting,
      KEY pho !  \ get a pho(neme) keystroke from the user.
      0 inert !  \ No need to call EGO.
      \ 25jul2002 Eliminate "quiet", set "pov" instead?
      0 quiet !  \ Zero means that user input is in progress.
      pho @ 27 = IF  \ If ESCape key "27" is pressed...
        CR
        CR ." User Command:  halt"  0 pho !  0 rjc !
        CR ." You may enter .psi .en .aud to view memory engrams, or"
        CR ." ALIFE [ENTER] to erase all memories and restart the Mind."
        CR
        QUIT
      THEN
      pho @ EMIT   \ Display the character on-screen.

      \  Next lines convert all ASCII input to upper case:
      pho @ DUP 96 > IF
        DUP 123 < IF
          32 -
        THEN
      THEN  pho !    \ Save the uppercase value as "pho" again.

      LEAVE  \ Abandon loop upon keypress
      ELSE
      ."  "  \ Show EITHER a keystroke OR a blank.
    THEN
    8  EMIT  \  This backspace is paired with the ELSE line.
  LOOP
  t @  1 +  tov !   \ 29jul2002 To reset robotic output-display.
;  \  End of LISTEN; return to AUDITION.

http://mind.sourceforge.net/m4thuser.html is the Mind.Forth User Manual.

http://mind.sourceforge.net/variable.html explains the Seed AI variables.


5. Analysis of the Modus Operandi

The JavaScript code for Listen and the Forth code for Listen
are quite different because JavaScript is event-driven, while
Forth must actually take time out to check for human input.

When the input to Mind.Forth is actually the reentry of its output,
Mind.Forth bypasses the Listen module and feeds Speech data directly
into the Audition module, obviating the need for a Reentry module.

The AI source code (q.v.) of the Listen module records keystrokes
coming in from the human user. A more advanced AI may use speech
recognition to process and store phonemes.

The Listen function is so quintessentially passive that it
lends itself to an astronomically (think: SETI) enormous range
of situations and applications. The event to trigger the AI
may be specified so strictly and so exceptionally that the
MTBA (mean time between alerts) might stretch on for years.

Imagine being able to walk anywhere inside a large building
while an AI Mind listens attentively for the slightest word
issuing uniquely from your lips in your own unmistakable voice.
You are free to roam, while the building maintenance AI or the
guardian angel AI is on high alert through a vast audio network.

Now imagine a SETI AI that listens to the cosmos in ways unthinkable
to even the most sophisticated human being. Because only the event
of alien contact triggers the AI, no AI effort is expended.


6. Troubleshooting and Robotic Psychosurgery

Try in advance not to introduce any evolutionary bugs.

The AI Debugger program may shed some light in general on how to debug
and troubleshoot programs in artificial intelligence.


7. Listen Resources for Seed AI Germination and Evolution


The Listen mind-module is the subject of Chapter 25
in your POD (print-on-demand) AI4U textbook,
as worthily reviewed and intellectually evaluated
by Mr. Christopher Doyon of the on-line Turing Store; and
by Prof. Robert W. Jones of Emporia State University.
A search on eBay may reveal offerings of AI4U and
a catalog search for hardbound and paperback copies
may reveal libraries beyond the following where students
of artificial intelligence may borrow the AI4U textbook:
  • Hong Kong University Call Number: 006.3 M981
  • North Carolina State University (NCSU) Call Number: Q335 .M87 2002
  • Texas A&M University
    Consider http://www.bookcrossing.com as a way to
    circulate and track your wandering copy of AI4U.
    At your own library you may submit a request for
    the acquisition of AI4U with ISBN 0595654371.


    Return to top; or to sitemap; or to
    C:\Windows\Desktop\Mind.html
    [For the above link to work, copy to your local hard disk
    http://mind.sourceforge.net/Mind.html
    and name it Mind.html in the C:\Windows\Desktop\ directory.]

    SourceForge Logo