Is your banana yellow?

- Posted in Uncategorized by

Done. Now, in theory, class attributes are just a special case of T1 memories.

BUG: There is a bug in test xlarge007. I ask "is your banana yellow?" The answer should be "no. banana is red."

Testing T1 memories and class attrs now. Source memory five-things includes "bananas are yellow." Let's see if it restores correctly. Hmmm... didn't work for a T3 vignette. Need to look at ponder routine remember().

Let's try for a T1. Sort of works. Needed to restore with "what color are bananas?" before "what color is my banana?" would work.

Class attributes in memories

- Posted in Uncategorized by

Hoping to have a little time this weekend for Brainhat.

Where I was: need to hash class attributes when a memory is restored. Then onto memories, though it may turn out that this is enough to cover local and remote memories. Class attributes look like propositions and attribute assignments to the existing routines. That might be good enough. . Lots of restoration routines in state.c call addtocontext routines. Mproc classdesc() recognizes a class description and hashes it into the rhash in core hash table. classdesc() is only called in one place, in input-patterns, just after addtocontext(). So, perhaps addtocontext() should call it directly.

Hmmm... that might be too simplistic. I'm just looking for a way to apply classdesc() everywhere it needs to go without actually applying it everywhere is needs to go. Maybe adding it to addcctoctxt() and addcctoctxtmotv() would cover all use cases. It might. The call to addtocontext() has to continue as it is because a class description needs to be in the context and hashable so that questions like "are bears hungry" can be answered in addition to "is a white bear hungry." And addtocontext() is already smart enough not to create dirty "bears" (plural) when it encounters "bears are hungry."

So, trying this: invoking classdesc() in addcctoctxt() and addcctoctxtmotv() following the call(s) to addtocontext(). t may require a little bit if spaghetti. The CC pattern that checks for class attributes from a route level is addtoc9.

Debugging class descriptions

- Posted in Uncategorized by

BUG: "large bear weighs 600 pounds". The last part, "600 pounds", should be an adverbial phrase. It's not. "600" is the OBJECT.

BUG: This is still not right...

>> bananas are yellow
 banana is yellow.
>> dog's banana is big
 dog's yellow banana is large.
>> cat's banana is small
 cat's banana belonging to cat is small.
>> break

Break in debug at the start:
debug> list banana
Motive: default
  (clean text) banana->banana-n1 (clean), MID 10000
  (context text) banana->banana-n1-ae57 (dirty), MID 10000
  (context text) banana->banana-n1-b140 (dirty), MID 10000
debug> cdump banana-n1-ae57
define  banana-n1-ae57 [7426] (fe104310) /2710/ dirty
        label           banana
        label           bananas
        label           banana-n1
        attribute               big-a1
        attribute               Root-05f69060
        attribute               yellow-a1
        orthogonal              fruit-n1
        child-of                fruit-n1

debug> cdump banana-n1-b140
define  banana-n1-b140 [7426] (fe852600) /2710/ dirty
        label           banana
        label           bananas
        label           banana-n1
        attribute               small-a1
        attribute               Root-05f691e3
        orthogonal              fruit-n1
        child-of                fruit-n1

The first banana created with "bananas are yellow" should be plural and non-writeable, no? It could then be cloned and updated with orthogonal attributes. It should only be updated natively with other plural attributes, like "curved". All bananas are curved and yellow except for those that explicitly aren't. I think I need to go back and finish/fix this.

Wait... there was a new construct--a plabel. It is used for bears but not for bananas. Let me fix this and try again. Okay! That makes all the difference:

Initializing

>> bananas are yellow
 banana are yellow.
>> break list banana
Motive: default
  (clean text) banana->banana-n1 (clean), MID 10000  **<-no dirty bananas**

>> dog's banana is big
 dog's banana belonging to dog is large.
>> cat's banana is small
 cat's banana belonging to cat is small.
>> what color is dog's banana
 banana are yellow.
>> what color is cat's banana
 banana are yellow.
>> break list banana
Motive: default
  (clean text) banana->banana-n1 (clean), MID 10000
  (context text) banana->banana-n1-affe (dirty), MID 10000
  (context text) banana->banana-n1-b198 (dirty), MID 10000

>> break cdump banana-n1-affe
define  banana-n1-affe [7426] (4b51c960) /2710/ dirty
        label           banana
        label           bananas
        label           banana-n1
        attribute               big-a1
        attribute               Root-05f690af   **<-no color**
        orthogonal              fruit-n1
        child-of                fruit-n1


>> break cdump banana-n1-b198
define  banana-n1-b198 [7426] (4b9e2a40) /2710/ dirty
        label           banana
        label           bananas
        label           banana-n1
        attribute               small-a1
        attribute               Root-05f69233   **<-no color**
        orthogonal              fruit-n1
        child-of                fruit-n1


>> dog's banana is red
 dog's banana belonging to dog is red.
>> break list banana
Motive: default
  (clean text) banana->banana-n1 (clean), MID 10000
  (context text) banana->banana-n1-affe (dirty), MID 10000
  (context text) banana->banana-n1-b198 (dirty), MID 10000

>> break cdump banana-n1-affe
define  banana-n1-affe [7426] (4b51c960) /2710/ dirty
        label           banana
        label           bananas
        label           banana-n1
        attribute               red-a1
        attribute               big-a1   **<-explicit color**
        attribute               Root-05f690af
        orthogonal              fruit-n1
        child-of                fruit-n1

>> what color is dog's banana
 dog's banana belonging to dog is red.
>> what color is cat's banana
 banana are yellow.

Much better. But, there is work to do. See notes from 10/13/24. I also don't know how far I got with class descriptions as memories (T4).