Bananas are yellow, of course
Copyright 2020, Kevin Dowd
There's a particular flavor of Brainhat memory that forms the basis for common knowledge, like the color of bananas or where you'd expect to find a refrigerator. In Brainhat parlance, these nuggets of common knowledge are called layer-1 memories--very basic stuff, generally true.
When one is crafting knowledge for Brainhat, the effort is typically one of constructing a scenario, like a day at the beach or an elevator ride. But, you never know when bananas are going to come up, and it might be nice to know something about them, like their color.
Layer-1 memories have the qualities that they are simple to invoke, will not be recalled if they conflict with the context, and can be overridden easily. Unlike other types of memories that intermingle with the context, recalled layer-1 memories are referenced but never actually installed.
Here's a layer-1 memory:
bananas are yellow.
This memory typically be contained in a file. Let's call it bananas.txt. To compile the memory, you would invoke Brainhat like so:
./brainhat -r bananas.txt -1
This will add "bananas are yellow" to the collection of memories. To access the memory, we run Brainhat in autorecall mode, with the -A flag:
dowd@test:~/brainhat$ ./brainhat -A +repeat >> what color are bananas yellow banana is yellow. >>
Some bananas are red. The notion that bananas are yellow can be overidden.
dowd@test:~/brainhat$ ./brainhat -A +repeat >> what color are bananas yellow banana is yellow. >> bananas are red red banana is red. >> what color are bananas red banana is red. >> are bananas yellow? no. banana is red. >>
If you are running Brainhat as a daemon, and if the daemon is a memory server, it will make "bananas are yellow" available to other copies of Brainhat, too.