Yesterday we inserted a grammatical "num(ber)" variable into
the associative-tag flag-panel of the psi array for concepts.
With merely the new tag present, there was no new functionality
in the JavaScript AI Mind. Now that the "num" tag is available
to us, however, we may exploit its presence by creating an
Article() module that will try to say "a" or "the" for nouns
in the singular and will try to say "the" but not "a" for
nouns in the plural. Previously we could not implement articles
if we did not have a control-flag like "num" to determine
which article should be thought or spoken.
We should not only create the Article() module but also
http://mentifex.virtualentity.com/article.html as a webpage
to document the new mind-module. We may even have to create
a new ASCII diagram to illustrate the function of articles
in the thinking of the artificial Mind. Luckily, about ten
years ago, the creator of the very first weblog ever --
Jorn Barger of Robot Wisdom fame -- communicated to
Mentifex here how to use the HTML "PRE" tag to make
ASCII diagrams line up properly and retain their format.
Jorn Barger also created an AI Timeline. He is described at
http://en.wikipedia.org/wiki/Jorn_Barger on the Web.
Since Jorn Barger has not yet received the MacArthur grant that
he deserves, people should donate to his weblog and leave him
a stipend in their will. The world needs people like Jorn Barger.
We had better create the module first and then its webpage.
The first question is where to insert it in the free AI
source code. In JavaScript the location of a module does
not matter, but the location can be a show-stopper in the
Forth programming language. Therefore we will decide the
location with respect to MindForth, and then use the same
location in the JSAI.
As we peruse the MindForth source code, we realize that
the Article() module should probably come just before
the nounPhrase() module, which will be invoking it.
So let's open up the JavaScript AI source code and
create an Article() module. Okay, we stubbed in the
new module and the software still runs. Now we need to
flesh out the module with the ability to do something.
Let's give Article() the ability to say "THE" as a
typical output.
Since the definite article "THE" is psi concept number
seven (7) in these primitive AI Minds, we can borrow
some code from the JSAI negSVO() module, which looks
backwards in the English lexical array until it finds
the most recent instance of using the word "NOT" in
the generation of a sentence of negation. We will modify
the code snippet to look for "THE" instead of "NOT".
Here is the new code.
for (i = t; i>midway; i--) { // Look backwards for 7="the".
enLexicon[i].enExam(); // Inspect the English nodes.
if (en0 == 7) { // If the #7 concept "the" is found...
motjuste = 7; // "nen" concept #7 for "the";
aud = en5; // Auditory recall-vector for "the".
break; // Finding one engram is enough.
} // End of search for #7 "the".
} // End of loop finding the word "the".
Speech(); // Speak or display the word "the".
Now we have tested the JSAI program and it still runs,
which suggests that we have not broken the AI Mind by
inserting the Article code into it. But now we must
test for new functionality by inserting a call to the
Article() module inside the nounPhrase module.
Oh gee, where are we going to put the call?
The nounPhrase module needs to have already selected
the noun that it is literally thinking about.
We can not just call up an article at the start
of nounPhrase, because the selected noun is going to
have a "num(ber)" flag that helps to determine which
article to select, and whether there should even be
an article. We don't want the pronoun "us" to be
expressed as "the us". So we want to insert the
article-call after the selection of the noun but
before the SPEECH of the noun. Okay, we are
putting in the article-call almost immediately
prior to the SPEECH-call that speaks the noun.
Let's cross our fingers and see what happens
when we run the AI.
Huh? Oh, no. Its the AI from Berzerkistan. It has
gone berserk. We obtained the following exchange.
Human: cats eat fish
Robot: THE WHAT
We want it to say, "The cats eat the fish,"
but obviously some evil force is interfering with
the way we create our AI software. From invoking
the Diagnostic display, we can observe that the AI
is trying to insert a dummy concept (#79) between
"THE" and "WHAT". Now, the AI is indeed supposed to
say "WHAT" when it can not find a sufficiently active
verb. The problem here is, why did the AI not just
add "THE" into the conversation, before each noun?
We may have invalidated a variable by inserting
the call to the Article() module into nounPhrase().
Now we have created a new "nounaud" variable to hold
onto the valid value of "aud" during the operation of
the Article() module which sends a THE-fetch into the
Speech module. The Speech module goes into auditory
memory and pronounces any word starting in memory
at the aud-value time-point. We get better output.
Human: cats eat fish
Robot: THE FISH WHAT
Human: fish eat bugs
Robot: THE FISH WHAT
Robot: THE FISH WHAT
Robot: THE FISH WHAT
Human: bugs eat germs
Robot: THE FISH WHAT
Robot: THE FISH WHAT
Human: germs kill cats
Robot: THE FISH WHAT
It's enough to make you pull your hair out.
Here we have arguably the most advanced AI
in the world -- it actually thinks -- but
getting it to accept a new mind-module is
like pulling teeth. The AI is not yet stable
enough to upload, and the coding is taking forever.
Now, why can't the AI stop thinking about FISH
when the human user tries to change the subject?
Why am I not down at the bottom of Green Lake,
diving for treasure, instead of coding an AI idiot?
Oh well, back to the salt mines.
Hmm... Here is maybe the source of the problem.
When the user tries to change the subject, the
fetch of "THE" may also be reactivating the word
that was most recently associated with "THE" --
which happens to be "FISH". Somehow we may need
to keep "THE" from forming permanent associations.