Hello World!

Unpacking and Running Brainhat

In this post, we unpack Brainhat and introduce the command line interface. Binaries are available for Debian-derived X86 Linux distributions, Risc-V Debian and Omnios on X86 machines. To start, go to the Donwload page of the web site and get a copy of the Brainhat binary. You will need a copy of "make" installed.  In a Debian environment, which includes Mint and Ubuntu, become superuser and install "make". As root:

# apt-get install make

On Omnios, execute "pkg install build-essential" as root.

Create a directory for Brainhat.

# mkdir brainhat

Chenge direct the brainhat directory you just created and move, the brainhat_linux.4-xxxxxx.tgz, file (from Downloads?) to the new directory. Unpack the image with tar:

# tar xvfz **brainhat_linux.4-**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. Late versions of Brainhat can use an LLM, like ChatGPT, to simplify complex language.

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, as Brainhat doesn't know what a paternoster is. 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.

 
Copyright © 2026, Kevin Dowd. Contact: dowd@atlantic.com.