Beebug
1st January 1990
Author: Alan Wrigley
Publisher: Pineapple Software
Machine: BBC Master 128
Published in Beebug Volume 8 Number 8
Alan Wrigley reviews a new package from Pineapple Software.
BESS: An Expert System for the BBC
Product: BESS
Supplier: Pineapple Software, 39 Brownlee Gardens, Seven Kings, Ilford IG3 9NL.
Tel: 01-599 1476
Price: £28.75 (inc. VAT)
If the article elsewhere in this issue on dichotomous keys has whetted your appetite for exploring the implementation of expert systems, the BBC micro Expert System Shell (BESS) may be of interest to you.
An expert system is a piece of software which essentially makes expert knowledge accessible to non-experts. Such a system will contain a knowledge base, compiled by an expert in the field, and an interface which enables others to diagnose, forecast or identify some key fact by answering a set of questions. For example, it would be possible, though not necessarily desirable, for a layman to diagnose an illness by using an expert system containing data compiled by a doctor.
The term 'shell' which is applied to BESS signifies that the software contains only the interface and the capability to solve problems, but the knowledge must be provided by the user. Unlike the simple binary tree structure of a dichotomous key, BESS provides a framework for multiple choice questions, based on the information which is put in when the knowledge base is set up. It is possible, therefore, to build quite complex systems with such software, although in practice the memory limitations of the BBC will restrict the size of the database.
The package consists of a master disc (40 track DFS one side, 80 track DFS the other) and a 27-page A5 photocopied manual. The software allows you to create a work disc, but the master disc must always be inserted in order to start BESS. The disc contains a sample knowledge base for you to experiment with, which will identify common British mammals.
The Editor
There are three main parts to BESS - the Editor, the Compiler and the Inference Engine. The editor is basically a simple word processor which is used to create a text file containing the data which makes up the knowledge base. A text file consists of a series of statements of the form:
IF [condition] THEN [fact]
built around the six keywords understood by BESS (IF, THEN, NOT, AND, OR, GOAL). For example:
IF SKY BLUE
THEN FORECAST SUNNY
IF BITS 8
AND NOT PROCESSOR 6512
THEN GOAL COMPUTER "MODEL B"
As you can see, each fact or condition must contain a variable (e.g. SKY) and a value which is assigned to it (e.g. BLUE). Prefixing a fact with the keyword GOAL tells the computer that this is to be a "goal variable", i.e. one which it is ultimately the purpose of the knowledge base to identify, such as ILLNESS in the hypothetical example quoted above, or ANIMAL in the sample database supplied. It is quite possible to have several goal variables in one knowledge base.
Clearly the most difficult task in setting up a knowledge base is compiling the data itself. This is no simple matter, since however expert your knowledge of a subject, translating it into a set of fool-proof rules suitable for an expert system takes a great deal of time and patience. Ruling out all possible incorrect identifications is just as important as making the correct ones.
For example, using the sample database supplied with the software, I discovered that a hedgehog is long and thin, with a bushy tail, and lives in trees, while a pig is 5 feet tall and has webbed feet!
The editor contained within BESS seemed rather quirky, and frankly I did not find it of much use. Whatever commands I used, the text simply scrolled straight to the end, which made it impossible to edit text of more than one screen in length. Eventually the editor stopped working altogether and the screen went haywire every time I tried to input text. Fortunately, text files can be imported from any word processor provided that the file is in ASCII format, so I quickly switched to using View to write my knowledge base.
The Compiler
Having written the text file, the next stage is to select the compiler from the BESS main menu. This takes the text file and converts the information into a form suitable for the inference engine to work on. At this stage any errors in the text are reported, for example if there is no value following a variable, or if a keyword is missing where it should have been expected. Unfortunately, when I tried it out, the compiler rejected a number of my text statements for reasons which did not seem very clear, even though, as far as I could see, they complied with the rules. When all the errors have been reported, the program returns you to the editor to amend the text, but because of the deficiencies in the editor already mentioned, I had to switch from BESS to View and back again each time. I found this extremely annoying, and eventually I gave up and removed the offending rules from the text in order to complete the compilation process.
The Inference Engine
Once the database has been compiled you can run the inference engine. The goal variables are presented as a menu and you must choose one to identify. The software will now try to complete the identification, working out which questions to ask as it goes along. For example, you may be asked "What is SKY?" and asked to choose from a list of all the values which have been assigned to SKY in the database, or to select "none of these" or "don't know". A further useful option at this stage is to ask the computer to give the reason why it has asked this question, whereupon it will display the rule which is being processed. The computer can be interrogated further to say why the rule needs to be solved, or how a previous fact in the rule has been solved. This is useful for locating logic errors in the knowledge base, or just to investigate the reasoning process.
Eventually the correct answer will be identified, assuming of course that the right information has been supplied in the first place.
Printer Output
An option on the main menu allows you to output the contents of a knowledge base to a printer. Alternatively, you can load the text file into a word processor and add headings etc. before printing. The printer can also be used when compiling, to list the errors which are reported, or to print out a list of the variables and their possible contents.
Documentation
The manual supplied with BESS is fairly short and simply produced, but clearly written, and it covers all the aspects of using the software in a logical fashion. However, I found it unable to explain why my own attempts at compiling a knowledge base generated so many errors, as described above.
Conclusion
The implementation of an expert system on the BBC micro is an interesting idea, and a package of this kind could be extremely useful in the educational field, both for making specialised knowledge available to a wider audience, and for teaching the concept of expert systems. The creation of a knowledge base could form the basis of an interesting class project, for instance. Although BESS is perfectly adequate for this purpose (with some serious reservations about the editor), I felt that, as a whole, the software lacked that professional feel. Apart from the problems I described earlier, the screen displays and the sample database are peppered with spelling mistakes and dubious usage of the English language - one particular example which made me cringe was the phrase "not exists" which appears at the top of the screen when a file has not been created.
In conclusion, then, while accepting that BESS is an interesting concept that could be quite useful in schools and other situations where a straightforward expert system is required, such as counselling services, I would have expected to see a more professional look from a piece of software at this price.
Scores
BBC Master 128 VersionOverall | 66% |