Hello World

Unpacking and Running Brainhat

In this "how-to" we unpack Brainhat and introduce the command line interface.  

To start, you will need a copy of "make" installed.  In a Debian environment, which includes Mint and Ubuntu, become superuser and install "make" like so:

# apt-get install make

Move the Brainhat download, brainhat_linux.4-xxxxxx.tgz, file to a working directory and unpack with tar:

$ tar xvfg brainhat_linux-xxxxxx.tgz

A handful of files and directories will appear:

$ ls
brainhat  constant.h  data  DATE  LICENSE  README  run  simplecpp

There may be many more files and directories present as well.  To run Brainhat, execute the "run" script:

$ ./run
make: 'data' is up to date.
Initializing
>> 

The "data" file includes vocabulary and grammar for your Brainhat session. Using the "run" script will instruct "make" to ensure that the "data" file is up to date.  At the ">>" prompt, you may enter your commands. When you are done, say "bye" or "quit".  

>> say "hello world"
 "hello world".
>> bye 

Brainhat understands a variety of statement types:

  • attribute assignments (the dog is hungry)
  • propositions with non-stative verbs (i will eat a potato)
  • propositions with stative verbs (i liked the chicken)
  • equivalences (mario is the king)
  • inference templates (if i like you then you like me)
  • imperatives (tell me that you love me)

These can combine to make more complex forms, such as "I know that the dog's bowl is empty." There are limits, though. When the language gets too complicated or contains idiomatic expressions, one either has to break it up or rewrite it. Brainhat has some built-in facilities for rewriting input before and during parsing, but it is string manipulation, not knowledge manipulation, and open to unwanted results. 

If you enter a statement and the response isn't what you expect, it may be that grammar or vocabulary don't exist for the input.  Like so:

 >> i rode the paternoster
  You did ride.

The above input was not fully parsed.  This is a complete parse:

>> i love beer
 You love beer.
>> do i like beer?
 yes. You love beer.

Look at the Posted QA Results

We have lot to cover.  But now that you know how to run Brainhat on the command line, experiment with it.  The QA results posted on the home page will give you some more things to try.