Brainhat programming centers about a collection of definitions known as the Basic Knowledge Pool. The Basic Knowledge Pool describes the words and concepts that Brainhat knows at start-up, and details their relationships to one another. The lineage that makes a ball a toy, and makes a toy a thing, for instance, can be traced back to the basic knowledge pool.
In addition to the Basic Knowledge Pool, Brainhat also depends upon propositions to motivate inference or cause-and-effect. These are not (generally) programmed into the basic knowledge pool. Instead, Brainhat learns these through English statements, once the program has bootstrapped (see Building Brainhat Scenarios). You might tell the program "if thing1 is near thing2 then thing2 is near thing1," for instance. Note that constructs for describing propositions from within the concept definitions do exist--you may discover a few if you examine the basic knowledge definitions in the distribution. However support for these load-time propositions will disappear in the future. Please don't use them.
In addition to concept definitions, the Basic Knowledge Pool contains rules that tell Brainhat how to parse input and how to recognize ideas floating about in core. Rule definition isn't covered in this document. Fortunately, you shouldn't have to fool with parsing rules in order to create a vocabulary to match your application.
Most concept definitions can be found in a file called words, located within the data subdirectory.
Concept definitions can appear in any order. One definition ends and another begins whenever Brainhat encounters a define statement. The name given to the definition must be unique. By convention, I have been cardinally ordering different definitions of the same word, e.g. ball-1, ball-2, etc., where the first might describe a toy, the second a grand social event.
define ball-1 label ball child toy-1 wants color-1 wants size-1 typically round-1
The block above shows some of the basic elements of a concept definition. Statements subsequent to define can appear in any order. Tab characters position the columns. Most other characters count, so when defining concepts, take care to avoid trailing blanks.
define poison-ivy-1 label itchweed label toxico dendrens radicans label poison ivy child weed-1
The definition above shows three synonyms for poison-ivy-1. Behind the scenes, the program will also add a fourth synonym--a label to track copies of poison-ivy-1 as it gets used and modified.
define frenchfry-1 label french fry child potato-1 child fast-food-1
The block above defines frenchfry-1 as children of concepts potato-1 and fast-food-1. When you create a child relationship, the inverse parent relationship is automatically generated. The rightmost field lists a concept name, as specified in a a define statement (not a label) elsewhere.
Concepts cited in child references must exist. Furthermore, you must take care to assure that no concept is its own ancestor.
One of the mechanisms Brainhat uses for scoring CCs is hints provided by the programmer. If you think that color is a likely attribute to be associated with a ball, then you can tell Brainhat to score the combination well. This is the purpose of a wants tag. It lists other concepts that, in combination with the one currently being defined, will win Brainhat's favor.
Be careful here: a wants tag does not reflect the needs of the object being defined. A real-life cow might want hay, for instance, but the Brainhat definition of a cow would be more interested in the features of the cow--things like hooves or fur.
define ball-1 label ball child toy-1 wants color-1 wants size-1 typically round-1
The definition above shows the use of a wants tag. As with child tags, the rightmost field lists a concept name, not a label.
define blue-1 label blue child color-1 orthogonal color-1 define red-1 label red child color-1 orthogonal color-1 define pink-1 label pink child red-1 orthogonal color-1
Any concept can serve as the basis for the orthogonality of
others.
And a given concept can be orthogonal along many axes--color, size,
whatever.
Note too that orthogonality takes lineage into account.
You may say, for example, say that children of red-1,
such as
define fun-1 label fun child things related happy-1
A previous reference to a "happy" in the context buffer will help the above definition of "fun" score favorably. Note that related tag is different than the wants and typically tags we looked at previously: the concept nominated by a related tag does not need to appear in direct combination "fun." Rather, "fun" would have to be part of the on-going context.
Definitions for a few types of speech should follow conventions spelled out in this section. This will allow Brainhat relate specific forms back to more general forms.
Verbs should be organized so that the infinitive form is a parent to all of subordinate forms, as in this set of definitions:
define tosee-1 label to see child sense-1 define see-1 label see child tosee-1 number plural tense present person third define sees-1 label sees tense present person third number single child tosee-1 define saw-1 label saw child tosee-1 number single tense past person third
There is no requirement that any of the subordinate forms be present. However, at a minimum, it is good idea that you define the infinitive and the third-person-present forms. Notice how the forms are linked together; the subordinate froms are children of the inifinitive.
Single and plural forms of nouns may be linked such that Brainhat understands their relationship to each other
define spider-1 label spider number single child spiders-1 define spiders-1 label spiders number plural child insect-1
Above we see how spider is related to spiders; the former is the child of the latter.
prepositions
attributes