ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º º º EXPERT SYSTEMS º º º º "Give your PC some human intelligence" º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ An Expert System is computer software that can solve real world problems requiring logic, decision making and knowledge processing. Expert Systems can also categorize, consult, analyze, and diagnose. These software tools are useful in areas that formerly required a human expert. Expert Systems use deductive reasoning to solve problems that are often unstructured, and would be impossible to approach with conventional procedural computer techniques. An Expert System Shell is an Expert System minus its knowledgebase and domain. It is an Expert System ready to be taught the rules of knowledge in a particular field. An Expert System Toolkit is something more: a shell plus an organized set of software tools to assist in developing it into a full expert system. Usually, this includes an editor for building the IF-THEN rules that make up the rulebase, a trace facility for testing the way the rules interact, hooks to pre-existing databases and spreadsheets, and a sophisticated user interface that hopefully hides all these tools from the user during the run-time consultation. Shareware is user supported software. It is usually distributed free through Bulletin Boards, but can also be purchased for a disk-copying fee. Shareware authors hope that you will like and use their software enough to remit the requested registration fee. (Usually $25 to $75). In return, you become a registered user, entitled to updates and sometimes a printed manual. There are currently about a dozen Shareware Expert Sytem Shells on the Boards. I've downloaded and un-archived them all, and selected six of the best. I'm going to give you some information and opinion on each of these Shareware Shells: ESIE, Turbo Expert Toolkit, ImpShell, XXXPERT, Inference, and Rulemaker. Each shell was tested with the simple rulebase in Figure 1, which will advise you as to whether or not your PC will run the new OS/2 operating sytem recently released by IBM for its line of PS/2 Personal Computers. The minimum requirements for running OS/2 are a 286 or 386 CPU and 1.5 Meg of Memory (2 Meg for OS/2 with the DOS Compatability Box). The rulebase was first developed and tested in Level5, a popular commercial expert system shell, and then modified in syntax as required. I'll comment on just how difficult it was to adapt the rulebase to each shell, the ease of running the consultation thru the provided user interface, and finally if each inference engine generated the correct conclusion. ============================================================================= TITLE Will Your PC Run OS/2 1. Your PC will run OS/2 2. Your PC should run OS/2 with more memory 3. Your PC will never run OS/2 RULE for Will Run OS/2 IF Your CPU is a 386 AND Your PC has 2 Meg of Memory THEN Your PC will run OS/2 RULE for Should Run with Modification IF Your CPU is a 286 AND Your PC has under 1.5 Meg of Memory THEN Your PC should run OS/2 with more memory RULE for Will Never Run IF Your CPU is a 8086 or 8088 AND Your PC has under 1 Meg of Memory THEN Your PC will never run OS/2 Figure 1. Original OS/2 rulebase in LEVEL/5 syntax ============================================================================ 1. ESIE (Lightwave Consultants, PO Box 290539, Tampa, FL 33617 $75) ESIE is the acronym for Expert System Inference Engine, and that is exactly what it is. ESIE loads in a knowledge base, and builds inferences out of the IF-THEN rules, to act like an Advisor. It is an Artificial Intelligence expert system shell. An infinite multitude of knowledge bases can be used by ESIE. The normal gamut of expert systems (ES) can be built for and used by ESIE. Tools such as system configurators, medical experts, oil and gas exploration, etc, can all be done in ESIE. ESIE is a rule-based backward chaining inference engine. The acronym was also selected because ESIE is easy to use. You just type ESIE at the prompt, and a one-screen shareware ad appears. You then type the name of the rulebase to load: DOCTOR, ANIMAL, or GLASS. ESIE then begins to ask you questions from the rulebase. You can only respond YES or NO. The consultation will either lead to a conclusion or the statement "UNKNOWN". Options are TRACE ON, TRACE OFF, GO, or EXIT. When you EXIT, Esie always says "Have a nice day". This is an excellent shell with excellent documentation. The full page shareware notice on the first screen is a problem for business use, as is the "Have a nice day". The main problem is the lack of confidence factors. You can only answer 100% YES or 100% NO. For ESIE, my OS2 rule base had to be restated (Figure 2). ============================================================================ goal is type.computer legalanswers are yes no * if cpu is no then type.cpu is old if cpu is yes then type.cpu is new question cpu is "Does your PC have a 286 or 386 CPU chip?" if type.cpu is old then type.computer is "your PC will never run OS/2!" if type.cpu is new and memory is yes then type.computer is "your PC will run OS/2 perfectly!" if type.cpu is new and memory is no then type.computer is "your PC should run OS/2 with more memory" question MEMORY is "Does your PC have 2 meg or more memory?" answer is "In my expert opinion " type.computer Figure 2. Rulebase as modified for ESIE ========================================================================= Once this was accomplished, ESIE did a perfect job of running the consultation, and could respond with the three possible answers appropriately. When I turned TRACE ON, ESIE said that the rule base had 12 rules(!), three legal questions, and two legal answers(!). I've been informed that this has been corrected in the latest release of this excellent product. 2. TURBO EXPERT TOOLKIT (Thinking Software, 46-16 65th Place, Woodside, N.Y. 11377 $59.95) The Turbo Expert System Toolkit is based on confidence factors (10 means yes, 0 means no, 5 means maybe, 9 means almost definitely, etc.) In addition, with this Toolkit you are relieved of the difficult assignment of creating an IF-THEN rulebase in a separate ASCII text editor. The Turbo Expert Toolkit presents the absolutely most direct menu driven approach to generating your own rule-based backward chaining expert system. When it is complete, your expert system will ask you (or the user of your system) a series of questions (QUERIES) to be answered on a scale of 0(No) to 10(Yes). At the conclusion of the consultation the Expert will draw a graph of the User's responses, and finally display the correct solution (GOAL). Turbo Expert never says UNKNOWN. Large scale expert systems with hundreds of queries and goals can be built, since the Knowledgebase is stored on its own separate disk. In addition, you can build many expert systems: just use a separate disk to store the Knowledgebase for each. Turbo Expert comes with extensive documentation, an online tutorial and demo, plus a Quick Reference Chart to help you put up your first Expert System in under one hour. The registered version also includes two complete Expert Systems ready to consult (The Psychology Expert & The Stock Market Expert). Turbo Expert leads you step by step through the process of creating a rulebase. First I pressed 'A' on the Main Menu, and was prompted to enter TITLE, AUTHOR and DESCRIPTION of my rulebase. Then I pressed 1 and entered these three queries: 1. Does your PC have an 8088 CPU and 640K of memory? 2. Does your PC have a 286 or 386 CPU and less than 2 Meg of memory? 3. Does your PC have a 286 or 386 CPU and 2 Meg or more of memory? Next, I pressed 5 on the Main Menu and entered these three goals, with numeric links to the appropriate queries. 1. Your PC is most similiar to the original IBM/PC and will not run OS/2. (link with 99 to query 1) 2. Your PC will run OS/2 if you install a total of two Megs of memory. (link with 99 to query 2) 3. Your PC was designed to run OS/2! (link with 99 to query 3). Building the Turbo Expert Rulebase took all of 10 minutes, and the resulting consultation was the only one with a completely natural use of english language for the entire process. In addition, Turbo Expert is the only one of the Shareware Shells which comes with an independent run-time module to insulate the user from the development process and protect the completed expert system. 3. IMPSHELL (Daniel H. Marcellus, Middletown Programming Works, Middletown, New York. Public Domain) The IMP Shell is a powerful expert system development environment for the IBM-PC. It contains all the utilities needed to develop and test new expert systems, and run them when they are finalized. All functions are menu driven and appear in windows. IMP expert systems are rule based, backwards chaining systems. They are very fast and not limited by an artificially small number of rules. The IMP Shell is in the public domain and is used in many educational settings. It was developed by Daniel H. Marcellus of the Middletown Programming Works, Middletown, New York. It is completely described in the book "Expert Systems Programming in Turbo Prolog" which is written by Mr. Marcellus, and published by Prentice-Hall, Englewood Cliffs, N.J. (1987). An expert system is a program which has captured the expertise of an expert in some field and can deploy that expertise with seemingly intelligent behavior. For instance there are expert systems to do all these things: Diagnose medical problems Guide the repair of complex equipment Give advice about taxes and investments Guide chemists in synthesizing desired chemicals Interpret telemetry data from satellites Control nuclear reactors and electric utility grids A shell makes it easy to set up an expert system by concentrating on the problem at hand rather than on the details of a particular machine reasoning system or artificial intelligence language. This shell was written entirely in TURBO PROLOG, and the source code is provided, although you don't need to understand anything about TURBO PROLOG in order to set up an expert system with this software. The IMP Shell is menu driven, and the menu allows you to select all the activities that are necessary at various stages of the development of an expert system, for example: 1. HELP information 2. MAKE rules for a new expert system 3. INSPECT the rule set that is loaded 4. SAVE the rule set that is loaded 5. LOAD an existing rule set 6. RUN the presently loaded rule set 7. EDIT an existing rule set 8. PRINT an existing rule set 9. DOS access 10. END this program The IMP Shell uses backward reasoning. This means that it has the proper architecture for creating good expert systems for classification tasks, for troubleshooting, and, in general, for anything that involves choosing among alternatives. It is not the proper architecture for applications that require a well defined sequence of steps with complex reasoning going into the application of each step. Applications such as configuring complex equipment or estimating costs of a project are of this sort. They should be implemented with a forward chaining shell. I found Impshell more complex than the other Shells presented here. The rulebase was difficult to create, and the consultation insisted on displaying all the possible conclusions. The correct conclusion had a probability of 1, while the other two were presented in exactly the same way but with a probability of 0. Most users would find this confusing. ============================================================================ imp("s","n","Your PC was designed to run OS/2","pos", "the CPU is a 286/386 and the Memory is 2 meg","dummy","dummy",1) imp("s","n","Your PC can run OS/2 after a memory upgrade", "pos","the CPU is a 286/386 and memory is under 1.5 meg","dummy","dummy",1) imp("s","n","Your PC will never run OS/2","pos", "the CPU is 8088 and memory is 640k","dummy","dummy",1) terminal_node("the CPU is a 286/386 and the Memory is 2 meg") terminal_node("the CPU is a 286/386 and memory is under 1.5 meg") terminal_node("the CPU is 8088 and memory is 640k") hypothesis_node("Your PC will never run OS/2") hypothesis_node("Your PC will run OS/2 after a memory upgrade") hypothesis_node("Your PC was designed to run OS/2") Figure 3. Prolog rule set required for IMPSHELL was more complex then others. ============================================================================= 4. XXXPERT (Stephen Thurber, 1926 Labrador Lane, Vienna, VA 22180 $50) XXXPERT is an expert system development facility which includes an editor, file manager and expert systems inference engine packaged together in one integrated environment. You can use XXXPERT to develop expert systems that use rules you write in an English language syntax. You can develop expert systems that will aid you and others in doing things that you would not be able to do consistently as well without XXXPERT. XXXPERT allows you to define expert knowledge just once then apply it repeatedly time after time. XXXPERT is a rule-driven system. Rules are simply statements of logic that you wish to have applied to the area of expertise your rules are to address. These statements are written in English and abbreviations. The first rule statement in a rules file must be on a line by itself (and on the first line of the file). This statement must specify the name of the goal for the consultations to be performed with the set of accompanying rules. XXXPERT will need certain information from the user in the course of any given consultation session depending on the rules being used in that session. The "asks" define how XXXPERT should ask the user (consultee) for such information. In general you should code an ask for each identifier that appears in the left-hand-side of a rule (before the THEN) unless it also appears in the right-hand- side of another rule. XXXPERT may take a little longer to develop an Expert System, as you must develop the rulebase first and then the Questions to ask the user, but it is a very complete and professional product. The big problem is the difficulty of making your consultation use ordinary English Language. Figure 4 and 5 shows how I had to abbreviate the rulebase and related ASKS for XXXPERT. The consultation had an unnatural/inhuman quality, especially the statement of the conclusion. ===================================================================== RUN.OS2 IF CPU EQ NO THEN RUN.OS2 EQ NEVER IF CPU EQ YES THEN CHECKMEM IF CHECKMEM EQ YES THEN RUN.OS2 EQ YES IF CHECKMEM EQ NO THEN RUN.OS2 EQ WITH.MORE.MEMORY Figure 4. The uncomfortably abbreviated rulebase required. ===================================================================== CPU Does your PC have a 286 or 386 CPU chip? CHECKMEM Does your PC have 2 meg or more memory? Figure 5. The related ASKS could use normal English Language. ==================================================================== 5. INFERENCE (George Hageman, PO BOX 11234, Boulder Colorado 80302 PD) This inference engine is backwards-chaining only and features the running of binary files if: 1) they are antecedents associated with a particuar consequent being proved, or 2) they are consequents which have been proven true by verify(). their actual predicate value will be determined by their returned result after running. This inference engine is designed with diagnostics in mind and so will probably be best suited for this application. Later revisons will include forward-chaining so that the user will have the opportunity to give pre-existant conditons, or that these may be supplied by the calling process. See structure design for details of operation, but basically the inference reads in all of the compiled information as produced by the rule compiler. It proceeds to attempt to prove each consequent by proving the truth or falseness of any antecedent associated with this consequent. if any antecedent of a consequent turns out to be a consequent itself, then the inference engine will recursively attempt to prove this consequent. The process is complete when all of the predicate values of the consequents has been determined. This Shell is seriously lacking in documentation, however complete C Source code is supplied. The consultation could probably be more natural (although all upper-case) with a little refinement of the rulebase. ============================================================================= ! THIS IS THE KNOWLEDGE BASE FOR THE ! OS/2 EXPERT SYSTEM FOR INFERENCE ! IF PC HAS 8088-CPU ANDIF PC HAS MEMORY OF 640K THEN PC IS OLDPC ! IFNOT PC IS OLDPC ANDIF PC HAS MEMORY LESS THAN 1.5 MEG THENHYP PC IS WILL-RUN-OS/2-WITH-MEMORY-EXPANSION ! IFNOT PC IS OLDPC ANDIF PC HAS MEMORY 2 MEG OR MORE THENHYP PC IS WILL-RUN-OS/2-PERFECTLY ! IF PC IS OLDPC THENHYP PC IS WILL-NEVER-RUN-OS/2 ! IFNOT PC IS WILL-NEVER-RUN-OS/2 IFNOT PC IS WILL-RUN-OS/2-WITH-MEMORY-EXPANSION IFNOT PC IS WILL-RUN-OS/2-PERFECTLY THENHYP THIS PC IS NOT WITHIN MY KNOWLEDGE Figure 6. Rulebase for Inference must be compiled before running ============================================================================= 6. RULEMAKER (Samuel H. Smith, no address given, Public Domain) This unique program allows you to painlessly prepare a set of rules for a decision-tree based expert system. It can be fun! You teach the expert by repeatedly "Learning" new facts. When you have your rules working properly, you can generate a stand-alone expert system in Turbo Pascal. MENU SELECTIONS: New Create a new knowledge base Read Read a knowledge base from disk Write Write the current knowledgebase to a file Display Display the rules in the current knowledgebase Program Generate a Turbo Pascal Source Program Learn Run this knowledgebase and learn new rules Quit Exit to DOS Two complete knowledgebase files are included: MECHANIC....diagnose your car LANGEXP.....Choose the appropriate computer language for your next programming project. This clever little system was a pleasure to work with. The rulebase is generated interactively in "Learn" Mode. A very nice feature is that you can always go back to your original rulebase and teach it more rules. When you are happy with it, you can generate a Turbo Pascal Source Program, ready to be compiled into a stand alone Expert System. ============================================================================== OS/2 EXPERT SYSTEM Q:Does your PC have an 8088 CPU and 640K of memory? YC:Your PC will never run OS/2 NQ:Does your PC have a 286 or 386 CPU and less than 1.5 Meg Memory? YC:Your PC will run OS/2 with a Memory Upgrade NQ:Does your PC have a 286 or 386 CPU and over 2 Meg of Memory? YC:Your PC will run OS/2 perfectly! NC:No conclusion Figure 7. This compact rulebase was generated by RULEMAKER ============================================================================= {Expert program OS2.PAS generated by Rulmaker} {$I PXG.INC} begin repeat writeln; writeln('OS/2 EXPERT SYSTEM'); writeln; if ask('Does your PC have an 8088 CPU and 640K of memory?') = true then conclude('Your PC will never run OS/2') else {Does your PC have an 8088 CPU and 640K of memory? = false} if ask('Does your PC have a 286 or 386 CPU and less than 1.5 Meg Memory?') = true then conclude('Your PC will run OS/2 with a Memory Upgrade') else {Does your PC have a 286 or 386 CPU and less than 1.5 Meg Memory? = false} if ask('Does your PC have a 286 or 386 CPU and over 2 Meg of Memory?') = true then conclude('Your PC will run OS/2 perfectly!') else {Does your PC have a 286 or 386 CPU and over 2 Meg of Memory? = false} conclude('No conclusion') until ask('Run again?') = false; end. Figure 8. Rulmaker also generated this Turbo Pascal Program ready to compile. ============================================================================== All these Expert System Shells, with demo rulebases and extensive Manuals-on-disk are available on many Bulletin Boards for the cost of a download or from the original authors. The original authors deserve our support, and if you like and use their system you should remit the registration fee. If you can't find the programs or don't have a modem or the time to download, from Thinking Software, Inc. 46-16 Sixty-fifth Place, Woodside, New York 11377. All six are available for $59.95 with an informative catalog with many other AI programs and a free demo disk. Ask for the "Expert System Pack". *Note: as the AITUTOR was "going to press", we received permission to include IBIS, a new and extremely powerful Expert System Shell in our Expert System Pack. IBIS is from Intelligence Manuafacturing Company, and is an Educational, yet fully functional version, of their $450 Professional Version.