Back to Home

SIE

What is it?

SIE is an inference engine written in Ruby. It is very simple, no Rete engine, nothing fancy. Just enough to do the job without driving you mad. It is based in part on a system called ESIE that was available for the PC many years ago (you can still find it out there if you look on Simtel and the like). It didn't come with any source code so I dusted off my degree (a 2ii in AI) and knocked it together.

Inference Engine is another term for Expert System, the Inference Engine is the core of the Expert System and a subject in it's own right when it comes to AI. Rather like studying the intricacies of compiler design as a subset of language design. Its rather old hat these days but then my AI degree is rather old too.

Using the original knowledge bases that came with ESIE I tested it and started to develop the support tools. This is what I was really interested in. I have some tools developed and plans for some more once I can get things sorted out (I've just moved and all that).

NEWS! The Tk based GUI is now available to run a consultation in. It runs under Windows and Linux and does all that nice GUI stuff. Not quite there but it does work and I will be adding the final features soon. Here are some screen shots under Windows, Linux and Mac OS X, isn't Tk wonderful

For example

Here is an example of the Ruby version being run. It's using the knowledge base (a set of if then rules) that does a sort of 20 questions to identify an animal.

Select a database
=================
 1. animal.txt
 2. glass.txt
 3. doctor.txt
** 1
Does your animal have a backbone?
 1. yes
 2. no
** 1
Is the animal warm blooded?
 1. yes
 2. no
** 2
Is your animal always in water?
 1. yes
 2. no
** 1
Does your animal have a boney skeleton?
 1. yes
 2. no
** 1
-- Success!  I think your animal is a fish

The software

This little zip archive contains the Ruby source for SIE and the knowledgebases. Extract the archive to where ever you want it and run it.

The SIE source code in Ruby (about 12k)

Running it?

sier is a small demo program that allows you to select 1 of the 3 demo knowledge bases and run it. The engine as such is in the SIE class and does the inference engine bit to a tee. It includes logging. It is also a bit sparse in the documentation department but both features and documentation are being worked on; trust me.

sietk is a version of sier in Tk for those of us that like a bit of point and click. Fire it up and take a guess at what that one active button might do.

The knowledge base

The knowledge base is now written in XML so you will have to get the rexml class for Ruby to get things to work.

The root is the knowledgebase element which has three elements of its own:

The goal element has just two elements of its own:

 <goal>
  <attribute>type.animal<attribute>
  <text>I think your animal is a type.animal<text>
 <goal>

The rules element is just a list of rule elements containing:

  <rule>
   <name>69<name>
   <conditions>
    <condition>
     <attribute>thintail<attribute>
     <value>yes<value>
    <condition>
    <condition>
     <attribute>species<attribute>
     <value>under400<value>
    <condition>
   <conditions>
   <actions>
    <action>
     <attribute>type.animal<attribute>
     <value>cat<value>
    <action>
   <actions>
  <rule>

The questions element is just a list of question elements containing:

  <question>
   <attribute>shell<attribute>
   <text>Does your animal have a shell?<text>
   <response>yes<response>
   <response>no<response>
  <question>

The DTD and a look at the example knowledgebases should clear things up for you. When I get round to the editing environment you wont have to deal with it at all

The future

What I am planning to do when I have the time:

In that sort of order, with no particular importance.

Back to Home