JavaScript AI Mind Programming Journal
AI4U Blog -- Fri.22.AUG.2008


1. Outposts of Artificial Intelligence en Route to AI Mind Installations

[ ] Address the issue of grammatical number in noun and verb concepts.
[ ] Use differential activation in audRecog to recognize word-stems.
[ ] Prime the JSAI to traverse its KB and ask questions about gaps.
[ ] Make Tutorial mode show slosh-over concepts about to be selected.
[ ] Program the JSAI to think on its own at start of running the AI.
[ ] Induce Stephen Reed to build TexAI on the MindForth AI engine.
[ ] Achieve proper balance of determinants of conceptual activation.

[16may2008] In reEntry() implement the "upnext" MWA code from MindForth.
[17may2008] From the verbClear() module fashion a verbClip() module.
[ 16aug2008] Bring JSAI audRecog up to par with MindForth audRecog.
[ 19aug2008] Enable audRecog to recognize plural forms of singular nouns.
[ 22aug2008] Add a "num" (number) flag to the flag-panel of the psi array.


2. Thurs.21.AUG.2008 - GRAMMATICAL NUMBER IN NOUNS AND VERBS

Now that we have gotten the audRecog Module of the AI Mind
to distinguish between the recognition of a singular noun and
the recognition of a plural form of the same noun, it is time
to integrate the handling of grammatical number (i.e., singular,
or dual as in ancient Greek, or plural) in our treatment of
concepts deep within the artificial mind. In fact, grammatical
number may not even be an attribute of a concept but may
instead be a separate but related concept. We need to arrive
at some certainty in our approach to grammatical number
because the issue potentially involves the rather drastic
step of altering the make-up of the panel of flags that we
instantiate with each instance of a concept in subverbal,
conceptual memory.

Gee, this work is mind-design in its most nitty-gritty nature.
As we try to go beyond the most basic, proof-of-concept AI Mind,
we find that we must go back and re-design the Mind that we are
working on. From our 16.AUG.2008 JSAI journal entry, we have the
following display of the conceptual and auditory flag-panels.
Psi mindcore concepts            English lexical fibers       Auditory memory nodes
krt psi act jux pre pos seq enx  krt nen act fex pos fin aud  krt pho act pov beg ctu psi
345. 0                           345. 0                       345. P 0 * 1 1 0
346. 0                           346. 0                       346. E 0 * 0 1 0
347. 0                           347. 0                       347. O 0 * 0 1 0
348. 0                           348. 0                       348. P 0 * 0 1 0
349. 0                           349. 0                       349. L 0 * 0 1 0
350. 0                           350. 0                       350. E 0 * 0 0 37
351. 37 12 0 0 5 56 37           351. 37 0 37 5 37 345        351. 
In the auditory memory channel, grammatical number probably
does not matter, so we probably do not need to change the flags
there. Number probably matters only in the psi conceptual memory
or in the English semantic memory. In both the psi memory and
the English lexical memory, we have the "pos" part-of-speech
flag, which tells us whether a word is a noun or a verb, or
perhaps a pronoun like the plural "they". If we wanted to,
we could pack more information into the "pos" designation
and include grammatical number as one more datum of an instance
of a noun or verb at a node in memory. We could get away from
simple numbers like five (5) for nouns and eight (8) for verbs,
and instead use 50-59 for nouns and 80-89 for verbs. Then we
could say that 51 is a singular noun and 52 is a plural noun.
Likewise, we could decree that 81 is a singular verb and 82 is
a plural verb. In each decade of ordinal numbers, we would have
quite a few numbers left over for other purposes in the future.
But should we have instead a separate flag somewhere for
grammatical number, and not change the current "pos" flag?

In may help us to start imagining how we are going to handle
the treatment of grammatical number in the generation and
comprehension of simple SVO (Subject-Verb-Object) sentences.
Obviously, whatever number-flag we come up with, we are going
to have to let that number-flag play a role in the generation
of an SVO sentence. If we had a "num" flag for number, we could
set it to one (1) for singular and three (3) for plural. We would
leave two (2) in reserve for situations like the dual number in
ancient Greek or for certain uses of the "we" pronoun. In doing so,
we would very carefully be trying to make our primitive AI Mind
have as much tolerance as possible for future expansion and AI
evolution. In fact, we might have to go even further in our
planning for plurals and use a "num" flag even higher than three,
because it suddenly occurs to us that the Russian language has
phrases like "Dva Kapitana" for "Two Captains" and does not switch
into genuine plural forms until the amount of items under discussion
is (oops! I've got to telephone my ready-reserve Russian interpreter)
something like four or five (he does not answer right now).
As I dimly recall hearing about, even Japanese has special words
or special categories of words for talking about grammatical number.

Anyway, in our sentence-generation modules, we would have a
number-flag that would cause an otherwise singular noun-form
to be thrown into the plural. We are concerned here not so much
with the existence of that flag as with the question of how that
flag would be set. In mind-design, how do we account for thinking
about things in the plural? The notion of plurality could come
from an outside source, like a human asking, "What do robots eat?"
Then the perception of the "S" at the end of "ROBOTS" could set
the number-flag to its conventional value for a plural noun.
Hey! The number-flag could be subject to all kinds of triggers.
In fact, with the JavaScript Mind.html AI, but not yet with
MindForth, we have already had an instance when our Tutorial
display code tipped us off to situations where a transitive verb
had more than one direct object. At the time, we seized upon the
plural-object condition as potentially a trigger for selection
of the "AND" conjunction. In similar fashion, we could perhaps
use the "AND" conjunction as a trigger for setting the number-flag
to plural instead of singular. Likewise visual perception in
an AI-minded robot might trigger settings of the number-flag.
The important thing is that we can have the plural number-flag
and not worry too much about what events will trigger the flag,
as long as we have some primitive form of initial triggering
of the number flag.

There is, however, a question of what the default setting of
the number-flag should be -- singular or plural? Even if we
adopt singular as the default setting, or even zero as a blank
setting, we can later change the default without having painted
ourselves into a corner, so to speak. The more important issue
is where the number-flag should be. Should it be in the psi
conceptual array, or should it be in the English lexical array?
Come to think of it, since both the AI Mind modules nounPhrase
verbPhrase do their work by delving into the English lexical array,
the number-flag almost certainly has to be present in the English
array -- or does it? Well, yes, because the form of the English
plural has to be activated in the auditory memory channel, and all
such auditory engram-fetches originate in the English lexical array.

Not to get too weird here, but there could perhaps be a splitting
or a separating of the coalescing influences in the psi conceptual
array. That is, a general concept of grammatical number could
exist as a kind of pervasive blanket phenomenon in the psi array,
aloof and apart from each noun-concept or each verb-concept. Of
course, to the operation of the Mind it does not matter if the
concept of grammatical number is a punctiform concept or a
blanket concept, as long as the mechanism functions properly.

As we get into grammatical influences upon thought-generation,
we will have to deal not only with grammatical number but also
with tense and mood. Mood may have a close tie-in with the
Volition module -- especially if the AI wants to issue a command.
So any sort of mood-flag for imperative verb forms will probably
have to originate from the Volition mind-module, in order to
express the volitional wishes of the AI Mind.

Since the AI Mind will generally not be thinking about
pluralness as such but rather about singular or plural
instances of granular concepts, it would probably be okay
to have a number-flag in the flag-panel of psi concepts.
Verbs, in turn, might have both a number-flag and a
tense-flag and maybe even a mood-flag. If so, we might
do well to install flags for number, mood and tense
all at once in the flag-panel for verbs, so as to get
used to having them there. Of course, verbs are in the
psi array anyway, so we may have to figure out a way to
compress the flag-situation for verbs in the psi array.
Eventually, though, we may reach a point where we have
ordained and included all flags necessary for thinking
in the English language. (We may need an irregular-flag.)

Maybe we could add a "num(ber)" flag into the panel below.
Psi mindcore concepts
krt psi act num jux pre pos seq enx
The krt flag is time and the psi flag is the concept number.
Both the "act(ivation)" flag and the "num(ber)" flag are
subject to dynamically rapid change, so "act" and "num"
go well side-by-side. We are loathe to install mood and
tense flags right now, because there is no clear and present
"anagke" (Greek for "need") to do so. Just to put in the
"num" flag will be a major disruption of our AI source code,
because it will change the structure of the psi concept array.
We will also have to enlarge the English lexical flag-panel.
English lexical fibers
krt nen act num fex pos fin aud
Now we have a very tricky situation, when we contemplate
the possibility of adding a "num(ber)" flag to the English
lexical array. Back in 2001, we stopped activating all the
words of a generand sentence simultaneously, and we switched
to having the sentence-generation module not only delve into
the psi array for each concept in a chain of thought, but also
follow the links from concept to concept not in advance of
the thought, but during the thought and as the very process
of thought. So maybe the "num(ber)" flag can come from the psi
concept and be acted upon by the generation module, but not be
flagged in the English array flag-panel.

Oh, this architecture is complicated! The nounPhrase module or
the verbPhrase module flushes out the momentarily most activated
concept in the psi array. That activated instance of the winning
psi concept shall have a momentarily valid "num(ber)" flag.
We may need to have a "num" flag in the English array just to
prevent forming the plural of an already plural word.

Meanwhile, my Russian adviser has called up, and informs Mentifex
here that for a syntactically functional nominative case,
the numbers two, three and four use the genitive singular
of the noun that they modify. The last word in the numeral
determines what kind of case and number ending is put on the noun.
(Gee, it's a good thing that this fellow has a PhD. in
mathematics from Princeton University.) Dr. Math-Whiz
tells us further that adjectives go into the genitive plural
in a construction functioning syntactically as a nominative
without waiting through two, three and four.


3. Fri.22.AUG.2008 - ADDING NUMBER TO THE PSI FLAG-PANEL

It is going to be a lot of work to add a num(ber) flag to the
flag panel of the psi concept array, because the identifiers
in the flag panel are broadly used throughout the AI program.

First we comment out the following new code at the end of
audRecog, so that the AI runs better for purposes of troubleshooting.
//  if (psi == 0) {    // 19aug2008
//    psi = morphpsi;  // 19aug2008 Replace unknown plural with a known singular.
//  }  // 19aug2008
Next we have to increase the number of nodes from seven to eight
in the initialization of the Psi array immediately after the
declaration of variables at the start of the JSAI source code.
// Initialize the mindcore Psi I.A.W. AI Standards (q.v.);
Psi = new Array(cns);  // ATM 6jul2002; or your ID & date.
for (i = 0; i < cns; i++) {
  Psi[i] = new psiNode(" ",0," "," "," "," "," ");
} // for spreadAct; Instantiate; oldConcept; etc.
// Initialize the mindcore Psi I.A.W. AI Standards (q.v.);
Psi = new Array(cns);  // ATM 6jul2002; 22aug2008
for (i = 0; i < cns; i++) {
  Psi[i] = new psiNode(" ",0," "," "," "," "," "," ");
} // for spreadAct; Instantiate; oldConcept; etc.
Hmm, when we run the AI, it does indeed run with the
new addition to the cns Psi array, but somehow it does
not really seem to be working right. Let's just keep going
until we observe some glitch that we can troubleshoot.
We could avoid a lot of change-over work by adding the
"num" flag at the very end of the psi flag-panel, so
that none of the other flags and their associated
variables would have to change, but we want the flags
to be in a sequence that makes sense:
psi act num jux pre pos seq enx
Next we had better change the Instantiate() module,
not as if it came next in the code (it does not), but
because it is the main entrance into the psi array.

Now when we try to run the 22aug08A.html AI version,
we get an "error on page" message, but we expected it.

Next we add "num" to the psiNode() module, and we run the code.
We get "Error on page" once again.

Then we put "num" into the psiExam() module, which forces
other flags to move down the ordinal list. We run the code.
Hey, this time the code actually ran and produced output.

Now let's change enBoot(), just to get it over with.
By the way, it's a good thing that the JavaScript AI Mind
is not yet very well known on the Internet, because we have
a chance now to make this very major change in the flag-panel
before potentially a lot of people try to port the AI Mind
into other programming languages.

We comment "22aug2008 num=0 by default; 1 for singular, 2 for plural."
Then once again we try to run the code with the changed enBoot().
Well, the AI runs, but in Diagnostic mode the psi flag-panel
values are not right -- massive repeats of "2" over and over.

Let's change some of the diagnostic display code, so that
we get a truer picture of what we are really looking at.
First we change psiList() and we run the code.
The AI still runs, but not properly. We change the
Diagnostic() module itself now, but its code is only
for putting headers on the display, and is not disruptive.

Now we will try to change the verbClear() module.
The "psi4" flag is no longer the part-of-speech "pos" flag,
so we must change "psi4" to "psi5" for part-of-speech.
Now we test the AI, and it does run, but it does not
enter into a looping chain of thought, as we usually get.

Now let's modify the verbClip() module, once again by
changing the "psi4" part-of-speech flag to "psi5" because
the "num(ber)" flag has become the new "psi2" flag and has
pushed the flags following it, into higher ordinal numbers.
Although the AI runs, it malfunctions.

Now we add a "psi7" into psiClear(), although we are not
sure if the program makes any use of psiClear() any more.

Now let's try to update spreadAct(), which is arguably
the heart of the JavaScript AI Mind program.
We make a lot of mutatis mutandis changes in spreadAct()
and the program still runs, but not yet properly.

Next we make necessary changes in nounAct(), mainly in
code that tests for the presence of a noun.
The program runs, but will not loop through thoughts.

Next we change verbAct() and Activate().
We change Rejuvenate(). We change Reify(), which
should actually make quite a lot of difference.
Now change psiDecay() and psiDamp().

Next we spent a couple of hours troubleshooting foolish
mistakes that we made. Finally we were able to launch a
looping chain of thought, after we moved "seq" over one
notch in the Instantiate() module.


4. Fri.22.AUG.2008 - PARKING THE NEW JSAI ON A SIDELINE

It is time to upload the new AI source code after debugging it,
but it must not replace the main origination points of the AI
until there is actually some new functionality beyond the
installation of "num(ber)" as a new flag in the psi flag-panel.
Therefore http://mind.sourceforge.net/jsaimind.html will be the
first URL to which we upload the expanded AI Mind structure.
It is a URL whose code had not been updated since 2 May 2008,
after which date there were eight uploads to the Mind.html URL.
People will be able to find the new code from this journal page
and from other links to the obsolete URL over years gone by.


5. Notes

[X] This page needs to have links to:
- the JavaScript AI Mind;
- the JavaScript AI programming language page.


6. Resources

JavaScript for Artificial Intelligence
http://mentifex.virtualentity.com/js.html

For discussion of the JSAI Mind, see the
comp.lang.javascript newsgroup on Usenet.


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://mind.sourceforge.net/computationalization.html

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

http://mentifex.virtualentity.com/actrules.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.