18 May 2009 AI4U   » (Observer)

MindForth Programming Journal - mon11may2009


Today we would like to work on getting the AI to recognize both singular stems and plural forms of a standard English noun. Perhaps we will start out by trying to see if we can have the AI instantiate nouns ending in "s" while going back and assigning the "audpsi" ultimate tag to the penultimate phoneme which is the end of the singular stem.

Looking at the AudMem code, we realize that we need to get several new influences in there to cause the AudMem module to dip back one unit in time and assign the "audpsi" value to the penultimate phoneme that marks the end of the stem. We want the word to be a noun and to be ending in "s". We might get away with disregarding whether the word is a noun. We could just look for all words ending in "s" and then we could plunk down the "audpsi" ultimate tag not only on the final "s" phoneme but also on the penultimate phoneme. Serendipitously, in this way we would also manage to tag the stem of a third-person singular verb with an audpsi, as in, "He works," where a penultimate audpsi would identify the concept. So we get out our ASCII chart and we see that uppercase "S" is "83" in ASCII. We will test the end of words for an "S" and assign the "audpsi" value to both the final and the penultimate phoneme.


We will try now to achieve singular-stem recognition from plural nouns not only by putting an audpsi ultimate-tag on the penultimate phoneme, but also by setting the "ctu" continuation flag to zero ("0") in the penultimate position, so that our software will "think" that it has recognized a whole word instead of just a stem inside a noun-plural.

In the AudInput module, we have been putting our new code into the area for internal reentry. Perhaps the new code belongs in the area for external input.

Hey, perhaps all this new code should be in NewConcept, because we are trying to deal with previously unknown noun-stems.

Gee, we might try something really radical. We have created a variable

variable newpsi   ( 12may2009 for singular-nounstem 
assignments )

so that we can be sure to assign "ctu=0" and "audpsi" only to noun-stems of a plural word coming in during user input. It might be quite radical, but useful, to put the "newpsi" value just before all incoming "S" phonemes, not just final, end-of-word "S" phonemes. We would assume that such assignments would not cause any problems for "ctu=1" word-engrams. Then, when the word-engram was finalized, we could go back in and set the "ctu=0" value to permit future recognition of the noun- stem.


The variable "newpsi" obtains no positive (above zero) value until NewConcept is called -- which happens when?

With a new "wordend" variable we finally achieved the basic functionality that we have been seeking for the past three days, but with a few minor glitches. We used the following AudMem code.

    \ 13may2009 In AudMem as called towards end of 
    pov @ 42 = IF  \ 12may2009 Only during external input
      pho @ 83 = IF  \ 12may2009 If phoneme is "S"

\ CR ." S pho & newpsi = " pho @ . ." " newpsi @ . \ 12may2009 test \ ." time t = " t @ . \ 12may2009 test newpsi @ t @ 1- 5 aud{ ! \ 12may2009 pre-"S" audpsi

wordend @ 1 = IF \ 13may2009 If word has ended CR ." audpsi = " audpsi @ . \ 13may2009 a test. \ audpsi @ 0 = IF \ 13may2009 Change ctu only for new words. 0 t @ 1- 4 aud{ ! \ 13may2009 As if "no continuation". \ THEN \ 13may2009 \ 13may2009 End of test for known word. THEN \ 13may2009 End of test for end of word 0 newpsi ! \ 12may2009 Reset for safety. THEN \ 12may2009 End of test for "S" THEN \ 12may2009 End of test for external input.

In an upcoming other version of MindForth, we need to overcome the minor glitches. One glitch is that the AI is setting "ctu" to zero on both the penultimate and ultimate array-row of a plural word that has just previously been learned. We would prefer that the known plural word only have ctu=0 in the final row. Another glitch is that the new code is working only after a previously unknown verb is used. It should be relatively simple to remove that particular glitch.

4. Thurs.14.MAY.2009 -- STUMPED AND STYMIED

Of the two glitches we need to work on, the more important one, and also probably easier to solve, is the problem of the new code not working with a known verb from the EnBoot English bootstrap.

In the following transcript, the new stem-rec code does not work after we use the English bootstrap verb "know".

Transcript of AI Mind interview at 7 39 3 o'clock on 14 
May 2009.
i know books
 S pho & newpsi = 83   0 time t = 215


When we use the previously unknown verb "use" in the following transcript, the stem-recognition code works just fine. Why? What is the difference between using an old or a new verb? Here we say "i use books" to the AI Mind.

Transcript of AI Mind interview at 7 40 7 o'clock on 14 
May 2009.
i us
 S pho & newpsi = 83   0 time t = 207 e books
 S pho & newpsi = 83   77 time t = 214
 audpsi = 0


There must be a hidden influence in either OldConcept, or NewConcept, or both, because one or the other module is invoked for the verb, depending upon whether the verb is "old" or "new."

By means of some diagnostic code in AudMem, we have just learned that the "newpsi" variable has a value of zero after a verb from the English bootstrap.

Transcript of AI Mind interview at 21 8 34 o'clock on 14 
May 2009.
i know books
 AudMem: backstoring newpsi 0

We may want to troubleshoot the "newpsi", or perhaps just replace it with a "stempsi" variable.


Theoretically we should be able to see an audpsi Aud{ engram and be able to figure out exactly how and why that particular value got placed there. But we have been having extreme difficulty over this past week.

Bingo! In the "ELSE" (if no old concept, declare new concept) area of AudInput, we have found one ancient line of code that has been causing all our grief for the past week.

            nen @  tult @  5  aud{ !  \ Store new concept 
        THEN          \ end of test for a positive-length 
      THEN              \ end of test for the presence of 
a move-tag;
      AudDamp           \ Zero out the auditory engrams.

That top line in the snippet above has white space that made it not show up when we searched for "5 aud{ !" in the source code.

Okay, now we actually have to rename 14may09B.F as 15may09A.F and continue working with the new version designated properly for today, because now we have an actual prospect of implementing a correct algorithm for recognizing singular noun-stems within new plural nouns.

Well, we had a good scare in our maintaining of functionality today. Apparently the following block of new code in the AudInput module was making our AI lose its ability to recognize "I" properly. When we comment out the code below, the ability comes back.

    pho @ 83 = IF  \ 15may2009 If the word ends in "S"
      ctu @ 0 = IF  \ 15may2009 If word is ending
        0 t @ 1- 4 aud{ !  \ 15may2009 As if "no 
      THEN  \ 15may2009 End of non-continuation test
    THEN  \ 15may2009 End of test for "S"

The problem caused us to backtrack to 14may09B.F and use it to create 15may09B.F, which we deleted after we identified the problem as presented above. In a short while of coding 15may09A.F we added some useful code that we did not want to have to re-create, so we persisted in troubleshooting our AI.

6. Fri.15.MAY.2009 -- REMARKS

The current 15may09A.F code has a lot of "Junk DNA" in it, because it tooks us several days to locate and fix the problem. Now we need to gradually remove the many instances of test code, and devise a solution for the glitch of not always having the desired penultimate setting of "ctu" from one to zero.


Today we will re-constitute 15may09B.F as a clone of 15may09A.F and we will strip away the excessive noun-stem-related comments. Then we will name a new copy of the cleaned-up code as 16may09A.F, so that we can continue coding while still having the cleaned-up code in the 15may09B.F archive.

Here is a plan. In AudMem we could constantly test for S=83 and set ctu to zero upon finding "S", while also going back and switching changed ctu values back again to "1". To avoid going back too far, we could re-switch the changed ctu values merely upon finding a non-end-of-word.

Or we could make ctu=0 the default, constantly switching it to one retroactively, except when an "S" is encountered. Or we could change the whole AudMem system, and make it include a pho=32 space-bar at the end of each word, so that we would not have to do much retroactive adjustment.


Let's just jump right in and see what happens when we include an ASCII 32 space-bar at the end of each word and as part of each word. We are eager to hurry up and put some new AI up on the Web. The sooner we get the terminated-word code up on the Web, the sooner we establish the design as a kind of standard for AI prototypes.

Now we have gone in and added an extra row to each word in the EnBoot sequence. We will try to run the code, but we do not expect it to work.

Hmm.... The code did indeed run, but the thinking had gone haywire. We achieved no cognitive chain reaction, that is, we were not able to enter four sentences and get the AI to think in an "infinite" loop. But now we get to troubleshoot and debug. The chore of changing the EnBoot sequence has been done. We just have to make the rest of the program adjust to the changed EnBoot.

Now we are going to change some AudInput code that reacts to a space-bar pho=32. Instead of retroactively setting the ctu- flag to zero at "tult", we are going to set the ctu-flag at the current "t" time, because each word is surely at an end now.

Newxt we had better tend to problems in the AudMem code, because the EnBoot module is no longer filling in the audpsi concept numbers in the auditory memory channel. Therefore none of the bootstrap words are being recognized.

The major problem right now after the EnBoot change-over is that the AI is not recognizing any words. We may have to troubleshoot the AudRecog module.


There is obviously some tiny little glitch preventing the new, EnBoot-altered MindForth from recognizing a single word. Here we type in "you and i".

Transcript of AI Mind interview at 6 52 53 o'clock on 17 
May 2009.
yARc:0 ARc:0
audpsi=0 oARc:0 ARc:0 ARc:ctu=1
audpsi=0 uARc:ctu=1
audpsi=0 aARc:0 ARc:0 ARc:0 ARc:0 ARc:0
audpsi=0 nARc:0 ARc:0 ARc:ctu=1 ARc:0
audpsi=0 dARc:0 ARc:ctu=1
audpsi=0 iARc:0 ARc:0 ARc:0 ARc:0 ARc:0 ARc:0

There must have been two instances of initial "Y" in auditory memory, for us to see two diagnostic messages. Or maybe they were just general instances of "Y". The words "YES" and "YOU" in the EnBoot sequence have initial "Y", and the words "WHY" and "THEY" have non-initial "Y".

Maybe we should start (or resume?) putting commented-out diagnostic tools inside the crucial AudRecog module, so that we may quickly troubleshoot any future problems.

When we knock out AudDamp temporarily in order to see what activations are building up on auditory engrams during the recognition of input "you", we see the following differential build-up on the EnBoot engram of YOU.

74 Y 0 # 1 1 0
75 O 8 # 0 1 0
76 U 10 # 0 1 0
77   10 # 0 0 56

That record shows a good, healthy build-up.

10. Sun.17.MAY.2009 -- REVERTING TO THE OLD EnBoot

It is proving too hard to get the auditory memory to include ASCII pho=32 spaces as the final element in each English word. Therefore we are abandoning the code of last night and today and we are reverting to the 15may09B.F cleaned-up version.

The "ctu" value is rather sacred, because it plays a central role in the recognition of a word as an "audpsi" concept. Whether we enjoy it or not, we will have to do some retroactive resetting of "ctu".

For the setting of "ctu" in current circumstances, the most important thing is that a final "S" comes in, as shown by a terminating pho=32. Therefore, without relying on "wordend", we should simply trap for "S" and for pho=32. When pho is 32, we should see if the "prepho" is ASCII S-83. So we need to have prepho available. Actually, we need a system that keeps track of three elements: the current pho=32; the previous "S"; and the element before "S". Or do we? We need to see that it is at least positive.


After seven days of arduous AI coding, we seem finally to have solved the problem of getting the AI to accept a plural English noun ending in "s" while assigning the concept number to the singular stem. We used the following AudInput test-code in the area that deals with pov=42 external input, not with internal reentry, because new words are not learned during the reentry of thoughts.

      \ 17may2209 Testing for SP-32 or CR-13:
      pho @ 32 = pho @ 13 = OR IF  \ 17may2009
        pho @ 13 = IF 10 EMIT THEN  \ 17may2009
        ." AIptExtPho=" pho @ .    \ 17may2009 test
        ."  AIptExtPrepho=" prepho @ .    \ 17may2009 test
        prepho @ 83 = IF   \ 17may2009 If previous pho 
was "S"
          \ 17may2009 In next line, time t may not have 
          0 t @ 1 - 4 aud{ !  \ 17may2009 set ctu=0 
before "S" end.
          0 prepho !  \ 17may2009 Zero out prepho after 
        THEN  \ 17may2009 End of test for external 
final "S"
      THEN  \ 17may2009 End of test for external space-bar 


Latest blog entries     Older blog entries

Share this page