MindForth Programming Journal
AI4U Blog -- Mon.25.AUG.2008


1. Tasks in Creating Artificial Intelligence for AI Mind Exhibits

[ ] Expand the Article module with "a" as a default.
[ ] Introduce intransitive verbs of being and becoming.
[ ] Recruit Motters to implement the visual recognition system.
[ ] Increase the size of the cns memory capacity.

[ 24.AUG.2008] Add a "num" (number) flag to the flag-panel of the psi array.
[ 25.AUG.2008] Create an Article module to be called by the nounPhrase module.


2. Mon.25.AUG.2008 - INTRODUCING THE ARTICLE MODULE

Yesterday in our first new release of Mind.Forth since 1.FEB.2008,
we added a "num(ber)" flag to the flag-panel of the psi concept array.
We need the "num" flag to govern the automatic selection of articles
and verb-forms during the generation of a sentence of thought.
Now we will proceed to create the Article module in MindForth,
but we expect it to be very difficult to troubleshoot and debug
the Mind expanded with the addition of the Article module, because
some of our early mind-design principles were too arbitrary and
too much of an ad-hoc nature -- just to get the AI up and running.
If we are lucky, the relaxation of strictures and bottlenecks,
forced upon us by the need to accommodate the Article module,
should contribute to an overall improvement in the architecture
of the AI Mind. First we create the module with two lines of code.
:  Article ( select "a" or "the" before a noun )  \ 25aug2008

;  \ 25aug2008 End of Article; return to nounPhrase.
Next we "fload" 25aug08A.F and enter "alife" to test the code.
The AI runs, and it loops through a chain of suggested thought.
Now we need to "populate" the new module with some code that
will cause Article to insert "THE" into a sentence of thought.

As we did on 23.AUG.2008 in the JavaScript AI source code, we
borrow from the negSVO module some code that finds the word "NOT"
and we make the code instead find "THE" in auditory memory.
  midway @  t @  DO  \ Look backwards for 7=the.
    I       0 en{ @  7 = IF  \ If #7 "the" is found,
      7 motjuste !  \ "nen" concept #7 for "the".
      I     5 en{ @  aud !  \ Recall-vector for "the".
      LEAVE  \ Use the most recent engram of "the".
    THEN  \ End of search for #7 "the".
  -1 +LOOP  \ End of loop finding the word "the".
  SPEECH  \ Speak or display the word "the".
We insert the mutatis mutandis code into the Article
module and we run the AI Mind. Nothing unusual happens;
we are just making sure that the AI still functions. Perhaps
we should relax a bit; Forth is a lot more forgiving than
JavaScript is when you change some code. Forth even lets
us run the Article module all by itself by entering "Article".
Article THE  ok
Now we need to do the scary part -- inserting a call to
the Article module inside the nounPhrase module. It is
scary because on 23.AUG.2008 the JavaScript AI began to
malfunction after we had nounPhrase call the Article
module, and we did not enjoy trying to troubleshoot
the problem in JavaScript, so we switched into Forth.
Once we reestablish AI Mind functionality in Win32Forth,
it should be simple to port the solution into JavaScript.

Well, now Mind.Forth is just as berserk as the JSAI is.
The call from nounPhrase to Article makes the AI demented.
We get the following exchange.
Human: cats eat fish
Robot: THE YES  WHAT DO THE DO
The difference between coding the JSAI and MindForth is that
with MindForth we have powerful tools for troubleshooting.
Hmm... Maybe we need to omit from Article the line of code:
     7 motjuste !  \ "nen" concept #7 for "the".
The article "the" is not a "motjuste" for anything;
it is simply a word that we want the AI to think,
under certain circumstances governed by psi-flags.

When we comment out the "motjuste" line and
run the AI, we get the following exchange.
Human: cats eat fish
Robot: THE YES  WHAT DO FISH DO
Human: fish eat bugs
Robot: THE YES  WHAT DO BUGS DO
Human: bugs eat germs
Robot: THE YES  WHAT DO GERMS DO
Human: germs kill cats
Robot: THE YES  EAT THE YES
Robot: THE YES  EAT THE YES
Robot: THE YES  EAT THE YES
Robot: THE YES  EAT THE YES
Robot: THE YES  EAT THE YES
It looks as though our AI is failing to express
a subject. At the end, it is failing to say,
"THE CATS EAT THE FISH" -- as it otherwise would
say, because the conversation started with that fact.

In connection with the "motjuste" problem, it makes
sense that the Article module does not need for "the"
to be a "motjuste" selection. The word "the" is not
chosen by a confluence of mental associations in
spreading activation. Instead, the choice of "the"
is imposed upon a nascent thought by conceptual "psi"
flags operating under such influences as the proximity
of a concept currently being thought about.

After the initial human input of "cats eat fish", the AI
is saying "YES" instead of "FISH" because it is searching
in vain for the most active concept and finds "YES" as
the first concept at the very start of bootstrap memory.

Well, maybe not. As we run the old and new MindForth in
Diagnostic mode, it dawns on us that we may have placed
the Article-call too far down in the nounPhrase module --
below the call to nounAct. So let's move the Article-call
up above the nounAct-call and see what happens. Now we get:
Human: cats eat fish
Robot: THE YES  WHAT DO FISH DO
Human: fish eat bugs
Robot: THE YES  WHAT DO BUGS DO
Human: bugs eat germs
Robot: THE YES  WHAT DO GERMS DO
Human: germs kill cats
Robot: THE YES  WHAT DO CATS DO
Human: cats eat fish
Robot: THE YES  WHAT DO FISH DO
Human: fish eat bugs
Robot: THE YES  WHAT DO BUGS DO
Human: bugs eat germs
Robot: THE YES  WHAT DO GERMS DO
Human: germs kill cats
Robot: THE YES  WHAT DO CATS DO
Human: cats eat fish
Robot: THE YES  WHAT DO FISH DO

Maybe the word "THE" is being recognized internally and being
given too much activation, so that it interferes in the process
of generating a thought. Therefore let us try "subactivating"
the word "THE" in the oldConcept module. Hmm, that action
does not seem to help much.

In Diagnostic mode, just before the AI erroneously says "THE YES",
we notice that nounAct apparently is not being called with the
right psi concept number as a parameter:
  from oldConcept
    Calling nounAct (not in AI4U). psi = 0
YES
So maybe the calling of Article and the internal recognition
of "THE" by oldConcept are wiping out the proper value of "psi"
for the call from nounPhrase to nounAct. If so, we have made
one of those "digitum nescius exseres -- peccas" mistakes;
that is, "If you even stick your finger out without knowing
what you are doing, you are in the wrong." We plunked the
Article-call down within the nounPhrase module, not really
knowing that our global variables would not be able to handle
the interruption. But we can create a "nactpsi" variable
to hold onto the value of "psi" during the call to Article.
Then, after the return from Article, we can restore "psi"
from the "nactpsi" holder. No, maybe we should call it
"articpsi" to make it clear that the variable keeps track
of psi during the call to Article. No -- again. All we have
to do is assign the value of "motjuste" to "psi" not before
the call to Article, but after the call to Article, so that
the proper value of psi goes into nounAct. Let's try that idea.

Aha! The idea about "motjuste" did not do much good, but
we found out something by inserting a diagnostic test line
into nounPhrase immediately before the call to SPEECH:
 ." nPh into Speech psi & aud = " psi @ . ." & " aud @ .  \ 25aug2008 Test
The temporary line of diagnostic code above tells us the
values of "psi" and "aud" going into SPEECH.
Transcript of AI Mind interview at 18 24 40 o'clock on 25 August 2008.
cats eat fish

Robot: THE nPh into Speech psi & aud = 78 & 0 
So even though the correct "psi" of "78" for "FISH" is at hand,
the SPEECH module is being sent an auditory engram-fetch value
of zero, which defaults to the word "YES", since "YES" is the
first word in auditory memory -- put there by the "enBoot"
English bootstrap. Now we are making some progress.

Now we seem to have solved our current problem by creating
the "audjuste" variable to hold onto the value that nounPhrase
must send into SPEECH to speak the selected "motjuste" noun.
We get the following output in Transcript display mode:
Transcript of AI Mind interview at 18 48 46 o'clock on 25 August 2008.
cats eat fish

Robot: THE nPh into Speech psi & aud = 78 & 213 FISH
WHAT DO FISH DO

Robot:  THE FISH  WHAT DO FISH DO
Human:
The AI has regained its ability to be coaxed into a looping
chain of thought after the input of a circular set of statements.
We reliably obtain the following dialog with the AI Mind.
Human: cats eat fish
Robot: THE FISH  WHAT DO FISH DO
Human: fish eat bugs
Robot: THE BUGS  WHAT DO BUGS DO
Human: bugs eat germs
Robot: THE GERMS  WHAT DO GERMS DO
Human: germs kill cats
Robot: THE CATS EAT THE FISH
Robot: THE FISH EAT THE BUGS
Robot: THE BUGS EAT THE GERMS
Robot: THE GERMS KILL THE CATS
Robot: THE CATS EAT THE FISH
We have successfully expanded the AI Forthmind with an
Article module that inserts the article "THE" before nouns
during the thinking of a thought. Of course, we do not
want Article always to insert the word "THE"; we are just
doing so as a test of the software. We are thinking of
using the variable "ghost" as a flag to govern the use
of the article "THE" when an AI speaker is referring to
a subject currently under discussion. If the AI says,
"I have a book. I like the book," then the article "a"
can appear by default, while the "ghost" variable is
being set with a momentary flag-value, so that the
next selection of the "book" concept will come after
the definite article "THE" because of the "ghost" flag --
as if the ghost of the recent idea is exerting an influence.


3. Mon.25.AUG.2008 - IMPROVING THE SPEECH MODULE

We could perhaps improve the SPEECH module by letting it
accept a wide range of parameter variables from a wide range
of modules. For example, the SPEECH module could transfer
an "audjuste" value from nounPhrase or verbPhrase to "aud"
or "onset" or whatever it used to find locations in auditory
memory. Then any module could deliver its own variable to
SPEECH, and SPEECH would simply test the whole list of
variables for a positive value. We assume that variables
not currently calling SPEECH would carry a value of zero.


4. Mon.25.AUG.2008 - UPLOADING MINDFORTH AI

Our new code is successful, and it demonstrates the
insertion of "THE" by an Article module. We should upload to
http://mind.sourceforge.net/mind4th.html -- the main
source of MindForth on the Web. Although it is not ideal
to have the AI constantly insert the word "THE" before nouns,
we follow the advice of Linus Torvalds to release early and
release often.


5. Notes

Potential topics for initial writings in journal webpages
- Are people competing to have the oldest or longest-living AI Mind?
- Is AI being created in secret by large, powerful organizations?
- CS textbooks should be written from an AI POV.
- These MFPJ journal entries are tantamount to a weblog.
---- (Mention how Jorn Barger created the very first weblog.)
- To what extent is Mentifex AI causing any AI evolution?
- People in other countries, especially India, are welcome to the AI.
- Living a Sci-Fi Life
- Living in a Fool's Paradise


6. Resources

For discussion of MindForth, visit the Usenet newsgroups
comp.lang.forth
comp.robotics.misc


7. Associated pages

Modules of the AI-Complete Mind-Expansion
23.AUG.2008 -- the Article module;
03.SEP.2008 -- the kbTraversal module;
17.SEP.2008 -- the kbSearch module.
25.SEP.2008 -- the beVerb module.

http://AIMind-i.com

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

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

JavaScript AI Mind Programming Journal
http://mentifex.virtualentity.com/js080815.html
http://mentifex.virtualentity.com/js080816.html
http://mentifex.virtualentity.com/js080819.html
http://mentifex.virtualentity.com/js080822.html
http://mentifex.virtualentity.com/js080823.html
http://mentifex.virtualentity.com/js080826.html
http://mentifex.virtualentity.com/js080904.html

MindForth Programming Journal
http://mentifex.virtualentity.com/fp080824.html
http://mentifex.virtualentity.com/fp080825.html
http://mentifex.virtualentity.com/fp080827.html
http://mentifex.virtualentity.com/fp080829.html
http://mentifex.virtualentity.com/fp080831.html
http://mentifex.virtualentity.com/fp080901.html
http://mentifex.virtualentity.com/fp080903.html
http://mentifex.virtualentity.com/fp080912.html
http://mentifex.virtualentity.com/fp080917.html
http://mentifex.virtualentity.com/fp080925.html
http://mentifex.virtualentity.com/fp080927.html


Return to the
top of this page or to the
main index page.