EXSYS Expert System Development Software Technical Overview What is a Knowledge-Based Expert System Expert knowledge of how to solve a problem is often scarce and valuable. Knowledge-based expert systems are programs that capture some of that knowledge and allow its dissemination to others. A knowledge-based expert system is a program that emulates the interaction a user might have with a human expert or specialist to solve a problem. The rules used in a knowledge-based expert system contain some of the knowledge of a human specialist(s) in a particular field. The inference engine makes use of these rules to solve the problem. The end user provides interactive input by selecting one or more answers from a list or by entering data. The system will ask questions until it has reached a conclusion. The conclusion may be a single answer or a list of possible recommendations, arranged in order of likelihood. The program can explain, in English, why it is asking specific questions, how it arrived at its conclusion and why. Expert systems are often thought of as large projects to solve big problems. While they can be used that way, the most effective use of EXSYS 's expert system technology is to capture the knowledge needed to solve small, specific problems and make it accessible to people needing to make decisions via an intranet/Internet. Most of the individual decisions people make everyday only require knowledge of a specific area and this is where expert systems work best. Using Exsys tools, building knowledge-based expert systems need not be complex or difficult to build. In a very simple case, consider the path of a decision tree diagram you might draw on paper describing how to solve a problem. By making a selection at each branch point, the tree diagram can help someone make a decision. In a sense, it is a very simple expert system. This type of tree structured logic can easily be converted into a computerized system that is easy to use, faster and automated. More elaborate systems may include confidence (weighting) factors allowing several possible solutions to be selected with different degrees of certainty. A system may be highly interactive (directly asking the user questions) or embedded where all input comes from another program. The range of problems that can be handled by knowledge-based expert systems is vast. Applications can be developed with EXSYS software for any problem that involves a selection from among a definable group of choices where the decision is based on logical steps. Expert systems can help automate anything from complex regulations to aiding customers in selecting Technical Overview -1- from among a group of products, or diagnosis of problems with a piece of equipment – any area where a person or group has special expertise needed by others. Historically, one of the biggest problems in expert system development has been distribution. Expert systems are knowledge dissemination tools - they are effective solutions only if they can be accessed. Distribution of disks or CDs is cumbersome and there is usually a maintenance problem to make sure users are working with the latest version. Networks are a solution, but until fairly recently, they were usually limited to within a company. The World Wide Web solves that. Now a web site can be accessed from anywhere in the world. EXSYS 's breakthrough technology is the ability to run knowledge-based expert systems which provide answers, not just information, on an Intranet/Internet environment. Now expert knowledge can be accessed by anyone that needs it 24 hours a day. Since only the server needs to be updated, maintenance of the application becomes far easier. Systems and solutions built with EXSYS 's software can be used to their full potential for sites providing customer support, maintenance, pre-sales selection assistance, configuration or interpretation of complex regulations. The ability to deliver knowledge on the web, not just data, will become the new standard for advanced web sites. When to Use Knowledge-Based Expert Systems The first question in considering the development of an expert system is "Why build an expert system?" Expert systems are extremely useful, but they can not solve all problems. Understanding when and why to use an expert system is important. Knowledge-based expert systems are ideal to: Disseminate problem-solving knowledge, not just facts, with minimal training of end users. Most organizations have ways to disseminate data through databases and intranets. Knowledgebased expert systems provide a way to disseminate knowledge through those same intranets and the Web. Once an application is built and put on-line, the problem-solving skill it contains is available to everyone. On an intranet, staff with minimal training can immediately perform at a much higher level by using expert systems. On the web, anyone can access the systems. They can assist potential customers in selecting your products, or reduce the load on support staff. Standardize the conclusions for a given set of data. For situations where there are many people answering the same types of questions, it is highly desirable that everyone give the same, consistent answer for the same input data. Expert systems guarantee that this will happen. Technical Overview -2- Free a human expert from repetitive, routine jobs and interruptions in order to do activities an expert system cannot do. Expert systems are very powerful tools, but they do not think. Expert systems can not come to novel or innovative solutions - only people can. However, most experts spend most of their time answering routine, well-understood, questions. These are the best areas to convert to an expert system. This frees the human expert to concentrate on the complex problems that can not be done by an expert system. Codify a problem-solving technique for future users. Most organizations have people that are experts on some subject, but the expert has never documented how they make their decisions. Having the expert build an expert system, documents and preserves the steps they use to make their decisions. Allow the problem-solving skills of several people to be combined. In addition to documenting the steps a single expert may use, having a group of experts build a system separate the consensus opinion from individual views. This can be very informative and is a great way to establish consistent policy and regulatory compliance. The goal of a particular knowledge-based expert system project may be a combination of several of the above. The best problems to attack with expert systems are those that are well understood – the type of problem the human specialist is frequently asked. Typically these problems can be rapidly converted into expert systems with immediate payback. Building such systems frees the expert from the routine questions, allowing them to concentrate on the problems that can not be handled by an expert system, and enables less skilled staff to quickly work at a higher level. Companies effectively using expert systems have found that “experts” are much more common in a company than it seems at first. The “expert” is the person who knows the answers in a specific or specialized domain. Many people in a company have specialized information needed by others. It can be the person(s) knowing the best product for a customer, how to fix a complex machine, provide answers at a Help Desk, ship a package, or comply with regulations - usually there is an “expert” that everyone turns to. A knowledge-based expert system takes the expert’s knowledge and enables it to be preserved and disseminated. EXSYS 's Approach to Knowledge-Based Expert System Development Traditionally, with most expert system vendors, development has been a major expense both in time and money. Getting even a single system built was a big project. The cost of system development prohibited building expert systems on more than a few projects. EXSYS software Technical Overview -3- tools and solutions change that. The key to implementing expert systems widely, effectively and at low cost is to make expert system development tools easy-to-use and readily available to the domain experts. EXSYS provides a multi-level approach to expert system development by providing a suite of tools and solutions for development and delivery of knowledge-based expert systems, combining many advanced features with the proven ease of the development interface. EXSYS tools are designed to meet the increasingly sophisticated development and distribution needs of experts building complex expert systems. The goal of EXSYS is to balance the conflicting requirements of flexible power and ease-of-use. To do this, we provide development tools that can represent the specialists' knowledge in multiple ways, allowing developers to use the easiest technique that will meet their needs. As more power is needed for certain applications, higher level tool functions can be used with advanced features to give the developer complete control over the inference engine, modularization of the knowledge base, flow of execution, user interface and integration with other programs. Once the system is built there are two ways to deliver it to end users, standalone and on-line via the Web. The Web Runtime Engine allows systems to be easily and rapidly moved to a Web site and run on standard web browsers. EXSYS Software Tools EXSYS - Development Tool The current EXSYS software reflects extensive feedback from developers and end users on what tool features are needed to solve real-world problems. EXSYS development tools and its predecessors have been used to build tens of thousands of expert systems. EXSYS provides two ways to represent and store knowledge. Applications can be built by simply creating tree diagrams of decision-making logic. The tree diagram approach requires only a short learning curve, because the system converts the trees to rules, enabling developers to rapidly build applications, . The trees are automatically checked, by the system, for completeness and for a variety of logic errors. The tree diagram approach makes it easy for developers to understand the logic without having to learn complex syntax. Tree-based applications are often built in just a few days. EXSYS also includes a rule editor where individual rules can be built and fine tuned one at a time, allowing logic that can not be diagrammed as trees to be represented. This greatly expands the number of problems that can be solved. Since the trees and individual rules can be mixed in a system, the best representation technique can be used for each part of a problem. Rule representation is a little more complex to use than trees, but novice developers are able to prototype their application by taking a 3-day training class. The "Getting Started" tutorial is also a great training tool for those new to expert systems. Technical Overview -4- EXSYS supports a variety of ways of handling uncertain data, ranging from a simple yes/no confidence to complex fuzzy logic systems. A procedural command language, frames and a wide variety of interfaces give the developer flexibility in control of system execution, access to data and integration to other programs. The ease of getting started, combined with the proven ability to handle complex problems has made EXSYS the tool of choice by both beginners and professional knowledge engineers. Runtime Delivery Tools EXSYS provides flexibility in delivery of the completed expert system applications. The Web Runtime Engine enables applications to be run from a web server using standard browsers. The screens used to ask questions, present results and explain the basis for the logic can be custom tailored to match the look-and-feel of a site. The development environment has special features for associating custom HTML screens with applications. These screens can be edited directly from the development environment using your favorite HTML editor. A stand-alone runtime is also provided for applications that are not practical for web-based distribution due to: sensitive information, inability to access the web, need to run on laptops, applications embedded in non-web systems, monitoring applications or systems that are run so frequently it is better to run locally than remotely. All applications can be run either stand-alone or on the Web. Technical Overview -5- EXSYS Software Terminology and Inference Engine EXSYS software is rule-based with many enhancements such as Frames, SQL and the Procedural Command Language. IF-THEN-ELSE rules are used to describe the logic of the system. The rules may be built one at a time in a rule editor or built by converting a tree-diagram representation of the logic. Some key terminology to be familiar with: Goals - Expert systems usually are designed to arrive at a conclusion or recommendation. In EXSYS , these possible recommendations are called Goals. These might be a recommended product or action to take, an equipment diagnosis, or a way to implement a policy. Questions - This allows the user to select one (or more) values from a pre-defined list of choices. Some examples: The weather is 1 Sunny 2 Cloudy 3 Raining 4 Snowing The light is 1 On 2 Off Variables - EXSYS supports both numeric and string variables. Variables can have up to 18 character names and are indicted by [ ]. When building a system, expressions, parenthesis, Boolean operators, trig functions and exponential functions are supported. An IF part test expression might be: IF (([X] < [Z]) AND (SIN([X] / 2) > .4)) In addition to the more standard mathematical operators, EXSYS also supports, MIN, MAX, the C language conditional assignment operator (__?__:__) and an approximately equal operator to handle round-off error problems. String variables can be tested for alphabetical order and can be concatenated. Technical Overview -6- Rules Expert systems deal with knowledge rather than data and the files they use are often referred to as knowledge bases. This knowledge is represented as rules. A rule is made up of a list of IF conditions (normal English sentences or algebraic expressions that can be tested to be TRUE or FALSE), and a list of THEN conditions (more sentences) or statements about the probability of a particular data or Goal being the appropriate solution to the problem. If the computer determines that all IF conditions in a rule are true it adds the rule's THEN conditions to what it knows to be true. The computer determines what additional information it needs and how best to get the information. If possible, the program will derive information rather than asking the user. This ability to derive information allows the program to combine many small pieces of knowledge to arrive at logical conclusions about complex problems. A EXSYS rule is divided into five parts: an IF part, a THEN part, an optional ELSE part, an optional NOTE, and an optional REFERENCE. IF Conditions THEN and Conditions Goals ELSE and Conditions Goals NOTE: -------------------REFERENCE: --------------The IF part is simply a series of tests, expressed as English sentences or algebraic expressions. The test conditions are statements which may be true or false. For example, THE COLOR IS RED or [X]>1. The first statement will be true only when an item is red, the second will be true only if the value of the variable X is greater than 1. The IF conditions are tested against the data provided by the user, information that can be derived from other rules, and data obtained from other sources. The IF part, THEN part and ELSE part can each have up to 128 conditions. In the IF part, the tests can be combined with either AND or OR. Boolean operators can also be used to build complex logical tests. The THEN part can contain conditions similar to the IF part, but in the THEN part, they are not tests, but statements of fact. In the IF part we could have TODAY IS WEDNESDAY and it would be a test that might be true or false. The same statement in the THEN part would be considered to be a valid fact, if the IF conditions in the rule were true. When the IF conditions in Technical Overview -7- a rule are determined to be true, EXSYS assumes the THEN part is true and adds any facts in the THEN conditions to what it knows. The THEN part can also contain the possible goals that the expert system will decide among along with their assigned probability values. EXSYS keeps track of the value each goal receives and calculates a final confidence value for each of the choices. The THEN conditions may also include statements that assign a value to a numeric or string variable. This allows values to be calculated during a run and, optionally, displayed at the end. The ELSE part is the same as the THEN part and is applied if any of the IF conditions are FALSE. The ELSE part is optional and not needed in most rules. (Rules built in tree structured systems have only IF and THEN parts.) In some cases it is desirable to add a Note to a rule to provide some special information to the user. If there is a note added, it will be displayed with the rule. The note does not affect the logical operation of the program, and is very useful to provide information to the end user. The notes, from rules that fired, can also be output using the report generator. The developer of the expert system knowledge-base may also add a reference for a rule. This is intended to help the end user find the source of the knowledge contained within a rule or for more information if they should need it. As with the note, the reference is optional and only for the end user's information. It has no affect on the running of the program. The difference between the note and the reference is that the note is displayed whenever the rule is displayed. The reference is displayed only if the user requests the reference. The references, from rules that fired, can also be output using the report generator. Both Note and Reference elements can contain links to other pages in web sites. This is especially useful for product descriptions, specific requirements or to display a part of a complex regulation or policy. Backward Chaining Backward chaining is a term used to describe running the rules in a "goal driven" way. In backward chaining, if a piece of information is needed, the system will automatically check all of the rules to see if there is a rule that could provide the needed information. The system will then "chain" to this new rule before completing the first rule. This new rule may require information that can be found in yet another rule. The system will then again automatically test this new rule. The logic of why the information is needed goes backwards through the chain of rules. For example, suppose we have a rule that we are testing: Rule 1 IF The day is hot THEN Go to the beach Technical Overview -8- The system needs to know if the day is hot. EXSYS would automatically check all rules to see if there is a rule that would help determine if the day is hot. Suppose it finds Rule 35: Rule 35 IF It is summer and It is sunny THEN The day is hot The program will automatically test Rule 35 and wait to finish testing Rule 1 until Rule 35 is done. Rule 1 is now in the chain. If there are any other rules that tell the program if it is summer or if it is sunny, these rules would be automatically called and tested before Rule 35. And so on, until there are no rules that can add needed information. Then the chain will unwind back to the starting rule. In EXSYS software backward chaining is used as the default (Forward chaining is also available). The called rules can be anywhere in the expert system. It is NOT necessary to specify which rules apply to which information. Backward chaining simplifies the development of the expert system. Each rule can simply state an individual fact. Unlike some expert system tools, you do not have to explicitly assign the relationships between rules. EXSYS will automatically find the relevant rules and use them. In a backward chaining system, the rules can be in any order. As new facts are added to the system, rules are simply added and EXSYS will automatically determine when and how to use the new pieces of information. Forward Chaining Forward chaining is the alternative to backward chaining. Forward chaining is a "data driven" way to run the rules (unlike the goal driven approach of backward chaining). In backward chaining, there is always a goal to be satisfied and a specific reason why rules are tested. In pure forward chaining, rules are simply tested in the order they occur based on available data. If information is needed, other rules are not invoked - instead, the user is asked for the information. Consequently, forward chaining systems are more dependent on rule order. However, since time is not spent determining if information can be derived from other rules, forward chaining is much faster. EXSYS also provides a hybrid between backward and forward chaining where the basic approach is data driven, but information needed by rules is derived through backward chaining. This system combines the best of both worlds. Another technique is to divide an expert system into subsets of rules and run some in forward chaining and some in backward chaining with the Procedural Command Language. This enables the you to fine tune the chaining methods for the system. Technical Overview -9- Procedural Command Language The EXSYS Procedural Command Language was developed to solve a major problem encountered in rule-based systems. When procedural control of a system is closely coupled with the logic of the rules, it often becomes necessary to use artificial logical structures to force procedural operations to be performed. Such systems are difficult to develop and maintain and can be very confusing to the end user. To solve this problem, EXSYS separates the logic and procedural operations. The Command portion of a system defines the procedural operation. This removes procedural commands from the rules and allows the rules to represent only the logic of the system. The procedural and logical operations can communicate, but they do not get in each other's way. Complex systems are easier to build, maintain and understand. EXSYS is the only expert system development tool that uses this powerful approach to solve the problem of logical and procedural control. The Procedural Command Language syntax is somewhat like DOS batch language plus a little BASIC. The commands use syntax that is easy to follow and maintain. The Procedural Command Language provides control mechanisms for the input of data, execution of rule subsets, looping, and display of results, and it can change most of the EXSYS default operations. The Command Language is used in conjunction with the Report Generator specifications for even greater control. The Procedural Command Language program is a text file that can be created and edited with any text editor, or with the built-in Command File editor. If the command file is present, it is used. If it is not found, EXSYS reverts to the standard defaults. Like many advanced functions, the Command File need only be created when it is needed. The Procedural Command Language includes commands for: • • • • • • • • Controlling command flow: (WHILE, IF, GOTO, ...). Running rules or subsets of rules in forward or backward chaining mode. Calling report specification files. Displaying results or intermediate results. Instantiating facts or data. Screen control to ask questions. Calls to database or spread sheet files. Calls to external programs. While only a small part of the commands in the language can be described here, this short example gives some idea of the power and flexibility that can be achieved. This is not an actual expert system command file, it is simply a collection of commands for illustration purposes. (The line numbers are added only for reference, they are not part of the Command Language.) 1 SET [Z] 0 2 :START_LOOP 3 RULES [X] /F Technical Overview - 10 - 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 IF ([X] > 5) RULES "PART 1:*" REPORT "FIRST.RPT" ELSE RULES "PART 2:*" REPORT "SECOND.RPT" ENDIF RESULTS CLEAR ALL WHILE ([Y] > 0) RULES 100-200 /C WEND IF ([ABC] < 0) SET [Z] ([Z]+1) GOTO START_LOOP ENDIF This program would first set variable [Z] to 0 (line 1). Line 2 is a loop branch point. Line 3 would run all of the rules that derive a value for variable [X] in a forward chaining mode. It would then test the value obtained for [X] (line 4). If [X] is greater than 5, the set of rules whose name begins with "PART 1:" would be run in backward chaining mode (line 5) The results printed using the report specification "FIRST.RPT" (line 6). If [X] was not greater than 5, the subset of rules whose names begin with "PART 2:" would be run in backward chaining mode (line 8) and the report "SECOND.RPT" used (line 9). In either case the results would be displayed to the user (line 11), All rules, qualifiers, variables and choices are reset to unknown (line 12). The program will then determine the value of variable [Y] by running the relevant rules and test the WHILE condition. Technical Overview - 11 - As long as the value of [Y] was greater than 0, the program would continue to run rules 100-200, clearing all data before each run, (line 14). and If the variable [ABC] is less than 0 (line 16), the program would increment [Z] (line 17) loop back to the start (line 18). To create a similar execution sequence in other programs would require several separate knowledge-bases, a blackboard file and some technique to control the order in which programs were called. In EXSYS, only a single knowledge-base is needed and the steps in the execution can be clearly defined. There are great advantages to using a Procedural Command Language operating over a structured set of rules for complex applications. Confidence Modes EXSYS provides 6 ways to handle uncertain data, the confidence or probability factors within your expert system. The different systems are designed to provide a range from simple and intuitive confidence systems, through customized systems that enable the developer to implement complex ways of handling confidence. The confidence methods provided are: YES / NO System If the system does not require any estimate of probability, the YES/NO (0/1) system is best. This confidence system is very easy to use since the first rule that fires for a choice, sets the value to 1 for Yes, or 0 for No. No intermediate values are assigned. This confidence system is good for selecting choices from a list, an automated questionnaire, or other systems where the choices used by the system are definitely "yes" or "no". 0-10 System The 0-10 System provides confidence values on a scale of 0-10. This is often quite compatible with the intuitive knowledge used in the development of an expert system. A value of 0 locks the value for the goal at 0 (No - not possible) and a value of 10 locks the value at 10 (Yes definitely selected). Confidence values between 1 and 9 are averaged to give a relative likelihood. This system can positively select or reject a goal (with a value of 10 or 0) but can also allow intermediate values to indicate goals that may also be appropriate. When obtaining a human expert's intuitive recommendation in an event, a 0-10 scale is often comfortable and easy to use. Unless valid statistical data is available, precision higher than 0-10 is difficult to obtain from intuitive human knowledge. Despite its simplistic calculations, the 0-10 System is quite suitable for many expert systems and has been used to build thousands of real-world applications. Technical Overview - 12 - -100 to 100 System Values can be assigned to goals in the range of -100 to 100. This provides greater resolution than the 0-10 system. However, there is no value that locks the value at "yes" or "no", values of 0, 100 and -100 are treated like any other value. Also there are three methods of combining the confidence values - average, dependent probabilities or independent probabilities. The -100 to 100 System is effective if statistical data, accurate to two significant figures, is available or if the nature of the problem requires that the confidence factors be combined as dependent or independent probabilities. Increment/Decrement System Points are added to or subtracted from the total score for a goal. A rule can add or subtract as much as 100 points from the total for a goal. At the end, the total value for each goal is displayed. This system differentiates among possible solutions that would provide similar or identical scores using other systems. This system is intuitive and easy to use and particularly good for problems that select among a group of items based on conflicting requirements or indicators. Custom Formula System In this system, you can write your own formulas for the combination of confidence values. This provides enormous flexibility. One method of combining confidence values can be used in one part of an expert system and another method in the rest of the system. This is a more complex system, but it can be used when a problem cannot be solved by one of the other systems. This flexibility allows very complex systems of confidence factors to be built. Fuzzy Logic Fuzzy logic is a very powerful technique that enables you to build expert systems that can handle imprecise data (i.e.: The temperature is a little hot) and more closely reflect the real world. In the Fuzzy Logic confidence mode, fuzzy membership functions are defined which assign confidence to items based on the value of a variable. These confidence values are propagated through the rules to the confidence assigned to goals. Specific values can be defuzzified out of the results to have the system give precise recommendations. EXSYS Frames FRAMES provide a way to efficiently represent certain types of data that have a hierarchical structure. Frames allow multiple columns and complex search criteria with Boolean operators. The data in a frame can be read or updated by the expert system. Frames provide inheritance which allows a hierarchical set of frames to be created with data in "parent" frames available to lower level frames. The use of frames provides a way for EXSYS applications to handle data that is portable and maintainable. Frame data is accessed by a FRAME command that can be used in rules, associated with data items, or called from the Command Language or report generator. Technical Overview - 13 - EXSYS Blackboards Blackboards provide a flexible means for EXSYS systems, and other applications, to store and retrieve data. The data is typically shared among multiple expert systems and other programs in a knowledge-based application. A set of blackboard commands enable you to read or write data to the blackboard and to maintain the blackboard. The blackboard files are simply text files and can be easily read or created by other programs. Parameter Replacement Data dynamically set by the expert system can be inserted in any text string, formula or command. In EXSYS, variables are designated by including them in square brackets. For example, [X] would be the variable X. If a string contains the variable in double square brackets [[X]], the value/text for the variable will be inserted into the string before the string or command is executed. Similarly, question text and choices can also be embedded in a text string. This simple feature enables you to write dynamic commands that are modified and set by the system and user input. Notes can easily contain the actual data provided by the end user, or obtained from an external program. Complex meta-rules can be developed to step through arrays of data. Self-modifying command files can be generated. The use of parameter replacement is a deceptively simple function that allows the building of very complex systems. A simple example of parameter replacement is the development of user interfaces that reflect data input. You might have a string variable [NAME] that is obtained from the user or a database which contains the name of the user. We could make the prompt to ask a question: [[NAME]], please tell me... EXSYS will automatically replace [[NAME]] with the actual user name at the start of the prompt. This is a very simple use of parameter replacement, but it shows how easily such customization can be added in a system. In other expert system development tools embedding the name would be difficult or impossible. The EXSYS Developer Interface EXSYS introduces a new approach to building knowledge-based expert systems rapidly through a combination of a tree-structured representation of the knowledge and the ability to add individual rules to enhance the logic where tree-based representation is inappropriate - a unique Technical Overview - 14 - tool that can be learned in a very short time, but with growth potential to handle complex problems. Systems developed with EXSYS can run on the Web using NetRunner or serve as stand-alone applications. The Procedural Command Language can be used to control the execution of the expert system and interface to other programs and data sources. Tree representation can be used for any problem that involves a selection from among a definable group of goals, where the decision is based on logical steps that can be described as a set of tree diagrams. The trees can involve relative probabilities of a goal being correct. Trees can also be used to derive data needed by other trees or rules. Individual rules are added to represent specific facts that can not be represented as trees (usually rules requiring an ELSE part, or specific facts that are not part of an overall structure of information) EXSYS is easy to use, no special languages are needed and all input is in the form of English text, algebraic expression or menu selection. It is not necessary to memorize complex rule syntax. The systems produced by EXSYS can be run on the Web with The Web Runtime or stand-alone. Essentially all of the instruction necessary for an end user to run a fielded application is provided by the program and all output is in English. Little or no training is required to run an already developed knowledge-based system. The end user of the system can ask HOW conclusions were reached or WHY information is needed. The program will respond with a full explanation of the logic used to arrive at the conclusion, including backward chaining. The developer can customize screens and decide what options are available to the end user. EXSYS is designed to look like a notebook. Sections are divided with page tabs. Clicking on a page tab will bring you to the specified section. EXSYS DEVELOPER Building trees in EXSYS is very similar to drawing tree diagrams on paper. EXSYS provides a variety of data items to use in the trees and ways to edit the trees. Technical Overview - 15 - Trees A tree is a branched decision-tree that represents all, or a portion, of the decision-making instructions. In EXSYS trees look like: Nodes A tree is made up of nodes that represent decision branch points, and those that are assignments of value. These correspond to IF and THEN conditions in a rule. The IF nodes always have at least 2 values - and may have as many as 30. The various values are joined together in a block. In the example, Test 1, Test 2 and Test 3 are all IF nodes. The node values can be multiple choice text items, ranges of a numeric variable or true/false tests of a mathematical expression. THEN Nodes have a single value and assign a value to the goal of the expert system, assign text or numeric data, display a message to the end user, or annotate the tree. Factors Factors are text or numeric data items that are used to define the nodes. There are two types of factors: Questions and Variables. Questions are multiple choice lists. These are typically text and can contain up to 30 values. For example, if the day of the week is relevant in reaching the application's conclusions, we could have a question of "Today is", with possible choices: Technical Overview - 16 - Monday Tuesday Wednesday Thursday Friday Saturday Sunday A question condition is a statement in the tree (or rule) made up of the starting question text and one or more of the associated choices. Questions can be used in the IF part of a tree branch to test a value or in the THEN part to assign a value. Variables are numeric or string variables. A numeric variable value may be any value between its upper and lower bounds. For the purposes of building the tree, the value of the variable is divided into ranges defined by the logical break points in the decision making process. Goals Goals are the things that the expert system will decide among. A system to recommend products would have the various products as goals. A system to determine the cause for a failure in a machine would have the possible items that could breakdown as goals. Depending on the Confidence Mode used, a goal may be assigned a confidence value to determine its relative likelihood. Goals can only be used in the THEN part of trees. Technical Overview - 17 - Take a very small example that identifies items on the desk: TELEPHONE Black Color? YES COMPUTER White Makes noise? NO Color? FLOPPY DISK Black Shape Flat PAPER White Cylindrical PENCIL When converted to EXSYS form this will look like: It is easy to draw the tree logic on paper. It is just as easy to draw a tree in EXSYS once the editing commands are learned. Balloon Display EXSYS automatically converts each branch of the tree to an IF-THEN rule. To see the rule that is associated with any branch, click on a node. A balloon will be displayed showing the rule up to that node. For example, a click on the box labeled Computer would display: Technical Overview - 18 - Adding Nodes to a Tree When a new tree is created, it will only have a terminal node that says "Double Click to Add Factor". Technical Overview - 19 - To add an element to the tree, double click on the terminal node. This will bring up a dialog box for adding factors. A question condition on "The color of the light", could be added by clicking on the Question button in the Add Element IF: Factor box. This would display a dialog box with all of the Questions: In this case the statement that "The color of the light is Red" has been selected. This will be added to the tree. Technical Overview - 20 - The node that was added takes into account all possible answers that the end user might provide for the question. The choice we selected, "The color of the light is red", is in the top line, but branches were automatically created for the other possible answers. The result is four branches, each with a terminal node. In this way EXSYS automatically creates branches and guarantees that the tree will be complete. The ability to add nodes rapidly with a point-and-click interface, plus EXSYS 's feature of automatically expanding the tree to consider all possible combinations of input, allows rules to be built very rapidly. The developer is prompted to consider all possible cases, which can be an excellent way to extract knowledge from the expert and guarantees system completeness. In some cases, it is not desirable to add a separate branch for each of the other possible values of the question. EXSYS provides three options. At the bottom of the dialog box where the question and choice was selected, is a set of radio buttons that control how the other choices are grouped. In the example, the default of "One branch per other choice" was selected. This causes each of the other choices to be given an individual branch. The second option is "All other choices in one branch". This causes all of the other values to be put in a single branch. If this had been selected, the tree would look like: Technical Overview - 21 - There would only be two branches from the node. The third option is to do custom grouping of the other choices. This provides custom control for the number of branches created and what choices are associated with them. Selecting the "Custom" option displays the dialog: This dialog would allow selection of the following custom groups: Group 1 2 3 Values Red Yellow, Green None - light off This would build the node: Technical Overview - 22 - In this case four branches were created. The Custom option gives total control on the number of branches and choices associated with them. The ability to add nodes rapidly with a point-and-click interface, plus EXSYS 's feature of automatically expanding the tree to consider all possible combinations of input, allows rules to be built very rapidly. The developer is prompted to consider all possible cases, which can be an excellent way to extract knowledge from the expert and guarantees system completeness. In most applications there would be multiple trees each representing a different aspect of the decision-making problem. Trees can assign values in their THEN part. IF other tree nodes require these choices, the appropriate rules will automatically be called through backward chaining. The trees built with EXSYS can be printed and reviewed with other experts. Since the trees are easy to read, this facilitates group consensus on the application and is especially helpful when someone other than the expert is building the system. T Individual Rules Trees are an ideal way to rapidly develop most systems. However, the logic of some systems can not be described as trees. These systems require that individual rules be built. EXSYS provides a Rule Editor for this ability. Rules are entered in an editor window that looks like: Technical Overview - 23 - Clicking on the Question button brings up a list of the questions in the system and their associated value lists. To build a rule condition, simply click on the desired question and the desired choice(s). The condition will appear in the rule window. You only have to type the qualifier text when it is first created or if it needs to be edited. Mathematical expressions and choice conditions are just as easy to input. If you want to add a custom command or access data from another program, click on the Command button. Just fill in data in a few of the dialog boxes and EXSYS will build syntactically correct commands for you. You don't have to memorize the command syntax. Frequently the first few conditions in a rule will be identical to the previous rule. Just click the Repeat button once for each condition and they will be copied into this rule. Rule editing is just as easy. Simply, select a rule to edit and change, delete or add. Conditions can be deleted or changed. Conditions may also be cut or copied from other rules. The EXSYS Rule Editor is a powerful and flexible tool for knowledge-based expert system development. It enables you to rapidly write rules using the same data elements as the trees. When you want to test the rules, select "RUN" from a menu and you are running. If you want to cancel a run and return to edit mode, just make another menu selection and you are back in the edit mode. This rapid edit-test-edit cycle speeds expert system development. It is made possible by EXSYS 's incremental compiling of the rules as they are entered. As each rule is input, it is compiled to EXSYS 's internal representation. This means that the rule editor has access to the logic of the rules already entered. If you enter a rule that is potentially in conflict with an existing rule, the editor will immediately tell you and give you the opportunity to correct it. Technical Overview - 24 - Debugging Whenever you are writing down the logic of a process, either in programming or in building a knowledge-based expert system, errors will occur. Tracking down the errors can take time and effort. EXSYS provides a variety of tools to assist you in debugging your systems. A trace window displays the history of the session – the order in which the rules fired, what data was set, etc. This allows you to follow exactly what happened and find the error. This trace can also be directed to a file for later reference. During a run, whenever EXSYS asks for data, you can ask "WHY" it is asking. EXSYS will display the logic that required that item of data. Also you can display any rule, the data known to the system and the status of the choices. In all cases, you can ask how a particular item of data was derived to trace back the logic and find any errors. EXSYS can also generate cross reference listings to show you where data items are used and what rules assign values to variables, etc. Automatic System Validation Testing and validating a knowledge-based expert system must be a major part of any expert system development project. It is important to make sure end users will get valid answers to any input. EXSYS 's automatic validation function greatly simplifies and automates this process. EXSYS will automatically test your application, unattended, for a variety of errors. Your applications may be tested overnight or while you are on vacation. EXSYS supports two methods of validation testing; systematic and random. Systematic testing allows all possible combinations of input to be tested for a variety of possible errors. If the expert system is very large and systematic testing of the entire system would take too long, testing of portions of the system or random testing of the entire system can be performed. EXSYS has built-in functions to automatically validate your application and check for a variety of common errors. This function is run by clicking on the Validation tab. To validate a system, click on the Check System button. Technical Overview - 25 - Two different types of validation are performed on the system. The first looks for errors that can be found rapidly. The second part actually runs the system with all of the possible combinations of input data. Sets of input are systematically generated, and used to test the rules. During each run, validation looks for various types of errors. EXSYS will automatically setup the validation parameters, or you can fine-tune the testing to a limited part of the system through the "Advanced Options" setup. Report files can also be generated by the testing, reporting special information on the tests. Three files are produced during validation - two types of tree diagrams, and an error report file. The tree diagram shows all of the possible combinations of input and the resulting output of the system. Regardless of the complexity of the logic of the system, the input and output can always be diagrammed as a tree. The trees can be examined with a special display routine in EXSYS that enables you to scroll through the tree diagram. The nodes on the diagram are written in an abbreviated form, e.g. "Q3:2", means Question number 3 choice 2. When the tree diagram is displayed, a mouse click on the node expands the abbreviated form to the full text form of the question or variable. The two types of tree diagrams produced are linear and branched tree diagrams. They are equivalent in information content, but are diagrammed differently. The branched tree diagram graphically shows the branching in the system. Technical Overview - 26 - This is convenient for seeing the overall structure. In a large tree, if a particular set of input produces an error, it may take some scrolling to read all of the information on the input. In a linear tree diagram, all of the node values for a branch are displayed on a single line. A tree would be displayed as: In the linear tree, it is easier to follow the data that lead to the conclusion, since all of the data is on a single line. When random testing is selected, only a linear diagram will be created. Due to the random nature of the testing, the data will not be tree structured. Technical Overview - 27 - The error file contains reports of any detected errors which were detected and the input which produced the error. The validation function will detect and report combinations of input that: • Produced no conclusions. • Failed to derive needed data that should be derived. • Created loop errors. • Assigned a value which is outside of the limits specified. • Assigned more choices than the maximum number allowed. • Failed special custom tests designed with the report generator. In addition, the system is checked for: • Incomplete tree Branches • Questions Not Used • Variables Not Used • Goals Not Used • Inconsistent use of an item in a tree EXSYS also provides statistics on rule utilization, especially rules not used, and statistics on the assignment of confidence factors for conclusions. You can examine these statistics to see if they are what you would expect. In most knowledge-based expert systems, some questions will only be asked when the user answers preceding questions in a particular way. In EXSYS 's validation mode, only the combinations of input that might actually be supplied by an end user are considered. This usually reduces the number of tests that must be run to far less than the total number of all possible combinations of data. You can either test the entire system, or limit the testing to part of the system by reducing the number of parameters that EXSYS tests. Once the parameters are set, EXSYS takes over and runs unattended. Most validation tests run quickly. Depending on the size of the application and speed of the computer, tens of thousands, to hundreds of thousands of tests can be run overnight or over a weekend. Just start the EXSYS Validation and you will have a report of any errors it finds when you return. Validation testing is also a very valuable system maintenance tool. If you make some changes in your computing environment and want to make sure your applications are still performing Technical Overview - 28 - correctly, create a validation test file, change the environment and create a new validation test file. The two files should be identical. If they are not, you can compare them to see where problems have developed. EXSYS Report Generator EXSYS includes a Report Generator language that allows you to specify exactly what information is to be output and in what format. The Report Generator language is easy to learn with very simple commands. For example, the command "V" outputs all variables with their values. The command "G" outputs all Goals. However, each command has many optional parameters that can be added to the basic command. For example G3 >6 /"XXXXX" will print the string XXXXX if goal 3 has a value greater than 6. There are many options for formatting reports. The report generator output can go to a file or printer. A single command will display the text file created by the report generator and allow the end user to scroll through it. EXSYS Custom Screens End user acceptance is the key to successfully fielding expert systems. Systems fielded on the Web via The Web Runtime can use custom HTML screens to ask questions, present results and explain the basis for a decision. These screens are based on standard HTML and have the full flexibility of graphics, fonts, controls, animation. etc., supported by HTML. The screens are created from templates provided with EXSYS and can be edited or customized using your favorite HTML editor. When systems are run, the custom HTML screens are automatically used to give the system the desired look and feel. Also, since all of HTML is supported, hypertext links to other web pages can be easily implemented. The EXSYS End User Interface EXSYS gives you the tools to design and control the end user interface. Custom screens (both stand-alone and HTML) control the way questions are asked. The Configuration options and the Report Generator give you complete control of how the results are presented to the end user. Hypertext enables you to provide multilevel, context sensitive help to your users. Customized Screens When the end user runs the system with The Web Runtime, the look and feel of the system is controlled by the HTML screens associated with the system. This enables you to blend the system into your existing site and add special features that your users need. Technical Overview - 29 - Why and How While the end user is running the system, they can ask questions, just as if they were working with a human expert. They can ask why a question is being asked. EXSYS will display the rules it is currently testing, that require the information. Because EXSYS rules use English statements and algebraic expressions, without complex syntax, it is easy for even novice users to read and understand the rules. At any time during the run, the end user can display the facts known to the system and ask how a fact was derived. EXSYS will explain the source of the data. When the conclusions of the system are displayed, the user can ask how a conclusion was reached and EXSYS will display the rules used. Change and Rerun At the end of a session, when the results are displayed, the end user may choose to display all of the data they input. They can then change one or a few of the answers and rerun the system with the new data. EXSYS will display the old and new results side-by-side for comparison. This type of "WHAT-IF" testing is very useful when the end user was not sure of a particular answer. By comparing the affect of an answer on the results, they can determine whether a particular question is critical to conclusions. They can examine the sensitivity of the conclusions to that answer. This change and rerun process can be repeated as often as needed. Text Explanation In many knowledge-based expert systems, it is desirable to give the end user a text explanation of what the system did. This is easily implemented in EXSYS. Each rule can have an associated Note or Reference. Notes can be used to explain the meaning of the rule, and references can be used to give the source of the fact represented by the rule. The notes in all of the rules that fired during a session can be put into a report with a single command. The notes may have the actual values for variables or choices included with parameter replacement. The report file produced will be an English text explanation of what the system did, and can be displayed to the end user or saved with the system's recommendations. Undo If the end user makes a mistake answering a question, they can select "Undo" and backup and correct error. When running with The Web Runtime on the web, they can simply click the "Back" button on their browser to go back to an earlier question. Report Generator EXSYS has a flexible report generator to output the results of a run to files or other programs. With some applications, it is desirable to keep a history of user input and interaction with the system. This can easily be done using the report generator. Technical Overview - 30 - Context Sensitive Help The built-in hypertext system and custom screen language make it easy to add multi-level help systems to an application. If the end user does not understand a term, help is a mouse click away. Integration EXSYS has a very open architecture. It can be integrated with your existing applications. EXSYS can be front ended by programs to provide data. EXSYS can provide the results of a run to other programs, and call other programs during a run for data acquisition or other functions. For more information contact: EXSYS , Inc. 8400 Menaul Blvd. NE Suite 124 Albuquerque, NM 87112-2200 Technical Overview - 31 -