JavaScript Mind Programming Journal (JMPJ) - sat13jun2015

These notes record the coding of the English tutorial
AiMind.html in JavaScript for Microsoft Internet Explorer (MSIE).

Sat.13.JUN.2015 -- Troubles with InFerence in JavaScript

When we run the JavaScript AiMind.html in English and we try to show a Transcript of automated reasoning with logical InFerence, the Strong AI does indeed make an inference, but the dialog with the AI reveals that the AiMind program is failing to use some correct forms of verbs and personal pronouns. The thinking of the AI is correct and logical, but some mistakes are occurring in the expression of logical thought in proper English.

We suspect that grammatical errors are creeping in because the mind-modules related to inference are composing a sentence of thought outside of the normal routines of strictly grammatical English. We may be able to build up the same formalisms of strict grammaticality inside the inferential routines. For correct verb forms, however, we may need to start using the modules of OutBuffer and VerbGen.

Sat.13.JUN.2015 -- Troubleshooting the InFerence process

We notice that the AskUser module of the 14apr13A JSAI simply looks for the "quverb" query-verb to recall and speak, apparently without forcing the verb into the proper grammatical form, which is typically an infinitive form when a question is being asked with "DO" or "DOES" as an auxiliary verb. We should also check the Forth code and see if AskUser in MindForth has anything more advanced. Oh, the Forth code actually does test for a plural form to be used as if it were an infinitive.

The JSAI AskUser module looks for the "quobj" query-object without bothering to ensure that it will be an accusative form. The MindForth AskUser module also does not bother to check for an accusative case in the "quobj" word, so both the JavaScript AI and the MindForth AI need to be improved. The German Forth AI Wotan also seems to need improvement for grammatical forms in the AskUser module.

Mon.15.JUN.2015 -- Selecting Objects in Accusative

Now we have partially fixed the problem of ungrammatical English by inserting code into the AskUser() module to require the direct object or query-object to be in the accusative case. Instead of asking a question like "Does Mark need I?" the AI now asks, "Does Mark need me?"

However, when we answer "no" to the foregoing quesion, the AI eventually gets around to saying, "MARK DOES NOT NEEDS ME", because the AskUser() module is not insisting upon finding an infinitive form of the query-verb.

JavaScript Mind Programming Journal (JMPJ) - tues16jun2015

Tues.16.JUN.2015 -- Failure to Store Direct Objects Properly

The AskUser() module continues to have problems because the overall AiMind program is not properly storing direct objects with a "dba" tag set to four (4) in the accusative case. One resulting problem is that the personal pronoun "ME" is stored with a "dba" of "1", so that the JSAI erroneously says "ME HELP KIDS" when it should say "I HELP KIDS". So we need to correct the case-storage problem in JavaScript and we should first see if the other AI Mind programs already have a way of dealing with the problem.

Tues.16.JUN.2015 -- Troubleshooting OldConcept()

Into the OldConcept module we insert an "alert" box that reveals to us the value of the "dba" variable just before OldConcept calls EnLexicon() to save the "dba" among the other data of the storage of a previously known word. We learn that after AskUser(), OldConcept is storing the direct object of the question with an erroneous "dba" of "1" instead of the required "dba" of "4" for an accusative case. Into the "alert" box we add a revelation of the value of the "dirobj" flag, and we learn that "dirobj" is at an erroneous value of zero ("0") during the OldConcept storage of the direct object with an erroneous "dba" value of "1" instead of "4". So let us try setting the "dirobj" flag to a value of one ("1") in AskUser during the summoning of the direct object in the question being asked. We do so, and the AI stores the direct object with a correct "dba" of accusative "4", but we also find that we need to reset "dirobj" back to zero in AskUser() after calling SpeechAct() to say the direct object.

"Alert" box used in OldConcept of 16jun15A.html for troubleshooting:
// alert("NPhrDObj: motjuste nphrnum dba = "+motjuste+" "+nphrnum+" "+dba); // 29jan2012

alert("OldC calls EnLex: dirobj dba = "+dirobj+" "+dba); //  16jun2015

  enLexicon[t] = new enNode(oldpsi,"0",num,mfn,dba,fex,pos,fin,aud);

JavaScript Mind Programming Journal (JMPJ) - wed17jun2015

Wed.17.JUN.2015 -- AskUser Needs Infinitive Verbs

The AskUser() module needs to validate an inference by asking a question using an auxiliary verb such as "DO" or "DOES" with the infinitive form of a query-verb. If the AI knows that "Women have a child" and it learns that "Mary is a woman," we want the AI to ask, "Does Mary have a child?" We have not yet formed a sophisticated way of keeping track of the infinitive form of a verb, and with AskUser() we do not need to. We may simply assume that the query-verb in AskUser() is an infinitive, and so we may initially use a non-third-person-singular form and let AskUser() store the form as an infinitive for future reference. The AskUser() module thus becomes a kind of factory creating infinitive verb-forms.

Wed.17.JUN.2015 -- Storing Infinitive Verb-forms

The lack of an infinitive shows up after the AI has made an inference and has sought validation from the human user. Then the AI typically makes a statement like, "MARY DOES NOT HAVES CHILD." We need to make sure that negational sentences look for an infinitive form, and that infinitive forms are available to be used in negational sentences.

We have discovered in VerbPhrase() that a "negjux" of "250=NOT" was being detected only after the selection of the "vphraud" engram of the verb to be spoken. By moving up some code to detect a "negjux" negation earlier in VerbPhrase(), we give VerbPhrase() a chance to look for an infinitive verb-form to be used after an auxiliary verb.

By creating a new variable "verbprsn" to let us declare that a verb-form is in the zeroeth person, we enable AskUser() and EnAuxVerb() to cause the storage of infinitive verbs with a "dba" of zero in the English lexical array. The AI stops adding an "S" inflection to infinitive verb-forms.

JavaScript Mind Programming Journal (JMPJ) - fri19jun2015

Fri.19.JUN.2015 -- Improving EnArticle()

As the Strong AI Minds have become more streamlined and more sophisticated, the module EnArticle() for inserting the English articles "A" or "THE" has lagged behind the state of the art. Now we introduce a simple test for a singular subject along with a form of the verb "to be", so that the generation of a thought along the lines of "I am a robot" or "You are a person" will more easily include the indefinite article.

"Alert" box used in EnArticle() of 19jun15A.html for troubleshooting:
function EnArticle() {  // being revised; 19jun2015

// alert("EnArt called: nphrnum subjnum = "+nphrnum+" "+subjnum); //  19jun2015
alert("EnArt: nphrnum subjnum verbpsi = "+nphrnum+" "+subjnum+" "+verbpsi); // 19jun2015

JavaScript Mind Programming Journal (JMPJ) - Monday, June 22, 2015

Mon.22.JUN.2015 -- Dealing with num(ber)

The JavaScript artificial intelligence (JSAI) has reached sufficient Strong AI functionality that we may develop it further simply by running the JSAI and troubleshooting any bug that makes its appearance -- even minor bugs that we may have disregarded in the past. Currently, we notice that the JSAI says "I HELP KIDS" while entering only zero for num(ber) in the En(glish) array.

In the OldConcept() module, we notice that the value of "audnum" was replacing the value of "num" just before the calling of EnLexicon to store the values. We put in a qualification to replace the "num" value with "audnum" only if the value was above zero, and we started getting the correct num(ber) for the pronoun and noun in "I HELP KIDS", but not the verb.

Tues.23.JUN.2015 -- Debugging AudRecog()

By comparing the JavaScript AudRecog() with the AudRecog module in MindForth, we brought the JavaScript version up to date. Then we tried long and in vain to get AudRecog() to recognize "MEN" as the plural of "MAN". Finally it occurred to us that the EnBoot() entry for "MEN" could be in error, and sure enough, we had to correct the "ctu" flag. Then AudRecog() worked well.

JavaScript Mind Programming Journal (JMPJ) - Wednesday, June 24, 2015

Today we are integrating some code abandoned a few days ago with the current JavaScript AI code. We are dealing specifically with the module EnArticle() for English articles. Since the selection or avoidance of an English article depends on the grammatical number of a selected noun, we are tightening up the process of storing number values.

When the JSAI starts out by saying "I HELP KIDS", no num(ber) is being stored in Psi or En for the verb "HELP". We troubleshoot the problem and we cause the storage of num(ber) values. Then we use a new "infincon" flag-variable to ensure that infinitive verb-forms are stored with their num(ber) set to zero.

JavaScript Mind Programming Journal (JMPJ) - Thursday, June 25, 2015

When we run the 25jun15A.html JSAI with no human input, soon it derails by saying "I AM A I". We recognize this recent problem as a situation where calling EnArticle() interferes with the selection of an auditory recall-tag to be fed into the SpeechAct() module. We shall troubleshoot by inserting an "alert" box or two into EnArticle.

We recently used a new variable "quobjaud" in AskUser() to hold onto the selected recall-tag during a visit to EnArticle().

An alert-box in NounPhrase() tells us that the AI is trying to say "I AM A PERSON" but somehow it says "I AM A I". When we comment out the early call in NounPhrase() to EnArticle(), the AI reverts to saying "I AM A PERSON" So we have NounPhrase() make the early call to EnArticle() only when the "predflag" is at zero.

JavaScript Mind Programming Journal (JMPJ) - Friday, June 26, 2015

Fri.26.JUN.2015 -- Storing num(ber) of Subjects and Verbs

Running the 26jun15A.html JSAI with a test of inference, we see the AI eventually say, "WOMEN HAVE A CHILD". The word "WOMEN" is stored as singular ("1") in both the Psi conceptual array and in the En(glish) array, as is the verb-form "HAVE". We are not even sure any more that the Psi array should bother to story any num(ber) value, but still we would like to correct the deficiency.

In AudRecog(), the recognized number "recnum" works for a noun, but not really for a verb-form, which may easily be both singular and plural.

We should perhaps store the num(ber) of a verb-form based upon the num(ber) of its subject, and not on any recognition of the "old concept" of the verb itself. In the Russian AI, the VerbPhrase() module sends the vaule of "vphraud" into the SpeechAct() module to speak a remembered verb-form, or else VerbGen() is called to create a verb-form. It can be assumed that the num(ber) of the verb comes from the num(ber) of its subject.

Now we have gotten InStantiate() and OldConcept() to store the num(ber) of verbs properly by relying on the "nphrnum" variable to convey the num(ber) of the subject to be stored as the num(ber) of the verb-form.

JavaScript Mind Programming Journal (JMPJ) - Saturday, June 27, 2015

Sat.27.JUN.2015 -- Ensuring Infinitive after Negation

Although in the EnAuxVerb() module we were setting the infinitive-condition "infincon" to a positive "1", it was too late to govern the selection of an infinitive verb-form. We had to go into VerbPhrase() and set both "nphrnum" and "prsn" to zero if the "negjux" value was "250" for "NOT", just before the search for a verb-form in the En(glish) array. We hope that changing "nphrnum" and "prsn" to zero does not have adverse effects elsewhere in the Strong AI program. If there are adverse effects, we may have to restore "nphrnum" or "prsn" after the selection of the infinitive verb-form.

Return to top; or to
Many thanks to NeoCities for hosting
Strong AI