This is the second part of the notes collection. Martin Mroz formatted the first part with word, up until January 26, 2002.

January 29, 2002

I found that I still have a problem with OBJECTs and spkrsays or addtoqs. Particularly, things that shouldn’t be saved by addtocontext are being saved. Here is the sequence:

the room is cheap.
how much?
is the room expensive?

(maybe). "Speaker asks how expensive is the inexpensive room" is creating a copy of room with an orthogonality violation. I think that I need to tag the OBJECT so that I can identify it later. Hence, use of an auxiliary tag, AUXTAG4.

January 30, 2002

I am looking at an issue with simple-statement-17, wherein the verb "tobe" isn’t promoted. When used in an inference template, it means that inference must match the TNP of the statement to evaluate to TRUE. Take, for example:

if i ask how much is a room then tell me what a room costs.

I want this to apply to "how much is a room" as well as "how much are rooms." The verb tense necessarily should match. The person matches. The number is an issue though: singular in the template and plural in the question. How do I make concessions for the number without kludging?

February 15, 2002

Been very busy insode and outside of work. Here’s a summary for a show last week in Scottsdale:

I went to the last evening and final day of the "Telephony Voice User
Interface Conference" in Scottsdale, earlier this week.  We had a
table for the demo and discussion day.

Briefly, it went very well.  The attendees were very knowledgeable.
Some folks sought us out, having heard about Brainhat already.  There
were a few serendipitous discussions too.  I got a lot of "Wow!  That’s
cool!" reactions.   One fellow had just come out of a talk on NLP
where the stuff I was demonstrating was painted as "the future." :-)

I spent a good deal of time with the product manager for Rhetorical,
the company that sells the "Alisha" voice Rich talked to in the
demo.  Frankly, the discussion was about exploiting the entertainment
possibilities of Brainhat + a soft voice.  I’ve been trading mail
with the woman since I got back.

I also had 15 or so beers with a columnist for Speech Technology Magazine.
I think it won’t take too much arm-twisting to get him to write about us.

I also talked to people with money, people with applications.

My only complaints were that 1) we should have been on the
speaking agenda and 2) the last day of a conference is a
difficult time to attract people to a trade show floor.

Bug time: "i like you", broken. Fixed.

Here’s a real puzzler... in the "why did it ever work" category. I say:

you have a room. the kitchen is pretty. do you have a room?

The trouble is that qacandsall trolls the context looking for "rooms" to fill the OBJECT slot in the question. The candidate, "kitchen", fits the bill and wins the contest against the other candidate, "room." The trouble is that Brainhat does not have a "kitchen."

qacandsall appears to be working better than it used to.

debug> dump
define  Root [19638]
        enable          do-1
        object          kitchen-1-4a56
        verb            have-2
        subject         brainhat-1-49f7

define  Root [19633]
        enable          do-1
        object          room-1-49f9
        verb            have-2
        subject         brainhat-1-49f7

define  Root [19628]
        enable          do-1
        object          kitchen-1-4a56
        verb            have-1
        subject         brainhat-1-49f7

define  Root [19623]
        enable          do-1
        object          room-1-49f9
        verb            have-1
        subject         brainhat-1-49f7

The clip above shows the question "do you have a room" after the rule has matched, but before any mprocs have fooled with it. The two basic forms "kitchen" and "room" both deserve a chance to evaluate to "yes." The trouble is that chooseone picks the wrong one, and it continues on to declques2 to return an answer of "maybe."

I’d like to assume that I could get away with choosing the direct match to the word(s) passed into qacands. For instance, if I found "room" when I was looking for "room," I might just go with it. The danger is that "room" might not be the best candidate. Consider the following sequence:

You have a pretty room.
The kitchen is near the water.
Is the room near the water?

February 16, 2002

Perhaps the problem is that I am choosing a candidate question before I know what the answers might be. As with a person, Brainhat could be greedy about the potential answers and try to find a definitive "yes" or "no." Anyway, I am going to play with it....

That certainly fixed the problem. I removed an invocation of chooseone that precedes a pass through declques2, and came up with a couple of "yes" answers and an "i don’t know." One of the "yes" answers was chosen. I am going to look at all of the other questions, remove the early choices, and then see if the tests fail. A thought occurs to me: the cost of running multiple questions was much higher when inferences were exercised at question-time. Now they’re run speculatively.

February 17, 2002

Doing stuff! Looking at sent-desaction-1a to see if I really need it.

Two "desire" rules eliminated. I also added a "[to ]" into sent-action-10 to soak up the infinitive.

Five minutes later.... hmmmm, I put some rules back. There are some "desire" rules that depend on csubobj-stmt constructs. I have to check to see if I couldn’t accomplish everything I need to do using simple-statements.

Later.... Interesting case: I fixed declques2 the other day. And I moved chooseone to come after declques2 in most cases. The problem is that addtoqs needs to store the question before declques2 gets it, but this is also before chooseone gets a chance to reduce the number of questions to a single one.... I left off in question-action-2, thinking about this.

I still haven’t tackled the remainder of the "desires" patterns. I was working to make csubobj-statements input simple-statements (and it seemed to be working) when I ran into this little brainteaser.

February 18, 2002

The fix came to me lying in bed last night. Wonder what it was....

Oh yes.... I think I might want to push a copy of the CC containing the questions before I run declques2. If the answer comes back "empty" (which means "I don’t know"), then I can restore the chain, run it through chooseone and pass it up for storage by addtoqs. But what do I do if declques2 finds the answer? Need to do some experimentation....

The near-term answer is that the question is perserved if the answer is yes or no. Actually, it is worse than that. If I say "mario does not see the ball" and then ask "does mario see the ball?", the question gets recorded as "speaker asks does mario not see the ball?"

Perhaps I should have addtoqs run before attrques2 or declques2. It will further need to pick just the first element of the conchain.

Here’s the soul-bearing confession: the question that I save--the first one on the conchain--might not be the one that gets answered; it is possible that declques2 will like the 3rd or 4th question on the chain better (by answering "yes" or "no"), and so chooseone will make it the winner. The reason I think that I will get away with it is that the questions are merely being saved so that I can later posit things like: "do i ask if mario sees the ball?" The wrong interpretation of the question may be stored, but the answer will still come back "yes" because the "do i ask..." version of the question will also (probably) have a permutation that includes the wrong interpretation.

The only downside to this tomfoolery is (I hope) the possibility that the discourse buffer could get polluted with off-subject words. Anyway, I am going to try this and see what happens.

Rich and I have been fooling with a tree-view java widget. We’re doing some great stuff. But now, back to the question of whether I can make csubobj-stmts into simple-statements....

What’s the different if I use csubobj-ana versus csubobj-prep in a statement?

February 21, 2002

We had a meeting yesterday where we discussed the nature of the products we are cobbling together in terms of their definition, marketing and revenue potential. The group consited of me, Rich, John, Rick, Jack and Mike. Some fundamentatl changes in product definition were the result. It’s really terrific stuff, in my opinion.

The idea is that we recognize that we sell three product lines, plus support and professional services. The products are the core platform, scenarios and interfaces. The purchaser could mix and match these components to suit a need.

One of the most important observations is that we are recognizing scenarios as part of our intellectual propoerty. We are also abandoning the notion that scenario building is for everyone.

John was adamant that we also create a user community for development of applications (scenarios) by professional users of Brainhat. This is an idea that Mark offered some time ago as well.

Some big changes coming for Brainhat:

I need to make the input parsing more greedy. Currently, the program stops when a pattern matches. I need to have it continue, looking for more matches. In coordination, I need to have the input parsing routines be mindful of whether they have consumed all of the input, or whether some is leftover following the match. This will give me a sense of the quality of the match and possibly direct whether I bother to attempt sloppy matches. Routine bestfit already depends on knowing whether input is completely consumed. I’ll have to mesh with the existing code.

I want to disconnect Brainhat’s beliefs from what it hears the user say. This is necessary for correct processing of idioms. I experimented with it just before Christmas. In addition, I need to be able to correctly handle whole statements as template components in inferences. Take, for example, "if i say something then i mean something." I want "something" to stand in for a whole CC.

Memory management needs work. 1) I need to reclaim nodes more often--perhaps whenever chooseone gets called. 2) I need to be smarter about how I re-use the nodes that are reclaimed. The memory footprint, though large, should concentrate activity in localized regions so that we can avoid cache, page and DTLB faults.

Allocation, location and reclamation of memory re-consumables (concepts, etc) should be directed by hash tables whose layout reflects the linear memory map. When a node is allocated, it should be pulled, if possible, from memory space near to it so that there will be some locality of reference. If we can’t find any space that is "near" then we could look for space in neighboring buckets.

I suspect that the reclamation pattern in use now is returning recycled nodes from the end of the memory map.

Note to self: Look into the caching in place for the symbol table. I’m not sure that code is working at all.....

Yep: the memory allocation pattern is atrocious. Fixing it will be a good project, but first!--> I need to make stateless httpd brainhat.

Stateless httpd brainhat will require that I drop server-side cookies into a temporary directory. The "cookies" will include the context, discourse and question buffers(?).

February 22, 2002

I am on my way to NYC to meet with a woman from Rhetorical, the company that makes the designer voices we are planning to use with some of the Brainhat products. The subject at hand is the "relationship server," and the telephony, ASR, NLP and TTS challenges it poses. I have some hand-scratched notes about the technical challenges, projects and origanizational issues as I see them. The important thing is that any effort expended on the relationship server will serve to open up the dialog market in general.

Need a nap...

Later (on the way back). The meeting went well. It is 11:00 PM. I am lucky to have my computer at all, having left it in a bar and a restaurant tonight. The food was good. We agreed, in principle, to put together a demo and use that to help develop nome cash.

February 24, 2002

I am working on being able to save state between runs. Here is the verbiage from the top of the file state.c, currently under construction:

 To date, Brainhat daemons for VXML, HTML, text, have been stateful.
 For the VXML and HTML invocations, following the first contact with
 the daemon, subsequent connections are directed to another port where
 the stateful copy of Brainhat lays waiting.

Statefulness is useful if there are back-end connections to other
 stateful things, such as robots or processes.  But it carries the
 burden of a replicated memory footprint for each of the waiting
 copies and the inconvenience of managing accesses to other ports.
 The port redirection thing became particularly troublesome lately
 when we started playing with a JAVA plugin for the web set.  The
 plug-in will allow the user to "see" the parsed output from Brainhat.
 The problem is that the redirection appears to violate JAVA runtime
 security for the applet, and hence no phrase tree pictures appear
 after the first connection.

Anyway, the impetus for making a stateless Brainhat is getting
 stronger.  It will also be useful for being able to save and re-invoke
 state between boring old command line sessions.

I will need a few routines:

1) a routine to create clever file names for storing the state between
    Brainhat runs.  The files that will be created are going to be the
    equivalent of server-side "cookies."

2) a routine to save the state of the context, discourse and saved_question
    buffers, plus anything that might be hanging around from ’bestfit,’
    the routine that tries to improve speech recognition.

3) a routine to re-incarnate the state of the last session.  This will
    basically read stuff back into the context without running any
    inferences.

Concepts can have multiple synonyms attached. The very first is always the definition name, as given in the "define" statement. To avoid ambiguity when reinitializing the context from a file, I would like to use the "define" names instead of any of the other synonyms. Since the same output routines that allow Brainhat to "speak" are being used to create a copy of the context, I am going to need a way to tell the "speak" routines to use the first synonym. Currently, the routines always choose the last. So, I am going to create a little routine that chooses a synonym from the text links in a concept instead. It will have a flag that says "take the last", "take the first", and "take one at random, excluding the first." We’ll see what happens; a little mixing of synonyms might add some color to Brainhat’s output.

(later) Part-way there. No I am going to work on something else for a while...

February 26, 2002

Mark Miller noticed that the following sequence is broken:

>> the red ball is round
 the ball is round.
>> the blue ball is oval
 the ball is oval.
>> what shape is the red toy
 the ball is blue is oval.
>> what shape is the blue toy
 the ball is blue is oval.

March 1, 2002

I am working with Mark Miller on the last chapter of his book.

(later) I am grieving over the grammar. I need to be able to easily create and test grammar rules for any kind of input. To be complete, any utterance should be able to satisfy the following tests:

1) statement input, e.g.: "mario sees the ball",

2) embedded in a question about the statement: "do i say that mario sees the
ball?"

3) output in a statement: "tell me that mario sees the ball."

4) as part of an inference: "if i say [that] mario sees the ball then you
   are happy.

Then there are questions:

1) "does mario see the ball?"

2) "do i ask [if|does] mario sees the ball?"

3) "ask me [if|does] mario see the ball"

4) "if i ask does mario see the ball then you are happy."

And there are "W" questions:

1) "what is in the room?"

2) "do I ask what is in the room?"

3) "ask me what is in the room."

4) "if is ask what is in the room then you are happy."

March 5, 2002

Back to thinking about improvements in the grammar and
ways that I might be able to manufacture grammar rather
than slog through it by hand, like I do now....

I ran into trouble with ’what comes with a room’--part of Mark’s
book scenario.
I want to use this as a prototype for manufacturing grammar
for all possible uses.

Step 1) Make the baseline question work:
"what is in a room?" (okay, covered by question-what-8)
using a normal form of some sane construction.

define  Root-491d [18717]
        label           question-what-6
        child-of                things
        auxtag4         Root-491d
        subject         things
        verb            tobe
        attribute               Root-4919
        tense           present
        number          singular
        person          third

This is taken from the context where "the speaker asks ’what comes with a room’" is recorded. It looks reasonable.

Step 2) Make "ask me what comes with a room" work. To do that, I need to have a simple statement that comes up with the same representation as above. In addition, I need to be able to express "what comes with a room" independently from all other possible interpretations. This probably means that I need to add an auxtag of some sort to the CC.

Perhaps the AUXTAGs should be more general. Perhaps there should be a single link type "auxtag" with a parameter that describes the kind of sentence we recognized. More globally, I am at the brink of thinking about voiced representations of ideas independent of their stored forms.

The sentence "ask me what comes with a room" does not work. I need to make a bit of "speak" grammar and a routine to process the output.

March 13, 2002

Rich and I have been working on the database/scenario issues. I am writing up a little description for the others in the project. I’ll paste it here....

Brainhat News -- 031302

Rich, John and I have been up to some very interesting stuff.  I
thought we should share it with you.  The information in here is
confidential.

Database

Brainhat currently reads vocabulary, grammars and scenario information
from files at start-up.  This is inflexible, at best.  It also means
that we have to drag into core everything we must possibly use during
a conversation, which has storage and start-up cost implications.

We have been working on a SQL database interface for Brainhat.  It
solves the start-up cost questions, and it will allow us to share
information between Brainhats and across run.  The database can
store grammars and vocabularies for scenarios and sub-scenarios,
and dynamically deliver them back to the Brainhat engine.

The biggest impact, though, is that the database will allow us to
provide Brainhat dynamic focus in the course of a conversation.  An
illustration: Imagine you are in the Louvre, looking at the Mona Lisa.
Brainhat is there, acting as your tour guide.  Three scenarios are
active: a core scenario, the Mona Lisa scenario and the restrooms
scenario.

The current focus is the Mona Lisa scenario; the grammar,
vocabulary, proposition and inference collections are appropriate to
discussing the painting. Out of the blue, you say "I have to poop."
Brainhat has no vocabulary for this is in the Mona Lisa collection,
but it has appropriate inferences, vocabulary and grammar in the
restroom collection.  This will motivate a change in focus.

Within Brainhat, this should be as straightforward as swaping clean
concept symbol tables dynamically.  The context of the conversation will
be preserved across focus changes; you would be able to ask "does Mona
Lisa have to poop?"  The answer would be "maybe. you have to poop."
You get the idea.

GUI

In the GUI, even in its current state, you can edit vocabulary, grammar
and scenarios information for different foci.  Just as one crafts a
scenarios with inferences to move a conversation from point A to point
B, the artform will be to craft scenarios and sub-scenarios that motivate
focus changes as a conversation progresses.

A couple months down the road, the GUI will be the preferred window
into the database and Brainhat, and the database will be where all of
the runtime data are stored.  What we call "Brainhat" now will look
more and more like an processing component of the bigger picture.

Another element of the GUI is a set of services to allow one to
monitor the activity of the database. Who is using the database, when
did they start, when did they finish. What are the active scenarios a
certain user is using, what is the scenario of focus...

Internal Brainhat Changes to support Dialog Progression

Brainhat currently processes input in chunks; whole utterances are
presented and parsed against the collection of input grammar rules,
one at a time.  We will be making changes so that multiple grammar
rules are processed at once, and so that we may take input in pieces,
before it is completely delivered to the program.  This will be
necessary to make real interactive dialog possible.

There will be challenges: such as detecting that something is wrong
with the current ’best’ interpretation, where to back up to undo the
earlier incorrect choice of interpretation, how to proceed from the
point at which you make a different choice, how to determine if the
new interpretation is better than the original.

Grammar and Interpretation

We are also working to make it easier to craft new grammar, which at
this time can be pretty challenging.  Consider that any construct you
wish to parse has to be handled in multiple ways, and also has to be
able to be "voiced" in a meaningful fashion.  Take as an example:

<subject> <action> <object> <adverb>

which matches the utterance "mario sees the princess poorly."  The
grammar rule that accepts this must correctly recognize and label the
input.  But for this construct to be completely useful, we also need
to handle:

"if mario sees the princess poorly....."
"if I say that mario see the princess poorly...."
"tell me that mario sees the princess poorly..."
"does mario see the princess poorly?"
"do i ask if mario sees the princess poorly?"

Streamlining grammar creation will allow us to enable existing code
that permits Brainhat to interpret dialog input.  Brainhat will need
not believe what you say, nor tell you what it thinks.  When I say
"mario sees the princess poorly," the only fact that the program will
record is "i say that mario sees the princess poorly."  Consider that
what I *say* may be subjective; Brainhat may wish to interpret what I
say based upon a stored inference.

The reason this change is important is that it will provide a mechanism
for processing idiomatic input without also considering literal meaning,
and it will allow Brainhat to speak idiomatically.   It will also allow
Brainhat to lie, or take the interlocutor to be a liar, which will be
crucial for gaming or role playing.  In less severe cases, it will
allow Brainhat to speak in response to its goals, in lieu of its
beliefs.

And of course, there are other things in the works too...

Any questions about anything?

Also, I have to make something like "move arm X inches in the X direction" work, for IAI. The "n inches in the X direction" will be an adverbial phrase. I need a number adjective to handle the "n."

March 13, 2002

I created a wild-card number attribute and some grammar to support the NASA project. You can say stuff like "robby move the arm 10 inches in the X direction."

I am throwing out the AUXTAGn collection in favor of a single tag, AUXTAG that refers to a concept. The concept can be anything, though by convention it might best be the rule where the auxtag was created. Again, the idea is that I want to be able to track the life of a CC from recognition through output.

The primitive will be:

    auxtag    concept

March 13, 2002

I’m working my way through the grammar. I am futzing with test cases for titular assignment. The one that zinged me was "the woman is a princess. is the woman a princess?" The answer came back "maybe" because the defined princess was already a woman, and to make the relationship work the other way around would cause a cycle. Routine title_assign refused.

      o woman
                           o

                              o princess

Should title_assign reverse the positions of woman and princess? That would make any woman be a princess. I guess that would be the right thing to do in the presence of a proposition "all women are princesses."

But, "the woman is a princess" is a tricky one. I will a have to return to this.

March 22, 2002

I need a better comparison routine than vrfy_xchild. I ran into a problem with a comparison between "speaker says that mario does not see the ball" (the child) and "(does) speaker say that mario sees the ball" (the parent). The "not" is glued onto the root of the child, but comparisons are made from the parent’s point of view: do i find a child of each of my components in the child CC? Anyway, I am going to have to work up a kludge.

March 24, 2002

Interesting problem to find this late in the game.... processing templates for inferences, I have disabled qacands, checkcommand and inferences. But I forgot to limit compare from looking in the context buffer while processing inference templates. Is it enough to skip the context when NOQA is set to "true?" Probably....

March 30, 2002

I made a change to check_orth_things that could break something else. Particularly, I commented out the test to see if there was a pre-existing child/parent relationship. This was useless for test028.t, where "mario is the red block", followed by "luigi is the blue block."

Well... that caused a horrible problem. I guess I could set NOQA before running the grammar rules that do titular assignment...

April 2, 2002

I am grieving over how to do all-at-once parsing of input, and I suddenly think that it might be quite easy given the data structures I already have. I should simply have to merge all input rules into one meta rule. There’s more to it than that, of course. But that gets me a lot of the way there.

As for the problem I was having yesterday:

"I want to talk to Kevin"
"I might want to talk to someone."
"Do I want to talk to someone?"
"Maybe...."

The issue is that "I might want to talk to someone" gets pulled from the context. "I might want to talk to kevin" doesn’t because ’kevin’ doesn’t get recognized as a candidate for the object position. This is because qacands and qacandsall are both avoiding the stuff in object roots. It might be hearsay, as in "the speaker thinks that the ball is blue." I don’t want "blue ball" becoming a candidate (I don’t think...).

Possible fixes:
1) make declques2.c more aggressive trying to find stuff in context.
2) make qacands/qacandsall decide when it is safe to mine the object roots for candidates.

April 3, 2002

"Mario was the king."
"What was Mario?"
"What was Mario?"

The above sequence breaks so horribly... don’t know why. The most peculiar thing is that it behaves better if I choose luigi instead of mario.

Hmmm.... a big clue: I changed

define    ccsent
     label          ccsent
     rule      $r‘csent‘0[ $r‘csent‘1]
     map       ROOT

to

define

ccsent

label

ccsent

rule

$r‘csent‘0

map

ROOT

April 5, 2002

I was finding suspicious stuff coming back from vrfy_child, and wierd things going into the negative cache for vrfy_child. I haven’t looked yet, but I think I can guess what was happening... Hmmm.... then again, maybe not.

The problem turns out to be that pullwhats makes copies of concepts with parents and children taken out individually so that chooseone can pick from among them. Once chooseone looks at a concept with missing parents, it gets removed as a candidate by the vcache. The right thing to do is shut off the negative caching inside vrfy_child when processing the results from pullwhats. Will do.

April 11, 2002

I was on CNNfn last night. It went pretty well. Rich has the database doing focus shifting in a pretty comprehensive fashion. Next, we are going to worry about how to load scenario information into the database.... notes follow.

(Later) Rich and I worked out some of the details about how we could store CCs in the database. I am looking at the notion of joining the context taken from the database to the running context in a temporary way. I don’t want all of the inferences a crap from the database to become part of the permanent collection. Rather, I want them to be available data for use by the rest of the program.

Stackable hash tables! I’ll tell you about them tomorrow!

April 12, 2002

Changed my mind. I am simply extending the notion of a hash table bucket to include a scenario ID. When new scenario data gets read into memory, I’ll hash it with the scenario ID. When it is time to more on to another scenario, I’ll go through and rip out anything with the existing ID number.

As for the context, I am going to build an intlink chain parallel to the context that keeps track of the scenario IDs. A special scenario ID, ’generic,’ will be for all things added by the program, and not sourced directly from the database.

Done. Now I need routines to add/subtract stuff from the hash tables and context. The routines will be:

addsctoctxt (con, scid)
rmscfrmctxt (scid)

The first routine will add concepts one at a time in some fashion (probably interleaved) with the existing context. It will create hash entries for the phash, chash, and whatever.

The second routine will strip all entries associated with ’scid’ from the context and clean up all corresponding hash table entries.

April 13, 2002

Okay, the first routine is done. Now I am grieving over the second routine. Particularly, I need to think about what to do with the hash table entries and context entries created at such time as the focus shifts away and the scenario becomes inactive. It is possible that it will become active again, perhaps soon....

Next things to look at: bestfit and memory management.

April 17, 2002

We are almost ready to try and resurrect CCs from the database.

The context will contain a mix of scenario ID "generic" (generated) stuff, plus stuff pulled in from the database. I need to think of a way to commit stuff that is learned from the available-but-not-permanent stuff in the context. Basically, I need a way to change the scenario ID of stuff hanging around in the context from whatever it is to SCID_GENERIC.

How will I know when to commit? A question is asked; the answer comes from the scenario-specific crap in the context. I need to recognize that the result of a question needs to be committed to the context in some cases. I will certainly need a new mproc routine like addtocontext, except that it stores only if the scid is not GENERIC. (or maybe I will used addtoctxt plus some kind of signal flag).

April 26, 2002

I am on a plane on my way to St. Thomas via San Juan. I just spent some time making repopulation of the context during a focus shift behave. More to do....

April 29, 2002

On the plane back...

I have been thinking about how to bust up processing so that the speech components don’t get tangled with the NLP components. The database already acts as its own program. It seems that the engine could stand-alone for use with text-only applications. Another program--a form of the engine--could communicate with speech engines to all-at-once parsing of input, make end-point decisions, and provide speculative hints to speech engines. The questions are where to break things up and how to coordinate the processing.

I could assume that the engine and this other component could share symbol tables and context through a shared memory space. The all-at-once parsing could contain tags and recovery histories so that the new process could provide a best guess stream of words and semantic symbols to the engine. I’m not sure where scenario shifting comes into play though. It will probably be too slow to help the speech engine.

All-at-once processing can be useful to the existing engine as well as to this new process.

Question: where does the current shifting take place? How will bestfit get incorporated?

On another note: I still haven’t figured out how to take a CC from the borrowed context of a scenario shift over to the working (0) context. I can easily add a flag into addtocontext to make it so that I can tell when I am being called from "questions." The trouble is that there is no way to tell that the thing I am being asked to add to context was the product of a question posed to a temporary piece of the context--a piece made current by a scenario shift.

Possible solutions: I could check the context to see if the fact that I have uncovered belongs to a non-zero scenario. The trouble is that I will now be checking the context for *every* answer generated. Or is that a good thing? I do have the context hash.... Hmmmm... Let me think about that. I could add an mproc that looks to see if the CC passed in is already in the context. If so, it could branch around a copy of addtocontext. Otherwise, it could get added to the context and to the discourse buffers. Or, the processing could be incorporated directly into addtocontext. Checking to see if a concept has already found a place in the context will keep me from repeatedly adding mundance facts....ala: "the ball is red. the ball is red..."

Did that. My input-patterns doesn’t seem to be able to override Rich’s input patterns. Why? Can’t test.

May 6, 2002

Working on the code that allows me to save stuff from one scenario into the context. It works if ’reap’ is shut off. Doesn’t appear to work otherwise. Not sure why. Tommorrow, I am leaving for California to go talk to press and stuff.

I created a routine to motivate scenario shifts based upon context affinity for something the user has said, and based on the probability that an inference might fire here or there. Rich hasn’t incorporated it into his code yet. The routine is called hlchoice(char *).

June 3, 2002

I am wondering why I made a routine called addintoctxt instead of simply using addtocontext.

June 4, 2002

Have a memory problem somewhere....

June 7, 2002

Thinking about parsing a little. I had an idea that the best way to improve the parse speed would be to compile all of the parse paths together into one big data structure, and hang exit points along it like berries on a vine. But thinking about it further, I think it might make more sense for me to simply cache the sub-matches.

For illustration, assume that the first part of an utterance includes a csubobj. All of the patterns that have a csubobj in the first position will be able to use the same succesful or failed parse attempt. The keys to recognizing an attempt are:

1) the memory address of the portion of the input string being parsed.

2) the memory address of the pattern being attempted.

The ordering of patterns can be preserved as they are now. The memory savings from avoiding re-parsing the same input should be phenomenal.

June 16, 2002

When a meme becomes active, Brainhat is handed the concepts and CCs from the database, and adds them to the context and context symbol tables (ctext and csyms). The context symbol tables are shifted in and out with meme changes, which makes the symbols specific to the meme being looked at at a given time. This is good, however, we wanted CCs that are generated within a meme to be available to all memes, along with their corresponding concepts. This is happening for the CCs learned along the way; they end up in a common context. But it isn’t happening for symbols because the context symbol tables (ctext and csyms) are shifting along with the meme id.

I propose that we
1) add symbols which are returned from the database to the symtab and txttab (but make them rw == TRUE) for the current meme. This is done in addtocontext_h.
2) shift the clean tables (symtab and txttab), but leave csyms and ctext alone--not shifted.

The will make it so that symbols that are referenced in coversation will find a permanent home in the context symbol tables. This will eliminate the complaints from the program about symbols being missing.

It looks to me like scenario.c is doing the shifting now, but the shifting is taking place with the context tables (ctext and csyms) and not the read-only tables (symtab and txttab).

June 17, 2002

I made changes to addinfctxt. It should be called just before addtocontext in input pattern rules csent-inference{1,2}.

June 18, 2002

To do:

Make sure that Mark Miller’s tutorial for Brainhat as a VoiceXML server works.

parequires working for "what color is the ball?"?

June 19, 2002

I am grieving over something I grieved over once before and never completed. The question is what to do about saving away questions so I’ll have a copy of them before they go through the likes of declques or attrques. The issue is that if I save the question before it is answered, I might not save the "right" question, since there may be multiple candidate questions, each a permutation of the possible choices for filling word slots. Likewise, if I wait until the question is answered before I choose to save it away, I may end up with a perfectly good CC representing the answer, but nothing that looks like the original question.

So, how do I solve this issue? One possibility is that I could mclone the question and hang it off its own special tag. The tag could survive through the question answering portion of the code and I could simply store it away in addtoqs after I know which form of the question "won." I still have the QUOTE tag hanging around. I could use that.

Any other possibilities?

(later) I stole quotques for the purpose. Early results look good.

June 20, 2002

I am working my way through Mark Miller’s FAQ. I came to a place where, in his example, an inference is entered after a fact that would fire it. In order to make Mark’s examples work, I need to make it so that the inference *can* fire previously learned facts. Interested.... why doesn’t speculate do that already?

(looked) Speculate only trolls two CCs deep into the context at present. I need to give new inferences a honeymoon whereby they can be exercised at many points within the context. I guess I could do this by simply looking to see if the first or second member of the context is an inference template. That sounds good!

June 24, 2002

Hmmm.... the question is: how do I decide what facts are interesting to the honeymoon sweep mentioned above? I can create hashes for the CONDITIONs and CONSEQUENCE. And I can create hashes for arbitrary propositions in the context, and their parents. But I don’t want to enable every inference for every proposition...

One thing that occurs to me is that, by virtue of an aborted approach to speculating from the database that Rich and I took once, I have hash tags dangling from CCs now--at least for the concepts appearing within the CC, though not their parents. Maybe I could attach all of the hash values when I run speculate. That would keep me from having to repeat a fairly expensive computation.

Hash values in hand, the matter of deciding which inferences apply to which propositions is a matter of comparing tags. I’ll also need a way to apply specific propositions to inferences, if such a method doesn’t already exist.

June 26, 2002

A problem with Mark Miller’s example:

Mark defines accommodations-1 and gives "rooms" as a synonym. The problem is that "rooms" is already part of the basic pool of words. So, when one later tells Brainhat "you have a sleeping pod; if you have a room then a room is available," the inference does not fire because it is looking at the wrong "room." The fix (I suppose) will be to package the VXML server without the pre-defined room-1.

(a little later) Looking at it more closely, Mark has said "if you have rooms then rooms are available." THis does work, but it would be easy for one of his readers to make the same mistake that I did. I’ll try to soften the fall.

On another topic: I thought I had handily managed the honeymoon inference thing, as decsribed above. Looking at some tests, though, I see that the hash values that are being assigned to CCs don’t always match those of the inference template. Hmmmm....

(A little later) It just turned out to be the room/rooms thing biting me in the ass again. I also have to worry about the use of the word "vehicle" in the colony 7 example; it clashes with the default words file.

July 1, 2002

Hmmmm.... I am looking at an issue that cropped up once before: how do I update context-resident copies of concepts so that all of the non-orthogonal attributes are included. The exemplar is "if i am in the water then i am wet." When I tell the program that I am in the water, it makes the inference that I am wet. The issue is that the statement it goes to save looks like:

define  Root-8e71 [999963534]
        label           csent-inference-1
        cause           Root-8e4e
        effect          Root-8e67
        hashval         655
        hashval         599

"speaker (in the water) implies speaker (wet)". It should be: "speaker (in the water) implies speaker (wet, in the water)". Need to understand why the in-the-water speaker isn’t around when it becomes wet.

The problem turned out to be updatectxt in the ponder routines. It was setting back the rlinks of concept that addtocontext had already updated, based on a primintive link count.

At some point, the algorithm for deciding when links should be updated from within addtocontext should go:

1) Are the links for the context resident copy and the copy within the context different?

2) If so, are they orthogonal?

3) If not, then merge and update the context.

July 6, 2002

Is the problem with test046 that the QUOTE isn’t comparing in a $Z match from within declques2?

Yep! That was it. QUOTE was being compared from within vrfy_xchild1.

July 7, 2002

I disabled the rampant assignment of HASHVALs from within tests.c. I wasn’t getting any value from it, and ddhashlink was consuming half of the CPU. Still, I have an issue to look into with honeymoon: why does the honeymoon inference not fire sometimes? If I say "i like food. if i like thing then i want thing", it works as expected. If I say "i like food. the ball is red. if i like thing then i want thing", it doesn’t work until I say "what do i like?"

Hmmm... the reason is that I am not storing all of the possible (parent) permutations of a CC in the context hash. When should I do that? In a ponder routine? Sounds like a good idea. I should be able to save some time in proposition2, I would think....

July 23, 2002

The component concepts of a CC that comes in from the database are not always being saved within addtocontext. The problem is that they come from the database as clean copies of things that were once dirty I need to make them Where should I do this?

July 29, 2002

I need to make it so that inferences don’t repeatedly fire. I had some ideas a few weeks ago....

Also, I need a routine to use instead of ’speak’ in csent-common. The new routine will say "okay" if the conchain is not empty. Or it will say "i didn’t understand" (or something) if the chain is empty.

The ’I might want to talk to someone’ problem I had a while ago appears to be an issue with satisfying TNP. In the context I have: "i might want to talk to someone" and "I want to talk to kevin." When I ask "do i want to talk to someone?," the fact that the ’someone’ matches brings me to a TNP comparison that pits future-imperfect against present. Hmmmmm.... I want the ’yes’ answer to win over the maybe....

The test case is:

i did want to talk to someone
i want to talk to mario
do i want to talk to someone?

July 29, 2002

"I must tell you something." "I hid some money."

August 2, 2002

>> what does it not have
Segmentation fault (core dumped)

August 24, 2002

"tell me what is the ball" has never been implemented. It sort of correctly says "what is the ball." "tell me you are glad" works, as does "ask me what is the ball." The best current kludge is "tell me the ball."

August 25, 2002

In the statue meme: "is the head valuable?" produces some inference-generated observations that end up in the discourse buffer. They should not be in the discourse buffer; the discourse buffer should be filled as the result of discourse!

(later) There was a kludge from August 28, 2002 where I made it so that self-talked stuff would show up in the discourse. This was coupled with speak being turned on for all non-questions. Now that I have speak generally shut off, stuff is getting into the discourse buffer even though it may not have been seen by the speaker. I need to undo the kludge, and I need to re-kludge (I think) so that stuff that goes through checkcommand as "tell the speaker...." gets into the discourse buffer.

I guess that if ’speak’ puts something into the global buffer, it should end up in the discourse. Also, it seems that there should be an mproc that calls speak to echo the input in the case that there is no pending output.

September 6, 2002

"I know you"
"What do I know?"
"you say to know me."

Hmmmm.... I want to see the ball. I know to go to the mall. I love to see the princess. I say to know you.

Some verbs work with the infinitive. Others don’t. I might need a parent and a cc-pattern to tell me which I am working with.

September 10, 2002

I am going to go through and try to straighten up all of the name stuff. It is pretty broken. I will run the tests first.

September 12, 2002

Went to Washington yesterday to talk to a Mr. David Steinberg. The plane didn’t blow up. Nothing blew up. Nice weather too.

"ask me what is my name"
"ask me what is my color"

The first voices correctly, but the CC created is a broken. The second doesn’t even voice right.

September 17, 2002

Working on name-address assignments and uses... I fixed "my name is x" by reordering the rules in input-patterns.txt.

The other name-or-address assignments create CCs that look like this:

             o extension
            /            /             /            ATTR     ATTR
        /          "111" o           o Root
      /          /      /  ORTH    PREP     /          /    OBJPREP
  CHILD    o   o         /      adj  of        o Rich
 o adj

I need to make a couple of adjustments. For one, the restriction that the attribute be orthogonal to ’adjective’ is a little too strong.

Secondly, I need to make sure that the same treatment happens for ’name’s. Currently, the mproc that handles names adds a new label to the SUBJECT. I would like to continue to do that, but also create a copy of ’name’ with the attributes as shown in the example above.

September 23, 2002

If you refer to a ’he’ or a ’she’ and the program ends up finding a thing to resolve the ’he’ or ’she’ against, which is not a child of male-1 or female-1, BUT is a child of human.

September 26, 2002

Bug:

>> if a person has clothes then a person wears clothes.
 if a somebody has clothes then a somebody wears clothes.
>> my friend has a suit
 your friend has a suit.
>> mario has a sweater
 mario has a sweater. mario wears a sweater.

October 1, 2002

Need to turn indefinite articles into definite articles....

Need to think about making inferences fire just once on a
particular fact in a particular time-frame.

October 4, 2002

Hints!
Vocabulary!

Time is running short before speech tek, but I
am thinking that I might want to modify the
SAPI client and Brainhat to be able to handle
word and sentence hints.
I already feed the client a static list of
word hints,
but with the database in place, I can start making use
of dynamic lists.

In addition, I thought I might be able to feed sentence
hints to the engine too.
These would come from ready inferences; the conditions
could be fed to the speech engine:

do you ...
are you ...
what are ...
what is ...
subject verb object (speaker is happy, balls are red...)
subject tobe object
subject tobe attribute

The subjects and attributes could be fleshed out so that I get some of the taxonomic advantages of the vocabulary. I could 1) get the children of inference subjects and objects that I find in the context, 2) get terminals of subjects and objects from the symbol table--terminals being at the level found in the inference or one level below, with no children.

November 7, 2002

Rick Lewis is trying to use Brainhat as a FAQ server for a group of psychiatrists. He asked for some changes in the way Brainhat serves dynamic output. Rather than do the top.html and bottom.html thing we do now, he’d like to make the "form" statement choose what comes next. Here’s his suggestion:

<html>
<body>
<form method="PUT" action="http://my_brainhat/dialog?conv=2851&file=help.html">
<input type=hidden name="content" value="off">
<center>
<brainhat_out>Welcome to Intelligence by Brainhat</brainhat_out>
<p>
<brainhat_content>Please enter an information request
+sentence:<br></brainhat_content>
<input type=text name="Stmt" length=40>
</form>
</body>
</html>

The "conv" parameter was to be a cookie number. The "file" parameter described what file is to be returned with the next cycle (provided that Brainhat doesn’t "serve" a file as result of an inference). The "<brainhat_out>" tags describe where Brainhat should place the results of the previous evaluation cycle, or default text upon first evaluation. The "<brainhat_content>" area is for additional content, such as brainhat-generated hints.

If the "file" parameter were missing or the specified file were not found, then we would try to fall back to "default.html."

November 26, 2002

I need to look at condition/consequence pairs in some fashion to see if they have already tested true. That way, I can avoid re-evaluating things like: "if you are not a boy then you might want a dolly." I am thinking that I would like to do this in some cheap, reusable fashion. Perhaps I could keep track of hash numbers for conditions and consequences and avoid looking at things that *seem* to have been evaluated already (there is some danger that the same hash value pairs could appear for a different set of conditions and consequences, though it is not likely).

November 30, 2002

Thinking about it some more.... the reason why "if you are not a boy then you might want a dolly" gets repeated is that the tense gets changed on the way to the context. So when Brainhats tests to see if I "might you want a dolly" it finds "i do want a dolly" or "i don’t want a dolly." Testing the context for the consequences of an inference seems like an expensive way to be keeping track of whether to run inferences... I should look into the hash/cache anyway.

December 2, 2002

"what is the time?" breaks the database version. Why?

December 3, 2002

Found a buffer size issue. That might’ve been the problem....

On another front: hmmmm..... getconbyname is called from the ’s’ pattern as opposed to a call to searchsym. This is causing me to get just one ’s’ candidate. I was finding that the one candidate might be wholely inappropriate; it might be orthogonal when used. Anyway, I am replacing the call to getconbyname with a traditional symbol table lookup.

Later:

put the ball [in the bin]
move the ball [(for) 10 inches]
set the alarm [for 10 (thing)]
set the alarm [for 10 o’clock.]

Each is an adverbial phrase. When objprep has an attribute which is a quantity then do a "metric" and "magnitude" in the robospeak output. Otherwise, use "target" and "disposition" as the output fields.

December 4, 2002

The first part, ’set the alarm for 4’ goes okay, but the ’zegs’ part (interpreted as a new utterance) explodes.

December 5, 2002

Well, I am grieving over a number of things. Among the simpler ones is the ability for Brainhat to identify when it knows something. E.g., ’if you know X then....’ Brainhat could ask itself ’what is X?’ If the answer comes back as ’empty’ then the program doesn’t know.

Next, I really need to get around to eliminating verbatim mode and making idioms work.

I need to streamline the evaluation and caching of inferences. I also need to continue to add more structure to the way they are handled.

And, most pressingly, I need to handle *time*. There is some time functionality implemented now, but it probably won’t survive this next effort. The motivation is that we met with a group that is planning to put together a set top box with some intelligence in it. One of the applications would be an alarm clock, plus anything else that involves any form of scheduling.

I was thinking that I might create a new link type, TIME, which would hold the time in seconds since the epoch. This would be available for appending to CCs (so that we could age them in a ponder routine) and for dangling from This will give the CC two representations.

            o hours
           /
   TIME  /  |  ATTR
       /    |       o      |   o 10
 103294324  |
            | ORTH
            o
          time

Chris is puting together an agent that will serve as an alarm clock for us. It will be on the other end of a TCP connection and will be available for such questions as "what time is it?" and "set an alarm for 109302043".

A program might say "if i say wake me at time1 then tell robby set an alarm for time1 and if the time is time1 then tell me to wake up." (Need to recurse on inference templates....)

December 6, 2002

Time is a thing. "11:30 on Tuesday" is a modifier of time.

            o time
           /
   TIME  /  |  ATTR
       /    |       o      |   o hours
 103294324  |                | ORTH  EMPHASIS
            o                  time        o 10

Supplemental notes. I am in Germany at Bettina’s house.

Some things to work on: 1) Time.

2) Cache inference results.

3) Need to fix C2 level caching in find.c for database version.

4) The flag settings going into checkcommand for statements of the sort "if i ask if ..." are still broken; the condition ("if i ask...") is being executed while we are meme-shifting in focustest.

5) Need to get back to making the operation robust and predictable.

6) Need to cut the cord w.r.t. to verbatim understanding of user input. In the same vein, I need to implement "if you know...." and that sort of thing.

Time waits for noone. I will start there...

"at 3 am"

                o time
              /         TIME /      ATTR
          /                o           o am
    2048958945...   |
                    | EMPH
                    |
                    o 3

"3 o’clock train"

                o train
              /         TIME /      ATTR
          /                o           o o’clock
    2048958945...   |
                    | EMPH
                    |
                    o 3

"wake me at 3 in the morning"

                   o Root
                 / |          SUBJ  /   |    VERB
             / OBJ |              o       |         brainhat      o
                speaker   o to-wake
                          |
                          | ADVERB
                          |
                          o Root
                         /                   PREP /     OBJPREP
                     /                          o          o time
                at          / |
                          /   | ATTR
                        o     |
                   12892...   o am
                            /
                          / EMPH
                        /
                      o 3

How do I tell when I need to substitute "time" as a thing to hang a specific time one? I guess I can look for an article. Nobody ever says "I will see you at the ten oclock." They can say, however, "I will see you on the ten oclock train." Or "I will see you at ten o’clock (time)." I guess "time" could be implied and replaced by a thing if one is available. That would make treatment uniform for "i will see you at the ten o’clock (time)" even though noone sys that.

Now, what about "I will see you monday?" That would be "I will see you (at) monday (time)".

Hmmm.... maybe all expressions of time should have an implicit "at." This would make "the ten o’clock train" be "the train (at) 10 o’clock (time)." "Wake me at 10 am" would become "wake me at 10 am (time)." "What time is the train" would become "where (when) is the train."

                o train
                                     ATTR
                                       o Root
                  /             PREP /      OBJPREP
              /                    o           o time  -------- o 04340243...
          at            |
                        | ATTR
                        |
                        o o’clock
                        |
                        | EMPH
                        |
                        o ten

December 18, 2002

"mario sees the red ball. does mario see the blue ball? does mario see the red ball?"

December 21, 2002

I am looking into a number of things from the list above. I’d like to get a 10 or 20 fold increase in the speed of inference evaluation. I think it might be reasonable to not call self-talk to evaluate the conditions of an inference. Conditions could be evaluated with a slightly better vrfy_xchild.

The other area that needs work is the generation of hash tests. When ponder discovers a CC, it looks into hashes for all of the parents of the concepts that participate in the hash. There can be a computational explosion if we are too deep in the taxonomies of the components. A verb five levels down, plus a verb 4 levels down, a noun 5 levels down, combine to create a group of 5x4x5 = 100 hashes to be investigated. It can be much worse if the hash components have multiple root parents. I just don’t have a good solution for solving this problem--a problem that Pascal tried to tackle in a scalar fashion so long ago. Is there a good algorithmic, linear-algebra-based or fractal solution?

At any rate, I really need to make some profiles to find out where the time is going. I could be making problems up....

test51?

December 26, 2002

Working on time. Adjectives used at emphasis are not checked for orthogonality. That means that you can get stuff like "10 3 pm", just as you could get "very not very big." Need to included emphasis in orthogonality checks.

January 2, 2003

I scraped the treatment of time described above. Time is a thing. Hours, minutes, days, etc. are things. The number of minutes, hours, etc. are attributes.

I am grieving again over literal interpretation of utterances by Brainhat. Ala, "if i say that a thing is red then a thing is blue." I need a flag that says that I should only interpret what the program hears, but not take it literally. This should live alongside the VERBATIM. In fact, I have changed the use of the verbatim flag. flag.

 CREDITSPKR   VERBATIM      result
---------------------------------------------------------------------------
 FALSE        FALSE
 FALSE        TRUE          the ball is red.
 TRUE         FALSE         the speaker says the ball is red.
 TRUE         TRUE          the ball is red, speaker says the ball is red.

I left off today looking at utter_what and utter_what1.

January 6, 2003

Fixing a compound issue with the sequence:

i am happy.
i was happy.

1) The phrases "was happy" and "am happy" are orthogonal, and so should be added to ’speaker-1’. addlink refuses to re-add ’happy-1’ to ’speaker-1’ because it sees them as being the same thing. addlink needs some new functionality.

2) tobecomp2 adds tenses to attributes, even in cases where it could cause othogonality violation.

January 7, 2003

"if i say that I am happy then i am red" "i am happy." "am i red" (maybe. you are red) The problem appears to be this gratuitous extra definition of speaker-1 in the local symbol table.

The intermediate labels are being stored in the symbol table to help with the database’s re-population of CCs. Hmmmmm.... Do i want these intermediate definitions in the symbol table? They are necessary for re-populating extra CCs, but I don’t know if they should be returned by getconbyname....

This is in routine addtocontext_i.

All that aside, the problem with "am i red" is tied to issues with the VERBATIM setting.... Looking into it.

January 8, 2003

Yesterday’s problem turned out to be nothing.

I just ran a profile of the database version cht-chatting about various things. This is what I found:

 time   seconds   seconds    calls  ms/call  ms/call  name
 16.88      4.16     4.16  4539494     0.00     0.00  value2int
 14.73      7.79     3.63  4763832     0.00     0.00  srchsym
 13.10     11.02     3.23  4811687     0.00     0.00  ccompare
 12.21     14.03     3.01 29064250     0.00     0.00  lset_element
 10.71     16.67     2.64    16041     0.16     0.16  keep_concept
  5.76     18.09     1.42  4632155     0.00     0.00  init_cargs
  2.76     18.77     0.68  4093417     0.00     0.00  cmatch_first
  2.27     19.33     0.56   660256     0.00     0.00  procsubrule
  2.03     19.83     0.50   661677     0.00     0.00  recursive_expand_rule

Routine alue2int is about to be replaced with a unique hash function that can be referenced in-line. I am going to init the hash at program startup. The object will be to use a small hash table and a function that uniquely hashs each symbol covered by value2int. The function may not be discovered until runtime....

January 13, 2003

I applied a cache mechanism to CC pattern matches, and to subproc rule expansion, but I am finding that in certain combinations, the caches don’t work. After some thought, it occurs to me that the issue might be that using a tuble of {con, rule, cserviceid} might not be sufficient to tell whether a preciously applied cc pattern match’s results are still valid. Consider the case where a CC is modified in-place. It’s address does not change, but its contents do, which would make the test above almost useless.

The fix might be to call clone_con() any time I affect a change to a CC or concept, and use the new address as the stand-in for the old one. Or, I could add a ’modified’ flag to the concept. This could become part of the tuple, and would solve the problem the would arise when I get a concept as an argument, but not the address of the things pointing to it. While I’m adding new things to concepts, I should also be thinking about relocating some of the concept elements that have to do with rule processing to another auxiliary structure.

If I did add a ’modified’ flag, it should really be a copy of the tag value at the time the concept was last modified. This would make it possible to recognize when something was modified, for comparison against the tuple.

A separate issue: I eliminated the use of T0 (a temporary) in favor of input-pattern caching. However, I am having an issue that the top-level pattern may be exercised more that once, which can cause side-effects. For instance, there’s an input pattern that is for gathering addresses of various sorts. It calls roboport, which makes connections to external robots.

January 20, 2003

Working on grammar....

Imperatives:

"play something" -- handled by imp-action-1

"i say play something" -- sent-action-10/imp-action-1

"if i say play something then you are happy" -- grab-adjective/sent-action-10/imp-quote-2 (wrong!)

"do i say play something?" -- question-action-1/imp-quote-2

Work notes:

imp-quote-2 is at line 1034:
rule            [$c‘enablers‘5! ]$s‘imperative‘3!$s‘speaker-1‘0!$s‘brainhat-1‘2!$r‘extactions‘1! [$r‘csubobj-prep‘0! ][that ]![if ]$W‘#‘4

imp-action-1 is at line 1059
rule            $s‘imperative‘3!$s‘brainhat-1‘2!$r‘extactions‘1! $r‘csubobj-prep‘0

I am commenting out imp-quote-2 to see if imp-action-1 wins if not occluded.
Yes! "if i say play something then you are happy" now works.

"do I say play something?" also works now.

I think that I need to move imp-quote-2 down a few patterns....
I moved imp-quote-2 down to the bottom of the ’imp’ section.
All is good.

Now I am looking at:

"brainhat plays something"
It is getting snagged as an imperative by imp-action-1.
What do I do here?
If I could identify that brainhat isn’t a robot then
I could skip ahead to sent-action-10, I suppose.
Looking at imp-action-1.
Let me try that.

Hmmm...
the difference between "brainhat plays something" and "brainhat play
something" is being lost in "imp-action-1."
"play" is an imperative; "plays" is simply the verb.
Currently, "toplay" is the parent, and the child of
extactions.
I could make sure that the VERB is a child of the third person.
I am experimenting with ’extactions-3p’.
I changed imp-action-1; now changing imp-action-2.

January 21, 2003

I am testing the new wildcard pattern match that Chris created for the input patterns. Created imp-action-4e.

Getting a clash when i say "winamp play king of the bongo." "king of the bongo" is stored as such. When I say "winamp play water song" I get something else. Difference (I guesss) is that water song is stored under "hot tuna - water song." Looking to see... why does rule imp-action-4b eclipse imp-action-4e?

imp-action-4b is at line 716.

imp-action-4e is at line 740.

Fixed by swapping positions. The issue was that the "king of" part of "king of the bongo" matched a csubobj+adverb.

I want "something else" to be a working thingy, as in "play something else." Currently, csubobj4 soaks up "something" and leaves "else" behind. Looking into how I might do this...

"what else do you have?" is matched by question-what-10. That calls ccdiscrm. Let me see if I can steal that....

A new pair of "csubobj"s that handles constructs like:

something else
another thing
a different thing
something different

I created condiscrm to see if I can make
"i want something else" work.
Testing by placing a rule just before csubobj4.

All working, though I noticed that ’something’ is
an x-template, but I am not sure why.
I want to say "something else..." in the course of
discussion, but it won’t behave the same way as
"thing else" would.  Hmmmm....
What will happen if I make "something" a synonym for
"things?"

I also want to understand why imp-action-1
couldn’t reasonably use csubobj-prep-q in
lieu of csubobj-prep.
I would want that so that I could take advantage of the
new "else" patterns....

January 23, 2003

Divorced.

Need to run tests after yesterday’s changes.
Then I need to make the last few changes mentioned at
the bottom of the previous paragraph.

January 27, 2003

Forgot whether I ran the tests.
Re-running them now.
There are issues with test059 and test064.

I removed ’something’ as a stand-alone concept and
added "something" as a synonym for things.
No discernible changes in the test output.
Checking the input patterns that nominated ’something’
directly.
Looks okay.

For review, now:
what’s the difference between csubobj-prep and
csubobj-prep-q?
Just for kicks, I added subobj0 and
subobj0a--clones of
subobj0-q and
subobj0a-q to
the class of subobjs.
In testing, I noticed an issue reading
from ’brainhat.init.’
Not sure what is going on there...
Fixed.

Looking at csent-inference-1.
Something wierd happening with conjunctions.
Fixed.

Now I am looking at making the affinity ("wants") of a
CC work a little better.

>>  winamp hears.
>> if i say play something then winamp play a different mp3
 if You say play something then winamp plays a different mp3.

When rich adds "I have <something>" does he also add the individual concepts associated with the CC? I am getting lots of dirty messages from "getconbyname" when I talk about the MP3s.

An issue with "play foo...." It used to be handled by imp-action-1b. Now it is being grabbed by imp-action-6.

I am wondering if Chris’ wildcard pattern, $q, should be part of the subobj set. Might be very handy. I could amend it so that it also looks for strict $c candidates too. The problem with "play king of the bongo" is that "play king" is working out to be a match....

I created a rule, imp-action-1c that uses the $Q primitive to match everything to end of line. This rule appears before any of the other imp-action-1x rules. I am hoping that this will allow me to test ’king of the bongo’ before a rule gets around to trying it as

End of day; I haven’t tested the above fix yet, but if it works, it will make "if i say play something then winamp play something" work reliably.

I also need it to work for play something by so-and-so....

January 28, 2003

I am going to see about adding the wild card patterns as part of subobj. I don’t know what this will do to performance, but.... (try it later).

If I say play an MP3 then... If I say play an artist then...

I am now grieving over why "play overload" works once, but not twice. Clues.... addtocontext looks to see if something is in the context once already. If it is, it doesn’t re-add it. This may be why the inference is not re-firing. I could make an exception for CCs with imperative tense.

This was the issue. Here’s an idea: I could swap context locations for things that are recently re-mentioned... pull them forward in the context. This could be effected by simply changing the chain links.

January 29, 2003

Hmmmm.... The inference that says "if i say play an mp3 then winamp play an mp3" keeps firing after I use it the first time.

I just added a $Q rule as a csubobj-stmt... testing. Look for csubobj-stmtwc1 if something breaks.

Look into ’exec’ flag for exercise of statements like It looks like the ’play overload’ part may be causing side effects.

Fuck. Lots of shit is broken now. I compiled a non-db version. Testing. Seems to be an issue with the db version.... non-db is okay.

January 31, 2003

Looking at failure of $Q pattern in sentences like "do You say play 02 - king of the bongo?" ...looking at $q, which captures the initial question: do you say play king of the bongo? I added a pause to imp-action-1d.

February 3, 2003

Fixed that.

I am running down messages from getconbyname wherein a concept that is presumed to be in the context is not being found. I am suddenly thinking that this might be related to verbatim mode. Testing theory by turning verbatim on. That made a difference. Will investigate. I am also interested in understanding whether addtocontext is getting called repeatedly durning meme shifting (and trying to save stuff).

Meme Set Focus: Brainhat Core

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030127.

>>  winamp hears Me.
>> hello
 hello.
>> what is it?
getconbyname: cannot find "greeting-a0c4" in symtab(s).
getconbyname: cannot find "greeting-a0c4" in symtab(s).
getconbyname: cannot find "greeting-a0c4" in symtab(s).
getconbyname: cannot find "greeting-a0c4" in symtab(s).
getconbyname: cannot find "greeting-a0c4" in symtab(s).
getconbyname: cannot find "greeting-a0c4" in symtab(s).
 I do not know.
>

[dowd@maddie ~/brainhat]$ ./brainhat
Meme Set Focus: Brainhat Core

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030127.

>>  winamp hears Me.
>> hello
 hello.
>> break

Break in debug at the start:
debug> xspeak 1
 You say hello. winamp’s address is 192.168.111.2.
debug> xdump 1
define  Root-a0bc [999958851]
        hashval         147
        object          greeting-a0c4
        person          second
        number          singular
        tense           present
        verb            tosay-1-a0c1
        subject         speaker-1-a0c2

The issue is that greeting-a0c4 is not in the symbol table, which makes it impossible to locate when it comes to to store "the speaker asks what is greeting-a0c4." This only shows up in non-verbatim mode....

Found the issue. It occurs in lowpronouns.c, around line 320. I am looking into the symbol table for things that are referenced in the discourse buffer. In non-verbatim mode, there can be things in the symbol table that never make their way to the symbol tables. Ameliorating....

February 4, 2003

Working on a merge...

Unpacking the stuff I sent to Chris originally... into "deleteme". I will check to see what has changed since I sent Chris the source which he cleaned up....

February 5, 2003

Oooof. A couple of tough days.... A power glitch blew up maddie’s root partition yesterday. Today I was served papers because my landlord hasn’t paid his condo fee. I’ve been here *two weeks*!

February 6, 2003

"what do you have by the stones?"

I need to push the attribute "by the stones" down on the object as a requirement.

"do you have a house by mario"
"do you have a house by luigi"
"do you have a house by mario"

There are myriad ’requires’ tags accumulating. See question-action-2.

"what do you have [that tobe] by mario."

the "[that tobe] by mario" section could be used to come up with an attribute that has tense (defaulting to present). It needs to be pushed down onto the object as a requirement when completed. The same form should work for "do you have a house that is red." This could be a kind of ccattr--"that is red."

Why isn’t there a csubobj for "house in the water"? I bet there is one, but that it caused issues. Let me go find it....

February 10, 2003

Working on winamp plug-in some more...

[dowd@maddie ~/brainhat]$ ./brainhat -u kdowd/kevin@127.1 +verbatim
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme: Brainhat Core   ID:  1  Location: localhost

Memelist-Local: (1)
Memelist-Extra: ()
Meme Set Focus: Brainhat Core

Meme Cycle: (1 )

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030207.

>> you have a house
 I have a house.
>> do you have a house?
 maybe. I have a house.

This is broken....

Fixed. Now the question is why the portions of previous questions are being stored. I ask "do you have a block by mario?" The "block" gets "by mario" as a requirement. That makes its way into the context.

Hmmm.... What if I say "you have a red house. do you have a blue house?" Will that be screwed up too? Yes. That’s broken too.

Shutting meme shifting off, verbatim on. Using ’pause’ to find the spot where things break. Broken after addtocontext....

Let me take a look at "speaker asks house is blue."

Hmmm.... mpareq is creating the illegal house (blue + red). It turns REQUIRES back into ATTRIBUTEs. If you have "requires blue, is red," you end up with "is red, is blue." The nex question is "why is the broken result being stored into the context?"

Fix (I think): I need to check for ’auxtag no-object-context’ at the top of addtocontext.

Got it. Now I need to make ’you don’t have an mp3 by mario’ to work correctly.

February 11, 2003

Ooof. There seems to be a problem with the combination of memeshifting commands that the workstation uses in combination with reap. I don’t have time to look at it now because we are trying to pull together a demo. For the record, here is a clipboard of the problem.

[dowd@maddie ~/brainhat]$ ./brainhat -u kdowd/kevin@127.1 +verbatim +memerate +p
trace
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme: Brainhat Core   ID:  1  Location: localhost

Memelist-Local: (1)
Memelist-Extra: ()
Meme Set Focus: Brainhat Core

Meme Cycle: (1 )

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030207.

>> break
find: rule debug-entry matched: break

  FocusTest
      Meme Initial
         -1-
      Matched and Input Consumed

find: rule debug-entry matched: break

Break in debug at the start:
debug> loginnocycle kdowd/kevin
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme: Brainhat Core   ID:  1  Location: localhost

Memelist-Local: (1)
Memelist-Extra: ()
Meme Set Focus: Brainhat Core
debug> shiftnocc 1
debug> shiftoff
Meme Shifting Disabled
debug> cont

>> brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj-ana matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule actions matched: has a house by mario.
find: rule subobj1 matched: a house by mario.
find: rule subobj1 matched: mario.
find: rule subobj1 matched: mario.
find: rule csubobj4 matched: mario.
find: rule ccattr0 matched: by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule csent-common matched: brainhat has a house by mario.
find: rule ccsent-top matched: brainhat has a house by mario.
 I have a house.
>> brainhat has a hospital.
find: rule subobj1 matched: brainhat has a hospital.
find: rule subobj1 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule subobj1 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule subobj1 matched: brainhat has a hospital.
find: rule csubobj-ana matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule actions matched: has a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj-ana matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule actions matched: has a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule csubobj4 matched: brainhat has a hospital.
find: rule subobj1 matched: a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj-ana matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj-ana matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule subobj1 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule csubobj4 matched: a hospital.
find: rule subobj1 matched: hospital.
find: rule subobj1 matched: hospital.
find: rule csubobj4 matched: a hospital.
find: rule tell-all-csubobj matched: a hospital.
find: rule sent-nomod matched: a hospital.
find: rule sent-action-10 matched: brainhat has a hospital.
find: rule sent-action-10 matched: brainhat has a hospital.
find: rule subobj1 matched: brainhat has a hospital.
find: rule sent-action-10 matched: brainhat has a hospital.
find: rule csent-common matched: brainhat has a hospital.
find: rule ccsent-top matched: brainhat has a hospital.
 I have.
>> break
find: rule debug-entry matched: break

Break in debug at the start:
debug> xspeak 1
 You say I have. I have. You say I have a house. I have a house.
debug> xdump 2
define  Root-085b-0869 [999997860]
        label           sent-action-10
        child-of                things
        auxtag          no-object-context
        hashval         11
        subject         brainhat-1-072f
        verb            tohave-1-086a
        tense           present
        number          singular
        person          first

debug> list hospital
  (basic.pool.txttab) hospital->hospital-1
debug> sdump hospital-1
define  hospital-1 [433]
        label           hospital
        label           hospital-1
        orthogonal              building-1
        child-of                building-1

debug>
>>
goodbye!
[dowd@maddie ~/brainhat]$ ./brainhat -u kdowd/kevin@127.1 +verbatim +memerate +p
trace +reap
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme: Brainhat Core   ID:  1  Location: localhost

Memelist-Local: (1)
Memelist-Extra: ()
Meme Set Focus: Brainhat Core

Meme Cycle: (1 )

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030207.

>> break
find: rule debug-entry matched: break

  FocusTest
      Meme Initial
         -1-
      Matched and Input Consumed

find: rule debug-entry matched: break

Break in debug at the start:
debug> loginnocycle kdowd/kevin
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme: Brainhat Core   ID:  1  Location: localhost

Memelist-Local: (1)
Memelist-Extra: ()
Meme Set Focus: Brainhat Core
debug> shiftnocc 1
debug> shiftoff
Meme Shifting Disabled
debug> cont

>> brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule csubobj-ana matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule csubobj4 matched: brainhat has a house by mario.
find: rule actions matched: has a house by mario.
find: rule subobj1 matched: a house by mario.
find: rule subobj1 matched: mario.
find: rule subobj1 matched: mario.
find: rule csubobj4 matched: mario.
find: rule ccattr0 matched: by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule subobj1 matched: brainhat has a house by mario.
find: rule sent-action-attr-2 matched: brainhat has a house by mario.
find: rule csent-common matched: brainhat has a house by mario.
find: rule ccsent-top matched: brainhat has a house by mario.
 I have a house.
>> brainhat has a hospital
find: rule subobj1 matched: brainhat has a hospital
find: rule subobj1 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule subobj1 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule subobj1 matched: brainhat has a hospital
find: rule csubobj-ana matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule actions matched: has a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj-ana matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule actions matched: has a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule csubobj4 matched: brainhat has a hospital
find: rule subobj1 matched: a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj-ana matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj-ana matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule subobj1 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule csubobj4 matched: a hospital
find: rule subobj1 matched: hospital
find: rule subobj1 matched: hospital
find: rule csubobj4 matched: a hospital
find: rule tell-all-csubobj matched: a hospital
find: rule sent-nomod matched: a hospital
find: rule sent-action-10 matched: brainhat has a hospital
find: rule sent-action-10 matched: brainhat has a hospital
find: rule subobj1 matched: brainhat has a hospital
find: rule sent-action-10 matched: brainhat has a hospital
find: rule csent-common matched: brainhat has a hospital
find: rule ccsent-top matched: brainhat has a hospital
 I have a hospital.
>> break
find: rule debug-entry matched: break

Break in debug at the start:
debug> xspeak 1
 You say I have a hospital. I have a hospital. You say I have a house. I have a
house.
debug> xdump 2
define  Root-085b-0869 [999997860]
        label           sent-action-10
        child-of                things
        auxtag          no-object-context
        hashval         877
        subject         brainhat-1-072f
        verb            tohave-1-086a
        object          hospital-1-086c-086e
        tense           present
        number          singular
        person          first

debug>

Looking at hlscore. I am trying to figure out why "input consumed" is not true when I say "if i say play something...." and then I say "play something...." Applicable pattern is "imp-action-1c."

February 12, 2003

At some point, I need to make debug output all go to dbgfp, and change that fp as I enter and leave debug. Currently, much output goes to stderr, even when in debug mode.

What happened here?

>> i like you
 You like.
>>

Also, the inferences that are supposed to fire when I say "the user might say...." don’t.

The rule that handles these statements, csent-inference-2, records the part that comes after "speaker might say X." I want to record that the "the speaker says X." Doing a little work. I need an mproc that goes from:

                o Root                    o Root
                                                             COND          ==>        COND
                                                                o "hello"                 o Root
                                            / |                                       VERB /  |   OBJECT
                                          / SUBJ                                    tosay  o    |                                                  o                                                speaker   o hello

Why does "play that" no longer work?

I want this to work: "i might like music" "if i say that i like music then ...." Am I limiting the chaining of inferences too much?

February 14, 2003

Need to start working in the workstation. I want the word ’something’ to refer to an mp3 in the music meme, which means that thing-1 and mp3-1 will have to be overrides.

Hmmmm... I am looking into why "mario sees the mp3" resolves a song from the context, yet "play a mp3" does not. The first is handled by subobj1, csubobj4, tell-all-csubobj, sent-nomod, sent-action-10.

The second is handled by subobj1, imp-action-1.

"What mp3 do you have. Play that." I am ending up with nothing because of some symbol table issues.... Look into this.

February 18, 2003

Workstation....

* created a music meme.
* removed "something" as a synonym for things.
* added "something" as a synonym for music.
* removed "this" and "that" as synonyms for "it-1."
* added "this" and "that" as synonyms for music.

Shut off sent-action-10a because it was getting in the way.

February 20, 2003

I am looking at using cycletags to track whether a concept
has already been involved in the successful execution
of an inference.

shutting off ’honeymoon’
changed ’csubobj’ in csubobj-stmt1 to ’csubobj-prep’.

February 27, 2003

if i ask do you have someone and you have an mp3 by someone then you are...
the "you have an mp3 by someone" part is not handled yet.

"who is this by?"

March 5, 2003

Working on "what do you have by <foo>"

March 9, 2003

New web pages:

robot.html
technicalspecs3.html
conversations.html
faqs.html

March 21, 2003

Sorry that I haven’t written lately.
I fixed lots of crap, and we have a show coming up in San Jose in
a week and a half.
I need to make a note about a discovery I made.
The statement "what is your name", answered in a meme 11 is captured
by an inference that says "if i ask what is something ..." in
meme 13.
I hate scalars.  They are really horrible approximations to the
goodness (or otherwise) of CCs.

March 24, 2003

I currently set inference_triggered when it becomes
apparent that hash tags have found something interesting--something
that would fire an inference.
Routine verify_hash_tags2 returns "MATCH" when there is
a candidate.
How about, if instead of "MATCH", the routine returned a scalar
that gave some information about how distant the match was from
the concepts that took part in the hash.
In other words, the value returned by verify_hash_tags2
could tell how far up the parent chain we had to go to find
a hash match.
The closer to the original concepts, the better quality the match.

Hmmm, it seems that the call to ’getallparents’ is nearby.
That’s where I want to get my scalar...

I am looking at the method I use for iterating over the parents.
Basically, I create an iteration space that simulates
iteration over the space of an n-dimensional array.
The method of iterating is traditional: vary the value
of one pointer until it reaches a termination value, decrement
the next pointer along the way, reset the first value and restart
the iteration.

The problem with using this method in cases where there the
indices represent parents of the concepts within CCs being
hashed is that it takes no account of the notion that the
deep the concept, the more abstract, the better the hash match.
Take the lineages here, for example:

mario <- man <- human <- animal <- thing

to-see <- to-sense <- action

princess <- woman <- human <- animal <- thing

I really want to look for inference candidates that start with the most abstract parents. In other words, I want to raise my sights slowly, over all of the concepts when I search for an inference to fire. This will make the more abstract inferences tastier than the less abstract.

Using the current iteraction technique, these are the tuples considered:

mario, to-see, princess
mario, to-see, woman
mario, to-see, human
mario, to-see, animal
mario, to-see, thing
mario, to-sense, princess
mario, to-sense, woman
mario, to-sense, human...

Better that it should go:

mario, to-see, princess
mario, to-see, woman
man, to-see, woman
man, to-sense, woman
man, to-sense, animal

and so on...

I have an algorithm:

1) Take the lineage of all hash concepts (call getallparents).

2) Count the depth of each, and record as initial values i1, i2, i3...,
   Set counters e1, e2, e3 to corresponding ’i’ values.  Set p1, p2, p3
   to hashchain pointers.

3) On each iteration

4)  Process hash pointed to by p1, p2, p3...

5)  step through e-counters and identify the e-counter with the
     lowest value.

6)  Decrement all others.

7)  If all have reached "1", then stop.

8)  If any have gone to zero, restore original value.

9)  Locate (again) the counter with the lowest value.  Advance
     ’p’ pointer

March 25, 2003

Hmmm....
That was something of a bust.
How about if I take the depth of tuples, add the components,
sort them, and then process them in order.
E. g.:
given,

mario <- man <- human <- animal <- thing

to-see <- to-sense <- action

princess <- woman <- human <- animal <- thing

mario, to-see, princess     =  1 + 1 + 1   = 3
mario, to-see, woman        =  1 + 1 + 2   = 4
mario, to-see, human        =  1 + 1 + 3   = 5
mario, to-see, animal       =  1 + 1 + 4   = 6
mario, to-see, thing        =  1 + 1 + 5   = 7
mario, to-sense, princess   =  1 + 2 + 1   = 4
mario, to-sense, woman      =  1 + 2 + 2   = 5
mario, to-sense, human...   =  1 + 2 + 3   = 6

I need to limit the depth so that the search space isn’t too huge. I need to limit it anyway, so the computational burden isn’t too huge...

 P1  P2   P3   ...  PMAXPOS2

x

x

x                  MAX DEPTH.

I will create the space, and corresponding depth calculations, when I get the parents.

March 26, 2003

For kicks, I have been looking into more intelligent ways to look through the hash space non-exhaustively to see what interesting things might be lurking in there. The current method, decsribed several sections above, involves creating an iteration space from the lineage of each of the hash CCs and then checking each combination of parents for a hash match. It’s a lop-sided method at best, and doesn’t account for the notion that things near the bottoms of the parent chains are deliberately more specific than things near the top. Looking through the parent iteration space in a way that deals with lower-level concepts first, in a quasi-uniform fashion, will facilitate making *more specific inferences have precedence over less specific inferences*.

The iteration space can become huge--unmanageable, in fact--with just a few extra concepts. If the number of hash variables is N and the average depth of the parent chains is M, then the number of possible inferences I need to check goes to (need to look in my combinatorics books)... huge, anyway.

So here’s another approach. Take the parent chains (N of them) and sample the lowest concepts on the chain to see if there is an inference hash match.

Then, remove 1 lowest element from one of the chains and try again. The chain will be chosen at random. The process will be repeated a number of times sufficient to *probably* test each possible combination.

 A   M   X
 B   N   Y     First time, test {D,N,Z}
 C       Z
 D

A   M   X
 B   N   Y     Second time, test {C,N,Z}, (or {D,M,Z}, or {D,N,Y})
 C       Z

Then randomly remove two balls, some number of times (Chris is working on a formula for me), from the bottoms of randomly selected chains.

The mental image that comes to me is a piece of metal being dipped end-in into a corrosive bath. I want to wear away parts of the bottom--these being concepts on a parent chain.

April 3, 2003

I am on a flight returning from SpeechTek/AVIOS in San Jose. Dan, Rich, Chris and I all went. We had some good discussion with folks stopping by the booth, plus one scheduled meeting in Palo Alto. The downside was, as ever, that we received a lot of encouraging feedback, but from it were again unable to set a particular course. We chose one for ourselves. I’ll mention that in a moment.

Among the good stop-bys were a fellow from Convergys, a fellow from ‘Motorola, a very interested party from the Philips dictation engine group. Kevin Lento of Cepstral had a project we could look into with him. We also saw Lin Chase and re-kindled the notion of doing SMS/phone sex. A Joe Brown, former CEO of (name escapes me at the moment) stopped by and declared his intention to come see us in Hartford over the next month.

Dan’s and my visit to Palo Alto was with Steve Victorino, the CEO of ’There’ and an active party in a few other ventures. He was juiced about the customer service angle of Brainhat. It also appealed to him that Brainhat could server the role of helper and host within the ’There’ worlds. Next activity may include a trip so see one of his VPs located somewhere in Connecticut.

(Plus, Steve Chambers (SpeechWorks), guy from Mindmaker).

Anyway, I woke up the morning of the second day of the show and said to myself: "there’s some much conflicting direction and possibility, and we are running out of time.... we should now do the phone sex thing in earnest and see what follows." The developments of the last year are going to make it more possible: we have meme shifting and the ability to interpret what we hear, rather than take it all literally. A good implementation of the Brainhat side should get some press, derision and funds...

I am also grieving over what to do with Chris. He is capable, but is a constant mixture of immaturity, hubris and unpolished work. He takes advantage of the loose environment in the office and has by no means made himself indispensible. I’m of half a mind to let him go, but Dan seems to think he’s just "young."

The half-done stuff that needs completion are: the windows version of the code runs slow (because...), the SAPI client still misses stuff and produces turds (I am going to take this code back). I don’t know if the VoiceXML code works anymore following Chris’ changes (really need this!) I don’t know if the Web code works anymore following Chris’ changes for the windows version. I don’t know if the robot code works anymore following his changes. The Winamp client works well enough; there are issues but I don’t see any reason to continue with it in earnest.

Rich seems to be stalled. He was playing with the LBS stuff, and there may be utility in continuing. He has stopped working on the user interface. I think that the database and his abstractions for interfacing to the GUI seem good enough. The GUI itself is not very easy to use. I think it needs to be rebuilt on top of Rich’s hooks by another person--one who appreciates the usability problems with it; Rich is a little defensive about how it works.

As for the phone sex thing... this could be great fun, and may drag Rich back into the database business. We may even have him developing the memes.

April 8, 2003

Need to complete the algorthim for evenly, in a bottom-up fashion, running inferences. Need also to *not* test those concept parents that don’t appear in any of the inference templates. That should speed things up considerably; why test a parent if it isn’t in an inference template? Anyway, to do that I need a list of concepts that make up inference hashes on a per-meme basis.

April 16, 2003

I am working on an agent to go between Brainhat and an SMTP agent. I had thought about making Brainhat do it’s own SMTP reception, though that might be overkill. Then I thought that I might use smtp forwarding--headers and all. This would mean I’d have some functionality within Brainhat that would involve parsing mail headers. Again, probably overkill. Then I thought I might just place an agent between the MTA and a daemon.

      (MTA)  < ---------->  filter  <-------- > brainhat daemon

We will need to have some statefulness in the database. Rich is thinking about that. I will need to create some kind of indicator (an X- header) to tell me whether incoming mail is part of an ongoing conversation or the start of a new conversation.

From: fred@whatever.com
X-bhat: X
<more headers....>

I like ice cream.

<possible previous banter, signature>

If the X-bhat header is present, then this is an ongoing conversation. I will connect to the daemon, issue some kind of debug command to resurrect the state of the conversation, and then say the next thing. If not, then I will start the conversation afresh. Either way, I will record the results, go back into debug and save the state. The results will be returned to the user.

April 16, 2003

Hmmmm.... added REQUIRE tag back into list inside of autohash_a. Not sure why it would be missing...

May 13, 2003

I found a ’keep_clink(p)’ call inside of create_link(). I commented it out... just in case something explodes.

(later) Put it back.

May 15, 2003

Well, we decided to stop persuing Brainhat commercially. There’s lots to do, and Rich and I have some good ideas. But.... they’re going to have to be for the evenings.

July 3, 2003

Still here...

Hints, a new table in the database containing things we *might* hear, bestfit. We are trying to make a demo. Memory management matters still too. I think I want to do reference counts for all primitive objects.

July 14, 2003

Yep, still here. We’re running after a potential opportunity suggested by David Thompson of Fonix. The idea is that we might be able to make a play with cell phone companies to drive up minutes by giving teenage girls something to chit-chat with.

I have been grieving over how to do dialog management, and have even thought about front-ending with an AIML engine. Time is of the essence, though. I am going to craft an mplex to talk about boyfriends and mothers and creepy little brothers. The new components are going to be:

Manual meme shifting.

Use of rich’s hints table to generate grammars/hints for a speech engine.

Use of rich’s hints table to filter idiomatic or varied input.

Use of rich’s hints table to filter output (perhaps).

July 16, 2003

I created an input filter with grammar rules much like Brainhat’s existing input grammar. Excerpt:

define

xlate1

label

translation

rule

i see the $c‘things‘1

xlate

mario sees the %s

I’m going to try an extend it so that I can handle CCs in place of single words, and likewise be able to invoke subrules in translation patterns, ala:

define    xlate2

label

translation

rule

i see the $r‘csubobj‘1

xlate

mario sees the %s

Not sure how to do it yet...

July 18, 2003

This worked out as per the following example. The linktypes (ATTRIBUTE, VERB, etc) tell what kinds of speak routines should be used to voice the matching components. See idiom() for more details.

/* how old are you?
*/

define

xlate1

label

translation

rule

how old $c‘tobe‘1! $r‘csubobj‘2

xlate

where ^1 ^2 at

map

ROOT,VERB,SUBJECT

Now I have been grieving over setting microstate variables so that I can activate translations for one cycle. For instance, I might want to say "what is your name?" and then be ready to accept a name in a translation, ala:

/* how old are you?
*/

define

xlatex

label

translation

rule

$e‘expectname‘2$W‘#‘1

xlate

my name is ^1

map

ROOT,ATTRIBUTE,IGNORE

Here, the test of the string "expectname" as a state variable tells whether the rule can succeed at all. If the variable isn’t set, the rule fails.

Within the programming, an inference could say: "if .... ask speaker what is speaker’s name and set expectname." In the next processing cycle, "expectname" would be revoked as a state variable.

BUG FIX: I need to look at all rules to see if parequires is necessary. I found a place where it was needed: question-where-1.

July 19, 2003

>> name
 if You are glad then You want to know your’s name.
>> break

Break in debug at the start:
debug> break tests
debug> cont

>> i am happy
replacing happy-1 with happy-a57f
replacing happy-1 with happy-a57f
replacing tobe with tobe-a580
replacing speaker-1 with speaker-a581
replacing speaker-1 with speaker-a581
replacing speaker-1 with speaker-a581
replacing happy-a57f with happy-a57f
replacing happy-a57f with happy-a57f
replacing happy-a57f with happy-a57f
replacing happy-a57f with happy-a57f
askcc: are You glad?
evalprop: yes (1)
tellcc: You wants to know your’s name.
 You are glad. You want to know.

There’s a problem with expression of ’my’ and ’your’.

Found that use checking NOQA was eliminating pronoun dereference in lowpronouns by causing the routine to exit immediately. This is probably okay for "his" and "her", but may not be right for "my" and "your." I disabled the NOQA check to verify that the results would be what I hoped. I need to go back into lowpronouns and partition the processing.

July 21, 2003

I can change commitadj and the contents of the
input pattern tell-all-csubobj to make it possible
to commit things as answers to questions like
"what are you?" or "what is your name?"
The trick will be to recognize that there is a saved question
of the form:

           Root
             o
           / |          /   |        OBJ     |   VERB
      /    SUBJ          o       |       o tobe
  things     |
             o name

Then I can (ala commitadj) utter something along the lines of "my name is fred."

July 21, 2003

Possession needs to be orthogonal:

[dowd@maddie jennifer]$ ../brainhat -u kdowd/kevin@127.1 -i ./init +verbatim
Database Enabled: brainhat@127.1

Mplex Brainhat Core
   Meme.1: Brainhat Core   ID:  1  Location: localhost

Mplex jennifer
   Meme.1: boyfriend      ID: 14  Location: localhost
   Meme.1: yourboyfriend   ID: 15  Location: localhost

Memelist-Extra: ()
Meme Set Focus: Brainhat Core

Brainhat, Copyright (C) 2002, Brainhat LLC, Version 2.030703.

>> hi
 hello. i’m like ohmigod... hello. what is your name?
>> my name is becky
 your name is becky. are You a boy?
>> no
 You are not a boy. You are a girl. You might have my boyfriend. do You have my
boyfriend?
>> no
 You do not have my boyfriend.

Related issue:
I might have a boyrfriend --> I do have a boyfriend.
When I test to see if I might have a boyfriend, I should be
testing to see that I *do*.

I need to make it so that a given inference fires for a given
set of hash tags just one time.

                                                 October 16, 2003

Re: Meetings in New York yesterday

The first meeting yesterday with Russ Bartels.  Russ has came to visit
us early last Spring, and took us into Lincoln Financial Group to talk
about self-help capability rendered by machine.  The discussion didn’t
proceed because, at the time, Lincoln hadn’t ever considered replacing
service agents in that fashion; the concept was new to them.

Russ hasn’t abandoned the idea.  He believes that the market is huge,
and coming.  His personal research has led him to conclude that bots
are the easiest vehicle for creating virtual assistants.

I told him that I was coming around to believe the same thing, but
that there is real value added by applying knowledge, goals and
inferencing on top of the bots.  I argued that this could mean the
difference between an engine that likes chit-chat, and one that wants
to get something accomplished.  If bots are simple to create, readily
available and everywhere, then being the intelligent component that
rides on top of bots has enterprise potential.

I suggested that Russ could book meetings to try and pitch this idea,
and that I would be his tech-weenie and we could see if we could
close someone.

My second meeting was with Richard Wallace, later joined by the
pandorabots folks.  This discussion was very fruitful.  They listened
eagerly to my notion of adding intelligence to the bots.  Richard
reinforced the idea; he talked about seeing something similar
presented by Sprint’s R&D group where an agent that failed to find a
response for a question pitched it over to Alice for chit-chat.

The pandorbots folks are willing to "unwind" the program in any way we
need them to for hooks into Brainhat.  They’re also interested in
having our SAPI speech interface client for their community.  They
suggested that we could make a deal with paypal and collect revenues
for it.

Richard and the pandorabots people are seeing increased interest of
late, but like us, they haven’t made any money.  I look at the
components (including oddcast), the desire and the technologies and
see the chance to cobble together an offering with a good commercial
feel.

I will work with pandorabots to get them increase functionality, and
perhaps revenue.  That will bring us exposure to the bot community and
increase our commercial potential.

-Kevin

October 18, 2003

"Do you know if mario is happy?"
"Do you know mario’s mood?"
"Do you know mario’s address?"
"Do you know the speaker’s name?"
"Do you know who is the speaker?"
"Do you know who the speaker is?"
"Do you know what color the ball is?"
"Do you know what color is the ball?"
"Do you know how many people are coming?"
"Do you know where the party is?"
"Do you know if mario sees the ball?"
"Do you know who mario is with?"

"You want to know if mario is happy."
"You want to know mario’s mood."
"You want to know mario’s address."
"You want to know the speaker’s name."
"You want to know who is the speaker."
"You want to know who the speaker is."
"You want to know what color the ball is."
"You want to know what color is the ball."
"You want to know how many people are coming."
"You want to know where the party is."
"You want to know if mario sees the ball."
"You want to know who mario is with."

"If you know if mario is happy..."
"If you know mario’s mood..."
"If you